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

[Core] Update to React v15 #3941

Merged
merged 10 commits into from
Apr 13, 2016
Merged

[Core] Update to React v15 #3941

merged 10 commits into from
Apr 13, 2016

Conversation

nathanmarks
Copy link
Member

Worked my way through the docs to fix React v15 compatibility. Updated dependencies.

Anyone want to update the examples? 😄

some relevant issues I made while doing this:
Fixes #3940
Fixes #3942
Fixes #3943
Fixes #3945

@callemall/material-ui holler

@nathanmarks nathanmarks added this to the 0.15.0-beta.1 Release milestone Apr 12, 2016
@nathanmarks nathanmarks changed the title [WIP][Core] Updates for React v15 [Core] Update to React v15 Apr 12, 2016
@nathanmarks
Copy link
Member Author

Also... can someone test if this works with React 14? I left it as an option in peer dependencies...

@newoga
Copy link
Contributor

newoga commented Apr 12, 2016

Do these have 15.0.0 equivalents?

     "react-addons-create-fragment": "^0.14.0",
     "react-addons-transition-group": "^0.14.0",
     "react-addons-update": "^0.14.0",

Edit: Nvm, I guess it doesn't matter since they are dependencies instead of peerDependencies. What do you think?

@newoga
Copy link
Contributor

newoga commented Apr 12, 2016

Do we need to upgrade recompose to 0.17.0 too (0.16.0 added React 15 compatibility)? Once again, not sure if it matters for dependency.

@nathanmarks
Copy link
Member Author

@newoga yep I should update these:

$ ncu

 react-addons-create-fragment   ^0.14.0  →  ^15.0.1
 react-addons-transition-group  ^0.14.0  →  ^15.0.1
 react-addons-update            ^0.14.0  →  ^15.0.1
 recompose                      ^0.15.0  →  ^0.17.0

Run with -u to upgrade package.json

@nathanmarks
Copy link
Member Author

@oliviertassinari

I removed the peer dependencies for the older react version as we depend on react addons that we have upgraded to the v15 versions. In their package.json files they have react ^15.0.1 as a peer dependency... Also, the tap event plugin has a peer dependency on react 15+.

I spoke to @newoga and we're not sure what the best/most compatible setup is here that we can go with. We were hoping you might know some more about this 😄

IMO, we should avoid breaking 0.14.x if possible, but not go out of our way to support it... but with the peer dependencies is this even possible (without fuss) with the other libs/addons we use?

@nathanmarks nathanmarks changed the title [Core] Update to React v15 [WIP][Core] Update to React v15 Apr 12, 2016
@nathanmarks nathanmarks added external dependency Blocked by external dependency, we can’t do anything about it Core labels Apr 12, 2016
@newoga newoga added PR: Review Accepted PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Needs Review labels Apr 12, 2016
@nathanmarks nathanmarks changed the title [WIP][Core] Update to React v15 [Core] Update to React v15 Apr 12, 2016
@nathanmarks nathanmarks removed the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Apr 12, 2016
@newoga
Copy link
Contributor

newoga commented Apr 12, 2016

@nathanmarks I think @oliviertassinari has a new version of react-swipeable-views we can put in docs for material 15.0.0. Could you run a quick ncu on docs to see if there is any other react related dep that we should update (I think that should be it though).

@newoga
Copy link
Contributor

newoga commented Apr 12, 2016

Looks good to me 👍

@oliviertassinari
Copy link
Member

I have noticed that the Customization section of the docs is throwing a lot of warnings.

@nathanmarks
Copy link
Member Author

@antoinerousseau yep

@nathanmarks
Copy link
Member Author

@oliviertassinari thanks, completely forgot to cover that section.

shit like this:

lol

lol

@nathanmarks
Copy link
Member Author

@oliviertassinari fixed the silly docs errors 😄 👍

@oliviertassinari oliviertassinari merged commit dd13e64 into mui:master Apr 13, 2016
@oliviertassinari
Copy link
Member

@nathanmarks Nice work 👍.

@@ -204,7 +209,7 @@ class Toggle extends React.Component {
);

if (this.state.switched) {
thumbStyles.marginLeft = `-${thumbStyles.width}`;
thumbStyles.marginLeft = 0 - thumbStyles.width;

Choose a reason for hiding this comment

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

This is resulting to NaN when thumbStyles width is set to something like '10px'!

Copy link
Member

Choose a reason for hiding this comment

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

Sounds like a fair point. Do you want to submit a PR to fix it?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, my suggestion won't work. It's raising a warning:

Warning: a div tag (owner: Paper) was passed a numeric string value for CSS property marginLeft (value: -20) which will be treated as a unitless number in a future version of React.

You gonna have to use 10 instead of 10px until we change the styling approach with the next branch.

Copy link

@phanindra48 phanindra48 Sep 2, 2016

Choose a reason for hiding this comment

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

Sorry for the late reply. But things will break right because of this inconsistency.
Hope this will help

0 - parseInt(`${thumbStyles.width}`.replace('px', ''), 10)

Choose a reason for hiding this comment

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

@oliviertassinari Raised a PR - #5116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external dependency Blocked by external dependency, we can’t do anything about it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants