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

Update examples and docs to React 0.14 #901

Merged
merged 13 commits into from
Oct 15, 2015
Merged

Update examples and docs to React 0.14 #901

merged 13 commits into from
Oct 15, 2015

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Oct 15, 2015

Work in progress.

To be done in another PR:

  • Release an update to Redux DevTools @gaearon
  • Update the real world example @gaearon
  • Release an update to React Transform handling stateless components @gaearon
  • Update examples to use the new React Transform @gaearon
  • Convert components to be stateless where appropriate (we can do this as a separate pass later)

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

I'd appreciate somebody making a PR against this branch to update all the docs to match the example updates I just pushed. Please keep the same code style and conventions. Where examples match the docs, it's best to use the exact code from examples.

If you intend to work on this, please write a comment in this PR so we don't duplicate the effort.

@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

@gaearon I already updated the Implementing Undo History recipe you can just revert your revert commit for that

@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

I can work on updating the rest of the docs - the only things that need to be changed are react-dom and removing the function within <Provider>, right?

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

@omnidan

That's why I wrote

Please keep the same code style and conventions

There are two issues in that doc commit:

  1. It uses ReactDOM.render over importing named render. Let's say it's my personal whim. 😉
  2. It uses findDOMNode where the call needs to be removed completely: DOM refs are nodes in 0.14.

@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

@gaearon aah okay - I'll do that then 😄

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

I can work on updating the rest of the docs - the only things that need to be changed are react-dom and removing the function within , right?

These two, and removing findDOMNode whenever it is already a DOM node—that is, pretty much everywhere it's used right now. For testing docs, it involves using react instead of react/addons, and using react-addons-test-utils.

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

Thank you!

@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

In applyMiddleware.md: React.renderToString is used, but React isn't even imported - is this a mistake in the current version of the docs?

I would just import renderToString from react-dom/server and use that instead.

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

@omnidan 👍 on what you suggested

@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

@gaearon alright, I updated the docs - only thing missing now are the tests. I'm too unsure about what to change there, maybe you should look into that 😅

Also somebody please have a quick look over it to make sure I didn't forget anything (I grepped for React.render, {() => and findDOMNode in the whole project though)

@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

React.addons.update isn't mentioned on https://facebook.github.io/react/docs/update.html which is linked in Reducers.md - not sure if that changed or is fine.

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

It should be react-addons-update now.

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

You can remove

  // The child must be wrapped in a function
  // to work around an issue in React 0.13.

from UsageWithReact. Let's not leave traces of old API.

@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

@gaearon Done! I updated the other links in earlier commits (React -> ReactDOM, ReactDOMServer). Anything else, besides tests?

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

This looks good to me, thank you for your help!

@gaearon
Copy link
Contributor Author

gaearon commented Oct 15, 2015

This is good enough for now, so I'll merge and follow up in a second PR.
Everything but real-world is updated.

gaearon added a commit that referenced this pull request Oct 15, 2015
Update examples and docs to React 0.14
@gaearon gaearon merged commit 5e32583 into master Oct 15, 2015
@gaearon gaearon deleted the 14 branch October 15, 2015 17:17
@omnidan
Copy link
Contributor

omnidan commented Oct 15, 2015

Awesome! You're welcome 😁

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

Successfully merging this pull request may close these issues.

2 participants