-
-
Notifications
You must be signed in to change notification settings - Fork 144
Update requirements to support React 16 #165
Conversation
…yles location for react-syntax-highlighter. Comment out Dropdown to ensure that all other components load correctly with React 15.6
… dependencies handled by dash-components-archetype package.json
… react-virtualized-select
Very nice! So this is not a breaking change, correct? |
Once plotly/dash-renderer#45 is merged, perhaps we can run our tests twice, once for each version of react. |
@mjclawar - This looks good to me. Is there anything else that you would like to add? |
It is not a breaking change from the dash developer's perspective, except I can't absolutely guarantee that the underlying stylesheets for, e.g.,
That's a really good idea. Want me to add that in to this PR when you merge in plotly/dash-renderer#45? |
# Conflicts: # CHANGELOG.md # dash_core_components/version.py # package.json
@mjclawar - Now that plotly/dash-renderer#45 is merged and released, would you mind making an integration test to test both versions? Then, I'll be happy to merge and release 😸 |
# Conflicts: # CHANGELOG.md # dash_core_components/version.py # package.json
Update requirements-dev to require at least dash-renderer v0.12.1
…move dash-core-components dependency
@chriddyp Updated integration tests to test:
The way I did this was modify the Then those integration tests have a test that handles the exact same behavior as before with the older React version, such as in def test_location_link_v16(self):
self.create_test_location_link(react_version='16.2.0') This test updates the self.snapshot(self.snapshot_name('link -- /test/pathname/a?queryA=valueA', react_version)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! A couple of questions about how this will affect user-supplied CSS.
It looks like the image tests on percy aren't running because of some circleci settings (env variables aren't getting set on 3rd party pull requests) - I've just updated that setting and I'll try making another build.
I'm also going to make a prerelease version and test it on the dash-docs
repo.
- `react-dates` to `"16.3.2"` | ||
- `react-dropzone` to `"4.2.8"` | ||
- `react-markdown` to `"3.2.1"` | ||
- `react-select` to `"1.2.1"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're bumping major versions in these libraries, I bet that this will introduce some breaking changes in the component's CSS. In case any users are overriding this CSS, then their overrides won't work anymore. So, I think we should make a breaking change version bump to 1.0.0
(according to semver)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And let's leave a note in the changelog that mentions that CSS stylesheets may be different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually looked into whether or not the CSS or markup has changed in these versions, I'm just guessing that it has.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will update to 1.0.0
.
@@ -1,5 +1,5 @@ | |||
dash_html_components | |||
dash_renderer | |||
dash_renderer>=0.12.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just for the React 16 change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise can't use normal API to test React 16 version tests. Can shim something in for the tests to not update the version if you prefer.
@@ -1,3 +1,5 @@ | |||
import 'react-dates/initialize'; // https://github.com/airbnb/react-dates/issues/750#issuecomment-335013909 | |||
import 'react-dates/lib/css/_datepicker.css'; // react-dates css |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSS loaders will inject the CSS into the head with JS, is that right? I wonder if this will make it harder to override these stylesheets (i.e. will user-added stylesheets get added before or after the injected stylesheets?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSS loaders will inject the CSS into the head with JS, is that right?
Yes, it makes <style>
tags in the head, which will show up after the stylesheets.
Should I instead remove this, plus the css-loader
plugin for Webpack, and insert the newer react-dates CSS stylesheet? I hadn't realized that this was happening for serving CSS, as you note below:
Er, looks like we would only need to remove react-dates. However, we will need to update the stylesheets for the rest of the components that had their versions bumped. We'll also need to include those new stylesheets in the dash_core_components/ folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's keep the traditional stylesheets for now, that way it's easier for users to override them without removing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Oh also, can we remove the CSS files from |
Also, I'm going to make you a contributor @mjclawar - That'll make pulling down your branches a bit easier for me :) |
Er, looks like we would only need to remove Let me know when that's been done, and then I'll do the prerelease and test on |
looks like there are some issues with the snapshot name for the url test |
😡 I'll look into the formatting. Is there any way for me (or anyone) to see if the percy tests will fail/pass locally? |
Yeah, I can email you the percy API keys and you can run it locally. I'll also add you to the percy organization |
- Update css files in dash_core_components/ to newer versions to match package.json - Update MANIFEST.in to match newer included css - Update babel config to remove style loader and css loader
Fix integration test to avoid snapshotting twice in same test
- Update CHANGELOG to reflect 1.0.0
@chriddyp should be all set now:
I also moved
The
|
@@ -4,6 +4,8 @@ | |||
padding: 5px 0; | |||
width: 100%; | |||
border-radius: 6px; | |||
-ms-touch-action: none; | |||
touch-action: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, very nice - we have the diffs in here
These changes look good! Thanks for updating all of the contributing stuff as well. I'm going to make a prerelease version and test it on a couple of my projects and on the dash-docs repo. If all goes well, we should be able to release soon 🍻 |
After doing
Do you think we need to update these packages? |
Probably not |
Let me quickly check if the webpack config would need to be changed to update to v2. |
# Conflicts: # CHANGELOG.md # dash_core_components/version.py # package.json
|
Lots of changes (taking probably a couple of hours). So, up to you:
I don't think that the deprecation warning actually breaks anything at this point. |
I'll take a look at what is needed to bump the webpack version up to 4 and open a separate PR for that. Up to @chriddyp re: waiting to merge this PR until that is complete (or not). |
@chriddyp We have been using |
@mjclawar Thanks for the excellent work done here and your involvement. We now have a Dash 1.0 transition plan that includes upgrading to React 16. As such this PR will probably never be merged as-is. I will link it to the transition epic (plotly/dash#469) for future reference. |
This PR addresses all of the warnings raised by React v15.6 in
dash-core-components
.Changed
react-dates
to"16.3.2"
react-dropzone
to"4.2.8"
react-markdown
to"3.2.1"
react-select
to"1.2.1"
react-select-fast-filter-options
to"0.2.3"
react-syntax-highlighter
to"7.0.0"
react-virtualized-select
to"3.1.3"
react
andreact-dom
as peerDependencies"^15.4.0 || ^16.0.0"
style-loader
andcss-loader
to webpack babel loaders to supportnew version of
react-dates
with separate css filereact-syntax-highlighter
to:react-virtualized-select
to:Closes #164
Passes all existing tests with React v15.4.
Also works locally with
dash-html-components
using React v16 🎉 (note that to test React v16 locally at this moment requires thedash-renderer
patch proposed in plotly/dash-renderer#45 that adds optional React 16 support and movesPropTypes
toprop-types
)Additional discussion
@chriddyp I did end up having to change some of the imports as noted above to support the version updates. Existing tests still pass, but I'm not certain that you would approve of all of the structural changes, especially adding additional loaders/an alias to webpack here