React: React 15.6 Umbrella

Created on 11 Apr 2017  ·  16Comments  ·  Source: facebook/react

Update: We just shipped 15.6.0 of react & react-dom! :)

Still ongoing;

  • [x] Fixes for React.addons and the 15.6.0 release of those modules.
  • [x] Follow-up work

React.addons fixes:

  • [x] Create a build step for UMD builds of addons

    • [x] Update deprecation in prop-types library and check other add-ons for deprecation warnings. Release new versions. (https://github.com/facebook/prop-types/pull/63)

  • [ ] Why doesn’t TransitionGroup have a deprecation warning? Let’s add if we forgot it. Make sure the wording says “moved” since moving is all that happened.

    • note: we should point to a specific version of the separate module, to make this future-proof against API changes to the transition group modules. Fixed in https://github.com/facebook/react/pull/9937

  • [x] Update add-on versions in 15.6 and master branches.
  • [x] Fix https://github.com/facebook/react/issues/9689 and https://github.com/facebook/react/issues/9765 (fixed by https://github.com/facebook/react/pull/9946 ?)
  • [x] Merge https://github.com/facebook/react/pull/9638
  • [x] https://github.com/facebook/react/pull/9766
  • [x] Release new versions of add-ons
  • [x] Cherry-pick all these changes into 15.6

Other related items:

  • [ ] Document the process for deprecating an API in React Moved to https://github.com/facebook/react/issues/10057
  • [x] Can we remove junk code from PropTypes prod build? It doesn't use bundle-collapser so it ships all those method names (e.g. “fbjs/lib/invariant”). This is fixable if you add “-p bundle-collapser/plugin” to browserify call. Additionally, there seems to be some junk invariant() code which is easy to fix if we just turn this into an inlined error. https://unpkg.com/[email protected]/prop-types.min.js
  • [x] Make sure deprecations are on master too

Follow-up issues:

  • Find a solution for https://github.com/facebook/react/pull/8575 (we did merge this after all)

    • Which unblocks adding the tests from https://github.com/facebook/react/commit/e29871e6bed28676815aaf9259d33a99520a10d8 which depend on 'inputValueTracking'

  • Further improvements to React warnings in general, specifically to adress https://github.com/facebook/react/issues/9466

Steps we went through for React 15.6.0;

Preparing the RC:


Done! RC was released.

  • [x] Write a proper changelog for 15.5.x releases and 15.6 (https://github.com/facebook/react/issues/9443)
  • [X] Cherry-pick React.createMixin deprecation (Cherry-pick https://github.com/facebook/react/pull/8853)
  • [X] Maybe cherry-pick https://github.com/facebook/react/pull/9185? Needs confirmation this is the right way.
  • [x] Cherry-pick https://github.com/facebook/react/pull/9302 if it's merged by then.
  • [x] Cherry-pick this fix: https://github.com/facebook/react/pull/9451
  • [x] Cherry-pick https://github.com/facebook/react/pull/9584
  • [ ] Deduplicate "unknown DOM property" warning so that people don't stay on React 15.1 (see discussion in https://github.com/facebook/react/issues/9466) — We have not reached a consensus here and will instead revisit the whole warning system in the future
  • [x] Make sure we are using PropTypes.checkPropTypes rather than inlining it (like we did in 15.5)
  • [x] Deprecate React.DOM Factories (Merge and cherry-pick https://github.com/facebook/react/pull/8356)

    • [X] Include a codemod from React.DOM.stuff to React.createElement('stuff'

  • [x] Merge/cherry-pick #8575 :)
  • [x] Downgrade console.error to console.warn for deprecation notices

    • [x] Create deprecation 'warning' helper. (https://github.com/facebook/react/pull/9650) and (https://github.com/facebook/react/pull/9754)

    • [x] Update all deprecation warnings on master branch. (https://github.com/facebook/react/pull/9650)

    • [ ] Sync master branch(@flarnie: moved to 'prepping final release' section)

    • [ ] Update deprecation in prop-types library and check other add-ons for deprecation warnings. Release new versions. (@flarnie - moved to addons section)

    • [X] Update deprecation warnings on 15.6 branch (https://github.com/facebook/react/pull/9753)

    • [ ] Update add-on versions in 15.6 and master branches. (@flarnie - moved to addons section)

  • [x] Add specific version numbers to deprecation messages (“In React 16.0, ...”) (https://github.com/facebook/react/pull/9768 and https://github.com/facebook/react/pull/9771)
  • [x] Add a link to warning messages. Make it clear that those are not broken code but something that will be removed in React 16. Link to a dedicated page (a gist? a blog post? gists are nice because they have comments) but make sure that page touches on common confusion points:

    • [x] What should lib maintainers do? Dependency or peer? (https://github.com/facebook/react/pull/9768, https://github.com/facebook/react/pull/9781, and https://github.com/facebook/react/pull/9771)

    • [x] What does this mean for context API? (https://github.com/facebook/react/pull/9768, https://github.com/facebook/react/pull/9781, and https://github.com/facebook/react/pull/9771)

    • [x] Is the warning firing on my code? Or on a dependency? How do I know? (https://github.com/facebook/react/pull/9768, https://github.com/facebook/react/pull/9781, and https://github.com/facebook/react/pull/9771)

    • [x] What exactly will happen in React 16? (https://github.com/facebook/react/pull/9768, https://github.com/facebook/react/pull/9781, and https://github.com/facebook/react/pull/9771)

    • [x] How to automatically migrate my code? (https://github.com/facebook/react/pull/9768, https://github.com/facebook/react/pull/9781 and https://github.com/facebook/react/pull/9771)

    • [x] Are we encouraging people to stop using createClass? What about PropTypes? Are we deprecating them as in “they're bad” (nope) or are we just moving them (yes)? Make it clearer. (https://github.com/facebook/react/pull/9768, https://github.com/facebook/react/pull/9781, and https://github.com/facebook/react/pull/9771)

    • [x] Use fb.me for links (just like we always did in deprecations). This lets us update links in the future. (https://github.com/facebook/react/pull/9768, https://github.com/facebook/react/pull/9781, and https://github.com/facebook/react/pull/9771)

  • [x] Cherry-pick https://github.com/facebook/react/commit/646e7863348a427e1ed9163a9a96fa759112f102 to 15.6-dev (https://github.com/facebook/react/pull/9771)
  • [X] Verify that any changes landed in 15-stable were also cherry-picked to 15.6-dev. (https://github.com/facebook/react/pull/9889)

    • [ ] Cherry-pick the fix for https://github.com/facebook/react/issues/9569 (@gaearon: I don't think we need to)

    • [ ] Make sure deprecations are on master too (@flarnie: moved to 'prepping final release' section.)

    • [x] Change react-dom-factories package to be named that consistently, and avoid react-addons-dom-factories. (https://github.com/facebook/react/pull/9780)

  • [x] Cherry pick https://github.com/facebook/react/pull/9806 (double check with @nhunzaker)

    • [x] Release react-dom-factories on npm.


Testing the RC:


Done! React 15.6.0 is out.

  • [X] Inspect the UMD builds
  • [x] Share RC and proposed release date with library authors several weeks in advance
  • [x] Publish release notes early

Preparing the final release:


Done! React 15.6.0 is out.

  • [x] Update https://github.com/facebook/react/blob/master/scripts/print-warnings/print-warnings.js (https://github.com/facebook/react/pull/9756)

    • [x] Share RC with library authors and get folks to try it.

    • [x] Post a target date for the release.

    • [x] Triage any issues reported with RC.

  • [x] https://github.com/facebook/react/issues/9830

    • [x] Sync master branch (to test the deprecation downgrade internally at FB)


Doing the release:

  • [x] Release on a Mon-Thur. day
Release

Most helpful comment

Are we encouraging people to stop using createClass? What about PropTypes? Are we deprecating them as in “they're bad” (nope) or are we just moving them (yes)? Make it clearer.

You'll want to be crystal clear about this. In other projects where they've removed stuff like this, it usually means a death sentence for those features (Responders in Rails come to mind). The important part is noting that those features aren't going away, just how you access them is changing. Maybe drop the "depreciation" wording and replace it with "moving"? And that's not because you're not deprecating those imports, but it's about the kind of message you want to send.

All 16 comments

Deprecate React.DOM Factories

For reference, there is existing work on this at https://github.com/facebook/react/pull/8356

Can we remove junk code from PropTypes prod build? It doesn't use bundle-collapser so it ships all those method names (e.g. “fbjs/lib/invariant”). This is fixable if you add “-p bundle-collapser/plugin” to browserify call. Additionally, there seems to be some junk invariant() code which is easy to fix if we just turn this into an inlined error. https://unpkg.com/[email protected]/prop-types.min.js

I created an issue for this in the new prop-types repo: https://github.com/reactjs/prop-types/issues/16

Are we encouraging people to stop using createClass? What about PropTypes? Are we deprecating them as in “they're bad” (nope) or are we just moving them (yes)? Make it clearer.

You'll want to be crystal clear about this. In other projects where they've removed stuff like this, it usually means a death sentence for those features (Responders in Rails come to mind). The important part is noting that those features aren't going away, just how you access them is changing. Maybe drop the "depreciation" wording and replace it with "moving"? And that's not because you're not deprecating those imports, but it's about the kind of message you want to send.

👍 on not calling it "deprecation". The common intuition for "deprecated" is "stuff that we're no longer maintaining and only keeping around to avoid API incompatibilities, and you shouldn't use it anymore" (see https://en.wikipedia.org/wiki/Deprecation#Software_deprecation). "Moving" sounds a bit better.

Awesome suggestions by @flarnie, happy to see that more of the bullet points touch communication topics which are way more difficult to embrace than technical stuff sometimes when managing a library that a lot of people uses.

Though I like warnings, I don't know if I prefer the red and error look of a deprecation to catch better the developer's attention.

Awesome suggestions by @flarnie, happy to see that more of the bullet points touch communication topics which are way more difficult to embrace than technical stuff sometimes when managing a library that a lot of people uses.

I completely agree. I think it's especially difficult since most of the React team's core decisions are made via internal discussions at FB, and there hasn't been a sustained effort to communicate these to the OSS community.

I would love to see some work towards making this less opaque (maybe start publishing meeting notes again?), both for consumers, library maintainers, and contributors to the project.

Though I like warnings, I don't know if I prefer the red and error look of a deprecation to catch better the developer's attention.

This is a complete hack and totally should not be what actually is done here, but you can sorta do that with console message styles:

screen shot 2017-04-11 at 12 05 26 pm

Silly, but it could be an idea to pursue to make them visually distinct.

Unfortunately won't work in other browsers or Node afaik.

"Where does proptypes doc live? It's confusing it's still on React object but inaccessible from the website through search or table of contents. Let's either reinstantiate it or move it fully to the standalone repo. Also it's confusing we're deprecating createClass but it still lives in the docs ("React without ES6") whereas we're just "moving" PropTypes but they're gone from the docs."

Regarding downgrading 'deprecation' warnings in add-on packages:

I think we could consider "Update deprecation in prop-types library and check other add-ons for deprecation warnings. Release new versions." done, wondering what you think @gaearon

Why doesn’t TransitionGroup have a deprecation warning? Let’s add if we forgot it. Make sure the wording says “moved” since moving is all that happened.

It looks like we never added "moved" warnings for any of the React.addons.<something> utilities. Since all of these were either moved or deprecated, I'm adding messages for them in this release. Hopefully that is what you meant @gaearon

In the prop-types package the warning is for a syntax that will throw so I prefer we not downgrade it.

Any removed APIs would throw too so I don’t think this makes it different. Additionally most occurrences of this warning are false positives caused by mismatching version of React. I don’t think I’ve ever seen code relying on that pattern in practice. So I’d prefer we make it quieter.

It looks like we never added "moved" warnings for any of the React.addons. utilities. Since all of these were either moved or deprecated, I'm adding messages for them in this release.

Hmm, I'm sorry I was unclear. This is not what I meant.
When I was talking about deprecating TransitionGroup I meant two entry points specifically:

  • react-addons-transition-group
  • react-addons-css-transition-group

These two entry points (specifically the npm ones) should print a deprecation message because they will break in 16. Unlike other react-addons- packages, they are importing from react/lib/ which will be gone. But, for example, react-addons-update will keep on working in 16.

Now, as for React.addons.*, it’s a separate discussion. I think it would make sense to deprecate React.addons.* for those addons that require changes in code, but for example React.addons.update would still work with the UMD build we made specifically for update(). I’d probably postpone deprecating React.addons.* getters until 15.7 because I’m not sure how to approach it well.

react-transition-group doesn't have deprecation warnings (should it?)

It shouldn’t—it’s the replacement we’re promoting for these two packages. Instead of react-addons-transition-group and react-addons-css-transition-group that reach into React internals, people should use react-transition-group which doesn’t.

We should also ideally get some version of https://github.com/facebook/react/pull/9761 in. As it stands, create-react-class is completely botched in AMD environments.

  • "Any removed APIs would throw too so I don’t think this makes it different." That's true. I had thought for some reason that it would throw in 15.5.* but that doesn't make sense. So we:

    • downgrade the warning in prop-types
    • add deprecation warnings in react-addons-transition-group and react-addons-css-transition-group
  • "I’d probably postpone deprecating React.addons.* getters until 15.7 because I’m not sure how to approach it well." -> Sounds good, we can revisit https://github.com/facebook/react/pull/9758#pullrequestreview-39986493 later then.

https://github.com/facebook/react/pull/9806 should be safe to cherry-pick. @flarnie would you like me to do that?

Did that yesterday before I saw your comment @nhunzaker - thanks!

Closing this now - if any work remains around changes from v15.6.* we should open new issues for that.
🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸
Thanks @gaearon @nhunzaker @bvaughn @aweary @acdlite and everyone who helped out with this process.
🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸
Onward towards 16.0!~~~~ 😁

Was this page helpful?
0 / 5 - 0 ratings