Uh oh!
There was an error while loading. Please reload this page.
Add optional React 16 support - #45
Conversation
utyf
commented
Feb 14, 2018
The mechanism of choosing version is not clear. |
mjclawar
commented
Feb 14, 2018
@utyf You're totally right. I just realized this last night. I'm going to close this PR for now. There's another (ugly) monkeypatch example in this PR: plotly/dash-core-components#160 |
utyf
commented
Feb 14, 2018
maybe we need to do something like this: def_set_react_version(react_version):
assertreact_versionin_REACT_VERSION_TYPES# Dash renderer's dependencies get loaded in a special order by the server:# React bundles first, the renderer bundle at the very end.setattr(_this_module, '_js_dist_dependencies', [{
'external_url': _REACT_VERSION_TO_URLS[react_version]['external_url'],
'relative_package_path': _REACT_VERSION_TO_URLS[react_version]['relative_package_path'],
'namespace': 'dash_renderer'
}])
setattr(_this_module, '_js_dist', [{
'relative_package_path': 'bundle.js',
"external_url": (
'https://unpkg.com/dash-renderer@{}''/dash_renderer/bundle.js'
).format(__version__),
'namespace': 'dash_renderer'
}])
_set_react_version('15.4.2')and then, in the code: importdash_rendererdash_renderer._set_react_version('16.2.0') |
…eact version from a dash application. Adds test for scripts versions served by Dash. Updates CHANGELOG to reflect new usage
mjclawar
commented
Feb 17, 2018
That works. Adding and reopening with that. From the updated CHANGELOG:
All previous tests still pass. Added another test to make sure that this actually updates the React version for a Thanks, @utyf ! |
chriddyp
commented
Feb 26, 2018
This looks good to me! Thank you very much for adding the test. Anything else you would like to add @mjclawar before I merge? |
mjclawar
commented
Feb 26, 2018
@chriddyp no I think this covers everything as long as you are OK with the Probably also will want to bump the default minimum React version to 15.6 soon to at least warn other dash component authors about |
mjclawar
commented
Mar 6, 2018
@chriddyp anything else you need to see on this? |
utyf
commented
Mar 21, 2018
Any news on the topic? |
mjclawar
commented
Mar 28, 2018
@chriddyp Checking in to see if you want anything else here to accept the PR. We're looking forward to using React 16 for all our Dash applications! |
chriddyp
commented
Mar 29, 2018
Sorry for the delay on this one! This looks good to me, I'll merge now and press a new release 🍻 |
chriddyp
commented
Mar 29, 2018
just published: |
Description
This adds optional React 16 support by allowing the developer to modify the React version served using, e.g.:
The default
REACT_VERSIONremains 15.4.2Other changes