Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Commit 8a808c6

Browse files
Merge branch 'master' of https://github.com/reactjs/reactjs.org into sync-4e6cee1f
2 parents 85e6524 + 4e6cee1 commit 8a808c6

File tree

10 files changed

+42
-68
lines changed

10 files changed

+42
-68
lines changed

content/blog/2016-07-11-introducing-reacts-error-code-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Prior to this release, we stripped out error messages at build-time and this is
99

1010
> Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.
1111
12-
In order to make debugging in production easier, we're introducing an Error Code System in [15.2.0](https://github.com/facebook/react/releases/tag/v15.2.0). We developed a [gulp script](https://github.com/facebook/react/blob/master/scripts/error-codes/gulp-extract-errors.js) that collects all of our `invariant` error messages and folds them to a [JSON file](https://github.com/facebook/react/blob/master/scripts/error-codes/codes.json), and at build-time Babel uses the JSON to [rewrite](https://github.com/facebook/react/blob/master/scripts/error-codes/replace-invariant-error-codes.js) our `invariant` calls in production to reference the corresponding error IDs. Now when things go wrong in production, the error that React throws will contain a URL with an error ID and relevant information. The URL will point you to a page in our documentation where the original error message gets reassembled.
12+
In order to make debugging in production easier, we're introducing an Error Code System in [15.2.0](https://github.com/facebook/react/releases/tag/v15.2.0). We developed a [script](https://github.com/facebook/react/blob/master/scripts/error-codes/extract-errors.js) that collects all of our `invariant` error messages and folds them to a [JSON file](https://github.com/facebook/react/blob/master/scripts/error-codes/codes.json), and at build-time Babel uses the JSON to [rewrite](https://github.com/facebook/react/blob/master/scripts/error-codes/transform-error-messages.js) our `invariant` calls in production to reference the corresponding error IDs. Now when things go wrong in production, the error that React throws will contain a URL with an error ID and relevant information. The URL will point you to a page in our documentation where the original error message gets reassembled.
1313

1414
While we hope you don't see errors often, you can see how it works [here](/docs/error-decoder.html?invariant=109&args[]=Foo). This is what the same error from above will look like:
1515

content/blog/2020-09-22-introducing-the-new-jsx-transform.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Upgrading to the new transform is completely optional, but it has a few benefits
2020
**This upgrade will not change the JSX syntax and is not required.** The old JSX transform will keep working as usual, and there are no plans to remove the support for it.
2121

2222

