Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async dash bio #430

Merged
merged 13 commits into from
Nov 5, 2019
Merged

Async dash bio #430

merged 13 commits into from
Nov 5, 2019

Conversation

Marc-Andre-Rivet
Copy link
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet commented Oct 22, 2019

Follow-up to plotly/dash#899. Dash-bio is the heaviest component package after DCC. This PR makes all components async.

** Finalizing this will require dash==1.5.1 with async support to be released and updating the @plotly/webpack-dash-dynamic-import plugin to 1.1.1

About

  • This is a new component
  • I am adding a feature to an existing component, or improving an existing feature
  • I am closing an issue

Description of changes

Before merging

@shammamah-zz shammamah-zz temporarily deployed to dash-bio-test-pr-430 October 22, 2019 19:40 Inactive
@shammamah-zz
Copy link
Contributor

@Marc-Andre-Rivet Could you please merge in the latest changes from master? Other than that it looks good to me.

@alexcjohnson
Copy link
Collaborator

What happens if someone upgrades to async-friendly dash-bio but they still have pre-async dash 1.0? Do we need to bump dash-bio's dash requirement up to 1.5?

@Marc-Andre-Rivet
Copy link
Contributor Author

@alexcjohnson #430 (comment)

Sadly this will fail as dash will throw upon seeing async in _js_dist so yes, this will require bumping version requirement to 1.5.0.

@shammamah-zz shammamah-zz temporarily deployed to dash-bio-test-pr-430 October 24, 2019 15:36 Inactive
# Conflicts:
#	dash_bio/bundle.js
#	dash_bio/metadata.json
#	package-lock.json
#	src/lib/components/Ideogram.react.js
@shammamah-zz shammamah-zz temporarily deployed to dash-bio-test-pr-430 October 24, 2019 15:45 Inactive
'dynamic': True
} for async_resource in async_resources])

_js_dist.extend([
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but at some point - like perhaps, whenever we get around to fully generating __init__.py - this all seems ripe for abstracting into the dash core, like

_js_dist = _dash.development.list_resources(
    ['bundle.js'],
    ['async~{}.js'.format(resource) for resource in async_resources],
    external_prefix='https://unpkg.com/dash-bio@{}/dash_bio'.format(__version__)
)

May still need some tweaking to handle edge cases like async: 'eager'|'lazy', but we should at least be able to auto-detect sourcemaps (which may not exist in release versions plotly/dash#910) and set them all dynamic: True regardless of the resource setting.

@@ -42,7 +75,7 @@
).format(__version__),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey not new in this PR, but __version__ isn't used in this url?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔎 Interesting, due to how unpkg.com processes a this request, this works but will always return the latest released version of that file, could make for pretty nice bugs! Fixing.

Copy link
Contributor Author

@Marc-Andre-Rivet Marc-Andre-Rivet Nov 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone using the remotely hosted code for an old version will have a nasty surprise after this update..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcjohnson Good catch! Surprised we haven't run into it before.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dash 1.5.1 is out, once that's listed here this looks great to me! 💃

@Marc-Andre-Rivet Marc-Andre-Rivet added this to the Dash v1.6 milestone Nov 1, 2019
@shammamah-zz shammamah-zz temporarily deployed to dash-bio-test-pr-430 November 1, 2019 13:28 Inactive
@shammamah-zz shammamah-zz temporarily deployed to dash-bio-test-pr-430 November 1, 2019 13:30 Inactive
@shammamah-zz shammamah-zz temporarily deployed to dash-bio-test-pr-430 November 4, 2019 14:27 Inactive
@shammamah-zz shammamah-zz temporarily deployed to dash-bio-test-pr-430 November 5, 2019 13:39 Inactive
@Marc-Andre-Rivet Marc-Andre-Rivet modified the milestones: Dash v1.6, Dash v1.7 Nov 5, 2019
requirements.txt Outdated
@@ -2,7 +2,7 @@
# pip install -r requirements.txt
-e .
cython>=0.19
dash>=1.0.0
dash>=1.5.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the demo apps (confusing since the repo contains both the package and the demo apps)... would be better to put it here instead:

'dash>=1.0.0',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants