Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Update React to 0.14.7 and Immutable to 3.7.6. #12035

Merged
merged 3 commits into from
Feb 14, 2016

Conversation

petetnt
Copy link
Collaborator

@petetnt petetnt commented Dec 30, 2015

This PR updates React to the newest version of 0.14.5 and Immutable to go with it.

Updating React at this point is pretty crucial (IMO) if React is continued to be used: in 0.14 there were a lot of breaking changes that are still relatively easy to fix: biggest thing was how DOM-elements are being handled in React. For example: DOM operations like render are now being handled by ReactDOM-module, getDOMNode has been deprecated for the components, this.refs.componentref returns the DOM node directly instead of the component and so on.

This PR also updates the tests involved: it fixes instances where TestUtils were used to find non-component (plain HTML) DOM Nodes and it also fixes all instances where props were being accessed instead of the DOM Nodes itself, which caused the following warnings: Warning: ReactDOMComponent: Do not access .props of a DOM node; instead, recreate the props asrenderdid originally or read the DOM properties/attributes directly from this node (e.g., this.refs.box.className).

The PR has been done in backwards compatible fashion to the extent it is possible: extensions that are using deprecated methods and features should update themself before React on Brackets is updated to 0.15 some time in the future.

@MiguelCastillo
Copy link
Contributor

Great to upgrade. Always a lil scary due to tainted historical experience when the tree was first implemented. I will pull down this branch and help you test it.

@petetnt
Copy link
Collaborator Author

petetnt commented Feb 13, 2016

@MiguelCastillo Yup. Like I said, the this particular update is quite important as 0.13 -> 0.14 did contain tons of breaking changes. However the changes themselves are rather trivial to fix.

That said this PR is (again) a bit outdated as React is already on 0.14.7. But as this PR fixes the critical things for an update path, upgrading to 0.14.x or 0.15 should be trivial. I'll update this PR later when I got some spare time.

@MiguelCastillo
Copy link
Contributor

I am about to pull down your branch. It might be good to update to 0.14.7. :)

@petetnt
Copy link
Collaborator Author

petetnt commented Feb 13, 2016

@MiguelCastillo Bumped React to 0.14.7, Immutable to 3.7.6. All tests worked fine.

@petetnt petetnt changed the title Update React to 0.14.5 and Immutable to newest version Update React to 0.14.7 and Immutable to 3.7.6. Feb 13, 2016
node.setSelectionRange(0, _getName(fullname, extension).length);
ViewUtils.scrollElementIntoView($("#project-files-container"), $(node), true);
ViewUtils.scrollElementIntoView($("#project-files-container"), $(ReactDOM.findDOMNode(node)), true);
Copy link
Contributor

Choose a reason for hiding this comment

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

New behavior in 0.14 is that this.refs.name is the actual dom node. So ReactDOM.findDOMNode is redundant and no longer needed. Yay :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch: this was a brainfart due to it needing being needed @ L365 on componentDidUpdate because it targets this. Fixed.

@MiguelCastillo
Copy link
Contributor

The code is running ok right now. I will continue to run it for the rest of the day to see if I can catch any odd behavior. If all goes well, we can merge soon.

@MiguelCastillo
Copy link
Contributor

In case there is an interest in changes between .14 and .13. https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html

@MiguelCastillo
Copy link
Contributor

PR is looking beautiful. Thanks for updating!!

@MiguelCastillo
Copy link
Contributor

Looks good to me. Merging.

MiguelCastillo added a commit that referenced this pull request Feb 14, 2016
Update React to 0.14.7 and Immutable to 3.7.6.
@MiguelCastillo MiguelCastillo merged commit b87b196 into adobe:master Feb 14, 2016
@petetnt
Copy link
Collaborator Author

petetnt commented Feb 14, 2016

👍 neat. Thanks Miguel.

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

Successfully merging this pull request may close these issues.

2 participants