23-
[React 17 RC](/blog/2020/08/10/react-v17-rc.html) already includes support for the new transform, so go give it a try! To make it easier to adopt, after React 17 is released, we also plan to backport its support to React 16.x, React 15.x, and React 0.14.x. You can find the upgrade instructions for different tools [below](#how-to-upgrade-to-the-new-jsx-transform).
23+
[React 17 RC](/blog/2020/08/10/react-v17-rc.html) already includes support for the new transform, so go give it a try! To make it easier to adopt, **we've also backported its support** to React 16.14.0, React 15.7.0, and React 0.14.10. You can find the upgrade instructions for different tools [below](#how-to-upgrade-to-the-new-jsx-transform).
2424

2525
Now let's take a closer look at the differences between the old and the new transform.
2626

@@ -92,7 +92,7 @@ If you aren't ready to upgrade to the new JSX transform or if you are using JSX
9292

9393
If you want to upgrade, you will need two things:
9494

95-
* **A version of React that supports the new transform** (currently, only [React 17 RC](/blog/2020/08/10/react-v17-rc.html) supports it, but after React 17.0 has been released, we plan to make additional compatible releases for 0.14.x, 15.x, and 16.x).
95+
* **A version of React that supports the new transform** ([React 17 RC](/blog/2020/08/10/react-v17-rc.html) and higher supports it, but we've also released React 16.14.0, React 15.7.0, and React 0.14.10 for people who are still on the older major versions).
9696
* **A compatible compiler** (see instructions for different tools below).
9797

9898
Since the new JSX transform doesn't require React to be in scope, [we've also prepared an automated script](#removing-unused-react-imports) that will remove the unnecessary imports from your codebase.
@@ -111,7 +111,7 @@ Gatsby [v2.24.5](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/
111111

112112
>Note
113113
>
114-
>If you get [this Gatsby error](https://github.com/gatsbyjs/gatsby/issues/26979) after upgrading to React `17.0.0-rc.2`, run `npm update` to fix it.
114+
>If you get [this Gatsby error](https://github.com/gatsbyjs/gatsby/issues/26979) after upgrading to React 17 RC, run `npm update` to fix it.
115115
116116
### Manual Babel Setup {#manual-babel-setup}
117117

@@ -172,6 +172,8 @@ Starting from Babel 8, `"automatic"` will be the default runtime for both plugin
172172
> Note
173173
>
174174
> If you use JSX with a library other than React, you can use [the `importSource` option](https://babeljs.io/docs/en/babel-preset-react#importsource) to import from that library instead -- as long as it provides the necessary entry points. Alternatively, you can keep using the classic transform which will continue to be supported.
175+
>
176+
> If you're a library author and you are implementing the `/jsx-runtime` entry point for your library, keep in mind that [there is a case](https://github.com/facebook/react/issues/20031#issuecomment-710346866) in which even the new transform has to fall back to `createElement` for backwards compatibility. In that case, it will auto-import `createElement` directly from the *root* entry point specified by `importSource`.
175177
176178
### ESLint {#eslint}
177179

content/community/courses.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ permalink: community/courses.html
5151
- [React Tutorial](https://react-tutorial.app) - Learn React step by step in an interactive environment with flashcards.
5252

5353
- [Road to React](https://www.roadtoreact.com/) - Your journey to master React in JavaScript.
54+
55+
- [Epic React](https://epicreact.dev/) - Confidently Ship Well-Architected Production Ready React Apps Like a Pro

content/docs/code-splitting.md

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ permalink: docs/code-splitting.html
66

77
## Bundling {#bundling}
88

9-
Most React apps will have their files "bundled" using tools like
10-
[Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/) or
11-
[Browserify](http://browserify.org/).
12-
Bundling is the process of following imported files and merging them into a
13-
single file: a "bundle". This bundle can then be included on a webpage to load
14-
an entire app at once.
9+
Most React apps will have their files "bundled" using tools like [Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/) or [Browserify](http://browserify.org/). Bundling is the process of following imported files and merging them into a single file: a "bundle". This bundle can then be included on a webpage to load an entire app at once.
1510

1611
#### Example {#example}
1712

@@ -45,38 +40,22 @@ console.log(add(16, 26)); // 42
4540
>
4641
> Your bundles will end up looking a lot different than this.
4742
48-
If you're using [Create React App](https://create-react-app.dev/), [Next.js](https://nextjs.org/), [Gatsby](https://www.gatsbyjs.org/), or a similar tool, you will have a Webpack setup out of the box to bundle your
49-
app.
43+
If you're using [Create React App](https://create-react-app.dev/), [Next.js](https://nextjs.org/), [Gatsby](https://www.gatsbyjs.org/), or a similar tool, you will have a Webpack setup out of the box to bundle your app.
5044

51-
If you aren't, you'll need to setup bundling yourself. For example, see the
52-
[Installation](https://webpack.js.org/guides/installation/) and
53-
[Getting Started](https://webpack.js.org/guides/getting-started/) guides on the
54-
Webpack docs.
45+
If you aren't, you'll need to setup bundling yourself. For example, see the [Installation](https://webpack.js.org/guides/installation/) and [Getting Started](https://webpack.js.org/guides/getting-started/) guides on the Webpack docs.
5546

5647
## Code Splitting {#code-splitting}
5748

58-
Bundling is great, but as your app grows, your bundle will grow too. Especially
59-
if you are including large third-party libraries. You need to keep an eye on
60-
the code you are including in your bundle so that you don't accidentally make
61-
it so large that your app takes a long time to load.
49+
Bundling is great, but as your app grows, your bundle will grow too. Especially if you are including large third-party libraries. You need to keep an eye on the code you are including in your bundle so that you don't accidentally make it so large that your app takes a long time to load.
6250

63-
To avoid winding up with a large bundle, it's good to get ahead of the problem
64-
and start "splitting" your bundle.
65-
Code-Splitting is a feature
66-
supported by bundlers like [Webpack](https://webpack.js.org/guides/code-splitting/), [Rollup](https://rollupjs.org/guide/en/#code-splitting) and Browserify (via
67-
[factor-bundle](https://github.com/browserify/factor-bundle)) which can create
68-
multiple bundles that can be dynamically loaded at runtime.
51+
To avoid winding up with a large bundle, it's good to get ahead of the problem and start "splitting" your bundle. Code-Splitting is a feature
52+
supported by bundlers like [Webpack](https://webpack.js.org/guides/code-splitting/), [Rollup](https://rollupjs.org/guide/en/#code-splitting) and Browserify (via [factor-bundle](https://github.com/browserify/factor-bundle)) which can create multiple bundles that can be dynamically loaded at runtime.
6953

70-
Code-splitting your app can help you "lazy-load" just the things that are
71-
currently needed by the user, which can dramatically improve the performance of
72-
your app. While you haven't reduced the overall amount of code in your app,
73-
you've avoided loading code that the user may never need, and reduced the amount
74-
of code needed during the initial load.
54+
Code-splitting your app can help you "lazy-load" just the things that are currently needed by the user, which can dramatically improve the performance of your app. While you haven't reduced the overall amount of code in your app, you've avoided loading code that the user may never need, and reduced the amount of code needed during the initial load.
7555

7656
## `import()` {#import}
7757

78-
The best way to introduce code-splitting into your app is through the dynamic
79-
`import()` syntax.
58+
The best way to introduce code-splitting into your app is through the dynamic `import()` syntax.
8059

8160
**Before:**
8261

@@ -94,16 +73,11 @@ import("./math").then(math => {
9473
});
9574
```
9675

97-
When Webpack comes across this syntax, it automatically starts code-splitting
98-
your app. If you're using Create React App, this is already configured for you
99-
and you can [start using it](https://create-react-app.dev/docs/code-splitting/) immediately. It's also supported
100-
out of the box in [Next.js](https://nextjs.org/docs/advanced-features/dynamic-import).
76+
When Webpack comes across this syntax, it automatically starts code-splitting your app. If you're using Create React App, this is already configured for you and you can [start using it](https://create-react-app.dev/docs/code-splitting/) immediately. It's also supported out of the box in [Next.js](https://nextjs.org/docs/advanced-features/dynamic-import).
10177

102-
If you're setting up Webpack yourself, you'll probably want to read Webpack's
103-
[guide on code splitting](https://webpack.js.org/guides/code-splitting/). Your Webpack config should look vaguely [like this](https://gist.github.com/gaearon/ca6e803f5c604d37468b0091d9959269).
78+
If you're setting up Webpack yourself, you'll probably want to read Webpack's [guide on code splitting](https://webpack.js.org/guides/code-splitting/). Your Webpack config should look vaguely [like this](https://gist.github.com/gaearon/ca6e803f5c604d37468b0091d9959269).
10479

105-
When using [Babel](https://babeljs.io/), you'll need to make sure that Babel can
106-
parse the dynamic import syntax but is not transforming it. For that you will need [@babel/plugin-syntax-dynamic-import](https://classic.yarnpkg.com/en/package/@babel/plugin-syntax-dynamic-import).
80+
When using [Babel](https://babeljs.io/), you'll need to make sure that Babel can parse the dynamic import syntax but is not transforming it. For that you will need [@babel/plugin-syntax-dynamic-import](https://classic.yarnpkg.com/en/package/@babel/plugin-syntax-dynamic-import).
10781

10882
## `React.lazy` {#reactlazy}
10983

@@ -196,17 +170,11 @@ const MyComponent = () => (
196170

197171
## Route-based code splitting {#route-based-code-splitting}
198172

199-
Deciding where in your app to introduce code splitting can be a bit tricky. You
200-
want to make sure you choose places that will split bundles evenly, but won't
201-
disrupt the user experience.
173+
Deciding where in your app to introduce code splitting can be a bit tricky. You want to make sure you choose places that will split bundles evenly, but won't disrupt the user experience.
202174

203-
A good place to start is with routes. Most people on the web are used to
204-
page transitions taking some amount of time to load. You also tend to be
205-
re-rendering the entire page at once so your users are unlikely to be
206-
interacting with other elements on the page at the same time.
175+
A good place to start is with routes. Most people on the web are used to page transitions taking some amount of time to load. You also tend to be re-rendering the entire page at once so your users are unlikely to be interacting with other elements on the page at the same time.
207176

208-
Here's an example of how to setup route-based code splitting into your app using
209-
libraries like [React Router](https://reacttraining.com/react-router/) with `React.lazy`.
177+
Here's an example of how to setup route-based code splitting into your app using libraries like [React Router](https://reacttraining.com/react-router/) with `React.lazy`.
210178

211179
```js
212180
import React, { Suspense, lazy } from 'react';

content/docs/faq-ajax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function MyComponent() {
100100
.then(
101101
(result) => {
102102
setIsLoaded(true);
103-
setItems(result.items);
103+
setItems(result);
104104
},
105105
// Note: it's important to handle errors here
106106
// instead of a catch() block so that we don't swallow

content/docs/introducing-jsx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,4 @@ We will explore rendering React elements to the DOM in the [next section](/docs/
181181

182182
>**Tip:**
183183
>
184-
>We recommend using the ["Babel" language definition](https://babeljs.io/docs/editors) for your editor of choice so that both ES6 and JSX code is properly highlighted.
184+
>We recommend using the ["Babel" language definition](https://babeljs.io/docs/en/next/editors) for your editor of choice so that both ES6 and JSX code is properly highlighted.

content/versions.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- title: '16.14.0'
2+
changelog: https://github.com/facebook/react/blob/master/CHANGELOG.md#16140-october-14-2020
13
- title: '16.13.1'
24
changelog: https://github.com/facebook/react/blob/master/CHANGELOG.md#16131-march-19-2020
35
- title: '16.13.0'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"normalize.css": "^8.0.0",
4848
"prettier": "^1.7.4",
4949
"prismjs": "^1.15.0",
50-
"react": "^17.0.0-rc.2",
51-
"react-dom": "^17.0.0-rc.2",
50+
"react": "^17.0.0-rc.3",
51+
"react-dom": "^17.0.0-rc.3",
5252
"react-helmet": "^5.2.0",
5353
"react-live": "1.8.0-0",
5454
"remarkable": "^1.7.1",

src/site-constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// NOTE: We can't just use `location.toString()` because when we are rendering
99
// the SSR part in node.js we won't have a proper location.
1010
const urlRoot = 'https://reactjs.org';
11-
const version = '16.13.1';
11+
const version = '16.14.0';
1212
const babelURL = 'https://unpkg.com/[email protected]/babel.min.js';
1313

1414
export {babelURL, urlRoot, version};

yarn.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12318,14 +12318,14 @@ react-dev-utils@^4.2.3:
1231812318
strip-ansi "3.0.1"
1231912319
text-table "0.2.0"
1232012320

12321-
react-dom@^17.0.0-rc.2:
12322-
version "17.0.0-rc.2"
12323-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.0-rc.2.tgz#7c13267e1e97d53d9a6395ef1acf1a44157dc38a"
12324-
integrity sha512-Nx6SK3s8dhQbKeOoRYPpQcYTrhojXw6nrX7Lb/rpMKyAp1wfhyzC3ukZtWczwILR9h4MzxtTLt/IIs8Bk4XqcQ==
12321+
react-dom@^17.0.0-rc.3:
12322+
version "17.0.0-rc.3"
12323+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.0-rc.3.tgz#6254f82c62ed569a2a90dcf1c7b71d4d8d951744"
12324+
integrity sha512-rrmZ91kdXBaCVomiNUQ1WvEClb5GcmxewGurd3FnsXKJBOhFdlkGbT5MY5ZQkMXH5xnIvs5ZEEB2iBr2ZqKiqg==
1232512325
dependencies:
1232612326
loose-envify "^1.1.0"
1232712327
object-assign "^4.1.1"
12328-
scheduler "0.20.0-rc.2"
12328+
scheduler "0.20.0-rc.3"
1232912329

1233012330
react-error-overlay@^3.0.0:
1233112331
version "3.0.0"
@@ -12471,10 +12471,10 @@ react@^16.8.0:
1247112471
object-assign "^4.1.1"
1247212472
prop-types "^15.6.2"
1247312473

12474-
react@^17.0.0-rc.2:
12475-
version "17.0.0-rc.2"
12476-
resolved "https://registry.yarnpkg.com/react/-/react-17.0.0-rc.2.tgz#3d454a888c119f5bde8ac016840aab8ecda22413"
12477-
integrity sha512-Z/qj0VWOF0e7VlUY2IhQr05vQ/gFSGlqmPMgxD4JytqmQxh5T7We0t5n1M98UmgJyRFTSbdCs58ZEyv6WwacWA==
12474+
react@^17.0.0-rc.3:
12475+
version "17.0.0-rc.3"
12476+
resolved "https://registry.yarnpkg.com/react/-/react-17.0.0-rc.3.tgz#ccb426b0146a8c10ee92c2a72d9d813a16a55806"
12477+
integrity sha512-b1vEcXBmlN2Bu+k57jq2ytEo5p28g5fdRfc02JRdnvGZKKphvlUnAfsrUHiOmUtL/6wvFIusi2zxp8t60fihfw==
1247812478
dependencies:
1247912479
loose-envify "^1.1.0"
1248012480
object-assign "^4.1.1"
@@ -13279,10 +13279,10 @@ sax@>=0.6.0, sax@~1.2.4:
1327913279
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
1328013280
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
1328113281

13282-
13283-
version "0.20.0-rc.2"
13284-
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.0-rc.2.tgz#5c48ac29e1a352a43c74cb5fc54c5ca94d8396fc"
13285-
integrity sha512-tgvUKHPbQr0fq5EfRd3S8hgohi/fI3h/gv1jxVb9IungCF/t2jUG946dlwgCxy8bnYvSIwRjcuw7eksDDpplLg==
13282+
13283+
version "0.20.0-rc.3"
13284+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.0-rc.3.tgz#ce616ebdd4073f5026718960d7e2d0928788c626"
13285+
integrity sha512-rPwhSgPKhRqximLHdl+oJ/8HVcMS2vyZlH74OQHqKbH04ONgKNkJ13DZLPdFSYFos8FUj6+PduO9+OoRaG6QWQ==
1328613286
dependencies:
1328713287
loose-envify "^1.1.0"
1328813288
object-assign "^4.1.1"

0 commit comments

Comments
 (0)