From 2b317d19b174aa25717b938ee61f18263a84517b Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 27 Sep 2017 07:06:34 -0700 Subject: [PATCH] Merge changes from master into Gatsby branch (#10853) * Update changelog for unreleased 16.0 changes (#10730) * First shot at updating changelog for 16.0 **what is the change?:** Added an 'unreleased' section to the changelog with info from https://github.com/facebook/react/issues/10294 **why make this change?:** To get things set for the 16.0 release. **test plan:** Visual inspection **issue:** https://github.com/facebook/react/issues/8854 * Fix typos and formatting errors in changelog * Add requestAnimationFrame and remove "New helpful warnings" **what is the change?:** In response to helpful code review - - Add mention of dependency on `requestAnimationFrame` and need to polyfill that as well as `Map` and `Set` - Remove "New helpful warnings" section; it was incomplete, and there are so many new and updated warnings that it might not be reasonable to cover them in the changelog. **why make this change?:** Accuracy **test plan:** Visual inspection **issue:** issue #8854 * Improve wording * Improve wording and fix missing links * Add backticks to file names & code; wording tweak * Break "Major Changes" into "New Feature" and "Breaking Changes" * Add server side render changes to 16.0 changelog * Change gist link from mine to gaearons * Add note about returning fragments * fix misc nits * Misc. formatting/wording fixes to changelog **what is the change?:** Thanks to the kind code review comments of @gaearon and @nhunzaker we have - removed the non-deterministic bold styling on some bullet points - improved wording of the bullet points for portals, attribute whitelist changes, and server rendering changes - Add note about error boundaries including a breaking change to error handling behavior. - punctuation and capitalization fixes **why make this change?:** Clarity and correctness **test plan:** Visual inspection **issue:** https://github.com/facebook/react/issues/8854 * fix broken link * Fixes #9667: Updated createTextInstance to create the text node on correct document (#10723) * Record sizes * Add a changelog for elements having the same key (#10811) * Add a changelog for elements having the same key * Reword * Markdown fixs on "DOM Attributes in React 16" post (#10816) * Include tag name into the table snapshot (#10818) * Update DOM warning wording and link (#10819) * Update DOM warning wording and link * Consistently use "Invalid" for known misspellings * Update license headers BSD+Patents -> MIT Did find and replace in TextMate. ``` find: (?:( \*)( ))?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+(?:this source tree|the same directory)\.$ replace: $1$2Copyright (c) $3-present, Facebook, Inc.\n$1\n$1$2This source code is licensed under the MIT license found in the\n$1$2LICENSE file in the root directory of this source tree. ``` * Change license and remove references to PATENTS Only remaining references: ``` docs/_posts/2014-10-28-react-v0.12.md 51:You can read the full text of the [LICENSE](https://github.com/facebook/react/blob/master/LICENSE) and [`PATENTS`](https://github.com/facebook/react/blob/master/PATENTS) files on GitHub. docs/_posts/2015-04-17-react-native-v0.4.md 20:* **Patent Grant**: Many of you had concerns and questions around the PATENTS file. We pushed [a new version of the grant](https://code.facebook.com/posts/1639473982937255/updating-our-open-source-patent-grant/). src/__mocks__/vendor/third_party/WebComponents.js 8: * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt ``` * Version bumps to use MIT license * Add ReactTestRenderer documentations (#10692) * Add ReactTestRenderer documentations * Add TestRenderer documentations * TestRenderer is not experiment * Add a link for jsdom * Use ES Modules syntax * Twaek * Add a Link component * Use Jest assertions * Move a documentation for createNodeMock to Idea section * Renamed * Tweak * Rename * More explicit * Add a usecase for createNodeMock * Add changelog for 15.6.2 * Add 15.6.2 blog post to master * Add Nate to authors on master * Bump object-assign patch range to match main package.json * Flow should ignore node_modules/create-react-class * Update error codes * Update CHANGELOG for React 16 * v16.0.0 * Doc updates for React 16 + blog post (#10824) * Doc updates for React 16 + blog post * Add link to Sophie's post * Fix React links on the website (#10837) * Fix React links on the website * Fix code editor * Fix code editor, attempt 2 * Doc change for prevContext removal in CDU (#10836) * Doc change for prevContext removal in CDU Ref: https://github.com/facebook/react/issues/8631 * Minor rewording * Fix note formatting * React.createPortal is not a function (#10843) * Update Portals Documentation (#10840) * Update Portals Documentation Correct some grammar to be more explicit and clear. Update example CodePen to better match code found in documentation. Update code example styles to match other code examples (ie. 'State and Lifecycle', 'Handling Events'). * Clean up comment to be accurate to example There was a small comment overlooked when reviewing the documentation. This fixes it to be accurate to the example as well as grammatically correct. * Update portals.md * More fixes * Update name of property initializer proposal (#10812) The proposal for property initializers is called [Public Class Fields](https://tc39.github.io/proposal-class-public-fields/) now (part of the combined [Class Fields](https://github.com/tc39/proposal-class-fields) proposal). * Fix portal link (#10845) * Update docs for React 16 (#10846) * Minor doc edit * Rename urls --- .flowconfig | 1 + CHANGELOG.md | 8 +- docs/_config.yml | 2 +- docs/_data/nav_docs.yml | 6 +- docs/_js/live_editor.js | 4 +- docs/_layouts/default.html | 5 +- docs/_posts/2013-06-05-why-react.md | 2 +- docs/_posts/2013-06-12-community-roundup.md | 2 +- docs/_posts/2013-06-19-community-roundup-2.md | 8 +- docs/_posts/2013-07-03-community-roundup-4.md | 2 +- docs/_posts/2013-07-17-react-v0-4-0.md | 8 +- docs/_posts/2013-07-23-community-roundup-5.md | 24 +- docs/_posts/2013-08-26-community-roundup-7.md | 2 +- docs/_posts/2013-10-16-react-v0.5.0.md | 4 +- .../_posts/2013-12-23-community-roundup-12.md | 8 +- docs/_posts/2014-02-20-react-v0.9.md | 2 +- docs/_posts/2014-03-19-react-v0.10-rc1.md | 6 +- docs/_posts/2014-03-21-react-v0.10.md | 6 +- ...014-05-29-one-year-of-open-source-react.md | 4 +- docs/_posts/2014-07-17-react-v0.11.md | 2 +- docs/_posts/2014-07-25-react-v0.11.1.md | 2 +- .../2014-09-24-testing-flux-applications.md | 4 +- docs/_posts/2014-10-16-react-v0.12-rc1.md | 4 +- docs/_posts/2014-10-28-react-v0.12.md | 6 +- ...-19-react-js-conf-diversity-scholarship.md | 2 +- docs/_posts/2015-02-24-react-v0.13-rc1.md | 4 +- docs/_posts/2015-03-10-react-v0.13.md | 8 +- ...lding-the-facebook-news-feed-with-relay.md | 2 +- docs/_posts/2015-04-18-react-v0.13.2.md | 2 +- .../2015-09-02-new-react-developer-tools.md | 2 +- docs/_posts/2015-09-10-react-v0.14-rc1.md | 12 +- .../_posts/2015-09-14-community-roundup-27.md | 2 +- docs/_posts/2015-10-07-react-v0.14.md | 10 +- ...react-components-elements-and-instances.md | 16 +- docs/_posts/2016-03-07-react-v15-rc1.md | 2 +- docs/_posts/2016-04-07-react-v15.md | 4 +- docs/_posts/2016-04-08-react-v15.0.1.md | 2 +- ...11-introducing-reacts-error-code-system.md | 2 +- .../2016-07-13-mixins-considered-harmful.md | 8 +- docs/_posts/2016-11-16-react-v15.4.0.md | 6 +- docs/_posts/2017-04-07-react-v15.5.0.md | 10 +- ...017-05-18-whats-new-in-create-react-app.md | 2 +- docs/_posts/2017-06-13-react-v15.6.0.md | 4 +- .../2017-09-08-dom-attributes-in-react-16.md | 2 +- docs/_posts/2017-09-25-react-v15.6.2.md | 6 +- docs/_posts/2017-09-26-react-v16.0.md | 209 ++++++++++++++++++ docs/community/videos.it-IT.md | 2 +- docs/community/videos.ko-KR.md | 2 +- docs/community/videos.zh-CN.md | 2 +- docs/contributing/codebase-overview.md | 12 +- docs/contributing/design-principles.md | 12 +- docs/contributing/how-to-contribute.md | 2 +- docs/contributing/implementation-notes.md | 2 +- docs/docs/addons-animation.md | 2 +- docs/docs/addons-create-fragment.md | 2 +- docs/docs/addons-perf.md | 2 +- docs/docs/addons-pure-render-mixin.md | 4 +- docs/docs/addons-shallow-compare.md | 4 +- docs/docs/addons-shallow-renderer.md | 2 +- docs/docs/addons-test-utils.md | 4 +- docs/docs/addons-two-way-binding-helpers.md | 2 +- docs/docs/addons-update.md | 4 +- docs/docs/addons.md | 2 +- docs/docs/components-and-props.md | 4 +- docs/docs/composition-vs-inheritance.md | 8 +- docs/docs/conditional-rendering.md | 6 +- docs/docs/context.md | 17 +- docs/docs/forms.md | 6 +- docs/docs/handling-events.md | 8 +- docs/docs/hello-world.md | 2 +- docs/docs/higher-order-components.md | 2 +- docs/docs/installation.md | 34 +-- docs/docs/integrating-with-other-libraries.md | 18 +- docs/docs/introducing-jsx.md | 2 +- docs/docs/jsx-in-depth.md | 2 +- docs/docs/lifting-state-up.md | 10 +- docs/docs/lists-and-keys.md | 18 +- docs/docs/optimizing-performance.md | 6 +- docs/docs/portals.md | 144 ++++++++++++ docs/docs/react-without-es6.md | 6 +- docs/docs/reference-dom-elements.md | 36 ++- docs/docs/reference-events.md | 4 +- ...nce-javascript-environment-requirements.md | 32 +++ docs/docs/reference-pure-render-mixin.md | 4 +- docs/docs/reference-react-component.md | 44 +++- docs/docs/reference-react-dom-node-stream.md | 46 ---- docs/docs/reference-react-dom-server.md | 56 ++++- docs/docs/reference-react-dom.md | 32 ++- docs/docs/reference-react.md | 20 +- docs/docs/refs-and-the-dom.md | 6 +- docs/docs/rendering-elements.md | 4 +- docs/docs/state-and-lifecycle.md | 4 +- docs/docs/thinking-in-react.md | 10 +- docs/docs/typechecking-with-proptypes.md | 2 +- docs/docs/uncontrolled-components.md | 4 +- docs/downloads/single-file-example.html | 4 +- docs/tutorial/tutorial.md | 8 +- docs/warnings/dont-call-proptypes.md | 2 +- docs/warnings/legacy-factories.md | 2 +- docs/warnings/unknown-prop.md | 2 +- package.json | 2 +- packages/react-art/package.json | 4 +- packages/react-dom/package.json | 4 +- packages/react-noop-renderer/package.json | 4 +- packages/react-test-renderer/package.json | 4 +- packages/react/package.json | 4 +- scripts/error-codes/codes.json | 3 +- scripts/rollup/results.json | 164 +++++++------- src/ReactVersion.js | 2 +- 109 files changed, 875 insertions(+), 432 deletions(-) create mode 100644 docs/_posts/2017-09-26-react-v16.0.md create mode 100644 docs/docs/portals.md create mode 100644 docs/docs/reference-javascript-environment-requirements.md delete mode 100644 docs/docs/reference-react-dom-node-stream.md diff --git a/.flowconfig b/.flowconfig index 05e535b6cc1ca..8742e0abc790a 100644 --- a/.flowconfig +++ b/.flowconfig @@ -7,6 +7,7 @@ /node_modules/chrome-devtools-frontend/.* /node_modules/devtools-timeline-model/.* /www/node_modules/.* +/node_modules/create-react-class/.* /.*/__mocks__/.* /.*/__tests__/.* diff --git a/CHANGELOG.md b/CHANGELOG.md index cc79a6f18881b..173d696c613e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ Click to see more. +No unreleased changes yet. + + + +## 16.0.0 (September 26, 2017) + ### New JS Environment Requirements * React 16 depends on the collection types [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set), as well as [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame). If you support older browsers and devices which may not yet provide these natively (e.g. - ## 15.6.2 (September 25, 2017) ### All Packages diff --git a/docs/_config.yml b/docs/_config.yml index 0b6d13d4dfc2c..2bc53ec7ff458 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -60,7 +60,7 @@ sass: gems: - jekyll-redirect-from - jekyll-paginate -react_version: 15.4.0 +react_version: 16.0.0 react_hashes: dev: buVLzxzBI8Ps3svVMSUurNdb5dozNidH5Ow4H0YgZeia3t6Oeui2VLpvtAq1fwtK prod: nCjsa0kjNQPQdxWm12/ReVJzfBJaVubEwwDswyQDGMKYJmeWv3qShMuETfU5fisu diff --git a/docs/_data/nav_docs.yml b/docs/_data/nav_docs.yml index c0ba59fd24c64..656e430a5dd15 100644 --- a/docs/_data/nav_docs.yml +++ b/docs/_data/nav_docs.yml @@ -46,6 +46,8 @@ title: Reconciliation - id: context title: Context + - id: portals + title: Portals - id: web-components title: Web Components - id: higher-order-components @@ -65,8 +67,6 @@ title: ReactDOM - id: react-dom-server title: ReactDOMServer - - id: react-dom-node-stream - title: ReactDOMNodeStream - id: dom-elements title: DOM Elements - id: events @@ -77,3 +77,5 @@ title: Shallow Renderer - id: test-renderer title: Test Renderer + - id: javascript-environment-requirements + title: JS Environment Requirements diff --git a/docs/_js/live_editor.js b/docs/_js/live_editor.js index 3a95ac5fbea26..f1d57b31e2ad0 100644 --- a/docs/_js/live_editor.js +++ b/docs/_js/live_editor.js @@ -8,7 +8,7 @@ var IS_MOBILE = ( || navigator.userAgent.match(/Windows Phone/i) ); -var CodeMirrorEditor = React.createClass({ +var CodeMirrorEditor = createReactClass({ propTypes: { lineNumbers: PropTypes.bool, onChange: PropTypes.func, @@ -74,7 +74,7 @@ var selfCleaningTimeout = { }, }; -var ReactPlayground = React.createClass({ +var ReactPlayground = createReactClass({ mixins: [selfCleaningTimeout], MODES: {JSX: 'JSX', JS: 'JS'}, //keyMirror({JSX: true, JS: true}), diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index f40bec625e4dd..923eceeac6bf7 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -49,8 +49,9 @@ - - + + + diff --git a/docs/_posts/2013-06-05-why-react.md b/docs/_posts/2013-06-05-why-react.md index 6c397ac359510..b38ac97856637 100644 --- a/docs/_posts/2013-06-05-why-react.md +++ b/docs/_posts/2013-06-05-why-react.md @@ -30,7 +30,7 @@ to render views, which we see as an advantage over templates for a few reasons: **no manual string concatenation** and therefore less surface area for XSS vulnerabilities. -We've also created [JSX](/react/docs/jsx-in-depth.html), an optional syntax +We've also created [JSX](/docs/jsx-in-depth.html), an optional syntax extension, in case you prefer the readability of HTML to raw JavaScript. ## Reactive updates are dead simple. diff --git a/docs/_posts/2013-06-12-community-roundup.md b/docs/_posts/2013-06-12-community-roundup.md index 6f80e46259006..44fa10cc08bbd 100644 --- a/docs/_posts/2013-06-12-community-roundup.md +++ b/docs/_posts/2013-06-12-community-roundup.md @@ -38,7 +38,7 @@ It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outsid ## Origins of React -[Pete Hunt](http://www.petehunt.net/blog/) explained what differentiates React from other JavaScript libraries in [a previous blog post](/react/blog/2013/06/05/why-react.html). [Lee Byron](http://leebyron.com/) gives another perspective on Quora: +[Pete Hunt](http://www.petehunt.net/blog/) explained what differentiates React from other JavaScript libraries in [a previous blog post](/blog/2013/06/05/why-react.html). [Lee Byron](http://leebyron.com/) gives another perspective on Quora: > React isn't quite like any other popular JavaScript libraries, and it solves a very specific problem: complex UI rendering. It's also intended to be used along side many other popular libraries. For example, React works well with Backbone.js, amongst many others. > diff --git a/docs/_posts/2013-06-19-community-roundup-2.md b/docs/_posts/2013-06-19-community-roundup-2.md index 18407dab51061..a7bb2721084ec 100644 --- a/docs/_posts/2013-06-19-community-roundup-2.md +++ b/docs/_posts/2013-06-19-community-roundup-2.md @@ -64,7 +64,7 @@ Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.v Many of you pointed out differences between JSX and HTML. In order to clear up some confusion, we have added some documentation that covers the four main differences: - - [Whitespace removal](/react/docs/jsx-is-not-html.html) - - [HTML Entities](/react/docs/jsx-is-not-html.html) - - [Comments](/react/docs/jsx-is-not-html.html) - - [Custom HTML Attributes](/react/docs/jsx-is-not-html.html) + - [Whitespace removal](/docs/jsx-is-not-html.html) + - [HTML Entities](/docs/jsx-is-not-html.html) + - [Comments](/docs/jsx-is-not-html.html) + - [Custom HTML Attributes](/docs/jsx-is-not-html.html) diff --git a/docs/_posts/2013-07-03-community-roundup-4.md b/docs/_posts/2013-07-03-community-roundup-4.md index 1172b17a08154..30bfde2186d2b 100644 --- a/docs/_posts/2013-07-03-community-roundup-4.md +++ b/docs/_posts/2013-07-03-community-roundup-4.md @@ -23,7 +23,7 @@ The best part is the demo of how React reconciliation process makes live editing ## React Snippets -Over the past several weeks, members of our team, [Pete Hunt](http://www.petehunt.net/) and [Paul O'Shannessy](http://zpao.com/), answered many questions that were asked in the [React group](https://groups.google.com/forum/#!forum/reactjs). They give a good overview of how to integrate React with other libraries and APIs through the use of [Mixins](/react/docs/reusable-components.html) and [Lifecycle Methods](/react/docs/working-with-the-browser.html). +Over the past several weeks, members of our team, [Pete Hunt](http://www.petehunt.net/) and [Paul O'Shannessy](http://zpao.com/), answered many questions that were asked in the [React group](https://groups.google.com/forum/#!forum/reactjs). They give a good overview of how to integrate React with other libraries and APIs through the use of [Mixins](/docs/reusable-components.html) and [Lifecycle Methods](/docs/working-with-the-browser.html). > [Listening Scroll Event](https://groups.google.com/forum/#!topic/reactjs/l6PnP8qbofk) > diff --git a/docs/_posts/2013-07-17-react-v0-4-0.md b/docs/_posts/2013-07-17-react-v0-4-0.md index d5da1f6272e07..f133a765a5e50 100644 --- a/docs/_posts/2013-07-17-react-v0-4-0.md +++ b/docs/_posts/2013-07-17-react-v0-4-0.md @@ -18,10 +18,10 @@ When you're ready, [go download it](/react/downloads.html)! * Switch from using `id` attribute to `data-reactid` to track DOM nodes. This allows you to integrate with other JS and CSS libraries more easily. * Support for more DOM elements and attributes (e.g., ``) * Improved server-side rendering APIs. `React.renderComponentToString(, callback)` allows you to use React on the server and generate markup which can be sent down to the browser. -* `prop` improvements: validation and default values. [Read our blog post for details...](/react/blog/2013/07/11/react-v0-4-prop-validation-and-default-values.html) -* Support for the `key` prop, which allows for finer control over reconciliation. [Read the docs for details...](/react/docs/multiple-components.html) -* Removed `React.autoBind`. [Read our blog post for details...](/react/blog/2013/07/02/react-v0-4-autobind-by-default.html) -* Improvements to forms. We've written wrappers around ``, `