Skip to content

Sync with reactjs.org @ bd0c9d8c #398

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

Merged
merged 14 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions content/blog/2020-08-10-react-v17-rc.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Most effects don't need to delay screen updates, so React runs them asynchronous

However, when a component is unmounting, effect *cleanup* functions used to run synchronously (similar to `componentWillUnmount` being synchronous in classes). We've found that this is not ideal for larger apps because it slows down large screen transitions (e.g. switching tabs).

**In React 17, the effect cleanup function will always runs asynchronously -- for example, if the component is unmounting, the cleanup will run _after_ the screen has been updated.**
**In React 17, the effect cleanup function always runs asynchronously -- for example, if the component is unmounting, the cleanup runs _after_ the screen has been updated.**

This mirrors how the effects themselves run more closely. In the rare cases where you might want to rely on the synchronous execution, you can switch to `useLayoutEffect` instead.

Expand Down Expand Up @@ -272,20 +272,20 @@ We encourage you to try React 17.0 Release Candidate soon and [raise any issues]
To install React 17 RC with npm, run:

```bash
npm install [email protected].2 [email protected].2
npm install [email protected].3 [email protected].3
```

To install React 17 RC with Yarn, run:

```bash
yarn add [email protected].2 [email protected].2
yarn add [email protected].3 [email protected].3
```

We also provide UMD builds of React via a CDN:

```html
<script crossorigin src="https://unpkg.com/[email protected].2/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/[email protected].2/umd/react-dom.production.min.js"></script>
<script crossorigin src="https://unpkg.com/[email protected].3/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/[email protected].3/umd/react-dom.production.min.js"></script>
```

Refer to the documentation for [detailed installation instructions](/docs/installation.html).
Expand Down Expand Up @@ -356,6 +356,7 @@ Refer to the documentation for [detailed installation instructions](/docs/instal
* Remove `unstable_discreteUpdates` and `unstable_flushDiscreteUpdates`. ([@trueadm](https://github.com/trueadm) in [#18825](https://github.com/facebook/react/pull/18825))
* Remove the `timeoutMs` argument. ([@acdlite](https://github.com/acdlite) in [#19703](https://github.com/facebook/react/pull/19703))
* Disable `<div hidden />` prerendering in favor of a different future API. ([@acdlite](https://github.com/acdlite) in [#18917](https://github.com/facebook/react/pull/18917))
* Add `unstable_expectedLoadTime` to Suspense for CPU-bound trees. ([@acdlite](https://github.com/acdlite) in [#19936](https://github.com/facebook/react/pull/19936))
* Add an experimental `unstable_useOpaqueIdentifier` Hook. ([@lunaruan](https://github.com/lunaruan) in [#17322](https://github.com/facebook/react/pull/17322))
* Add an experimental `unstable_startTransition` API. ([@rickhanlonii](https://github.com/rickhanlonii) in [#19696](https://github.com/facebook/react/pull/19696))
* Using `act` in the test renderer no longer flushes Suspense fallbacks. ([@acdlite](https://github.com/acdlite) in [#18596](https://github.com/facebook/react/pull/18596))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function App() {

However, this is not perfect:

* Because JSX compiled into `React.createElement`, `React` needed to be in scope if you use JSX.
* Because JSX was compiled into `React.createElement`, `React` needed to be in scope if you used JSX.
* There are some [performance improvements and simplifications](https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md#motivation) that `React.createElement` does not allow.

To solve these issues, React 17 introduces two new entry points to the React package that are intended to only be used by compilers like Babel and TypeScript. Instead of transforming JSX to `React.createElement`, **the new JSX transform** automatically imports special functions from those new entry points in the React package and calls them.
Expand Down
2 changes: 1 addition & 1 deletion content/docs/design-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Tenemos un chiste interno en el equipo de React acerca de que debería haberse l

Proveer una buena experiencia de desarrollador es importante para nosotros.

Por ejemplo, mantenemos las herramientas de desarrollo de React ([React DevTools](https://github.com/facebook/react-devtools)) las cuales te permiten inspeccionar el árbol de componentes de React en Chrome y Firefox. Hemos oído que proveen un gran incremento de productividad a los ingenieros de Facebook y a la comunidad.
Por ejemplo, mantenemos las herramientas de desarrollo de React ([React DevTools](https://github.com/facebook/react/tree/master/packages/react-devtools)) las cuales te permiten inspeccionar el árbol de componentes de React en Chrome y Firefox. Hemos oído que proveen un gran incremento de productividad a los ingenieros de Facebook y a la comunidad.

También tratamos de dar un extra para proveer advertencias útiles a los desarrolladores. Por ejemplo, React te advierte en desarrollo si anidas etiquetas de una forma que el navegador no las entiende, o si cometes un error de transcripción en la API. Las advertencias a desarrolladores y los chequeos relacionados son la razón principal por la que la versión de desarrollo de React es más lenta que la versión de producción.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"url": "git+https://github.com/reactjs/es.reactjs.org.git"
},
"scripts": {
"build": "gatsby build",
"build": "gatsby clean && gatsby build",
"check-all": "npm-run-all prettier generate-ids --parallel lint flow",
"ci-check": "npm-run-all prettier:diff --parallel lint flow",
"dev": "gatsby develop -H 0.0.0.0",
Expand Down
43 changes: 43 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"github": { "silent": true },
"trailingSlash": false,
"redirects": [
{ "source": "/tips/controlled-input-null-value.html", "destination": "/docs/forms.html#controlled-input-null-value", "permanent": false },
{ "source": "/concurrent", "destination": "/docs/concurrent-mode-intro.html", "permanent": false },
{ "source": "/hooks", "destination": "/docs/hooks-intro.html", "permanent": false },
{ "source": "/tutorial", "destination": "/tutorial/tutorial.html", "permanent": false },
{ "source": "/your-story", "destination": "https://www.surveymonkey.co.uk/r/MVQV2R9", "permanent": false },
{ "source": "/stories", "destination": "https://medium.com/react-community-stories", "permanent": false },
{ "source": "/html-jsx.html", "destination": "https://magic.reactjs.net/htmltojsx.htm", "destination": "", "permanent": false },
{ "source": "/link/attribute-behavior", "destination": "/blog/2017/09/08/dom-attributes-in-react-16.html#changes-in-detail", "permanent": false },
{ "source": "/link/controlled-components", "destination": "/docs/forms.html#controlled-components", "permanent": false },
{ "source": "/link/crossorigin-error", "destination": "/docs/cross-origin-errors.html", "permanent": false },
{ "source": "/link/dangerously-set-inner-html", "destination": "/docs/dom-elements.html#dangerouslysetinnerhtml", "permanent": false },
{ "source": "/link/derived-state", "destination": "/blog/2018/06/07/you-probably-dont-need-derived-state.html", "permanent": false },
{ "source": "/link/error-boundaries", "destination": "/docs/error-boundaries.html", "permanent": false },
{ "source": "/link/event-pooling", "destination": "/docs/events.html#event-pooling", "permanent": false },
{ "source": "/link/hooks-data-fetching", "destination": "/docs/hooks-faq.html#how-can-i-do-data-fetching-with-hooks", "permanent": false },
{ "source": "/link/invalid-aria-props", "destination": "/warnings/invalid-aria-prop.html", "permanent": false },
{ "source": "/link/invalid-hook-call", "destination": "/warnings/invalid-hook-call-warning.html", "permanent": false },
{ "source": "/link/legacy-context", "destination": "/docs/legacy-context.html", "permanent": false },
{ "source": "/link/legacy-factories", "destination": "/warnings/legacy-factories.html", "permanent": false },
{ "source": "/link/mock-scheduler", "destination": "/docs/testing-environments.html#mocking-a-rendering-surface", "destination": "", "permanent": false },
{ "source": "/link/perf-use-production-build", "destination": "/docs/optimizing-performance.html#use-the-production-build", "permanent": false },
{ "source": "/link/react-devtools", "destination": "/blog/2015/09/02/new-react-developer-tools.html#installation", "permanent": false },
{ "source": "/link/react-polyfills", "destination": "/docs/javascript-environment-requirements.html", "permanent": false },
{ "source": "/link/refs-must-have-owner", "destination": "/warnings/refs-must-have-owner.html", "permanent": false },
{ "source": "/link/rules-of-hooks", "destination": "/docs/hooks-rules.html", "permanent": false },
{ "source": "/link/special-props", "destination": "/warnings/special-props.html", "permanent": false },
{ "source": "/link/strict-mode-find-node", "destination": "/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage", "permanent": false },
{ "source": "/link/strict-mode-string-ref", "destination": "/docs/refs-and-the-dom.html#legacy-api-string-refs", "permanent": false },
{ "source": "/link/unsafe-component-lifecycles", "destination": "/blog/2018/03/27/update-on-async-rendering.html", "permanent": false },
{ "source": "/link/warning-keys", "destination": "/docs/lists-and-keys.html#keys", "permanent": false },
{ "source": "/link/wrap-tests-with-act", "destination": "/docs/test-utils.html#act", "permanent": false },
{ "source": "/link/interaction-tracing", "destination": "https://gist.github.com/bvaughn/8de925562903afd2e7a12554adcdda16", "permanent": false },
{ "source": "/link/profiling", "destination": "https://gist.github.com/bvaughn/25e6233aeb1b4f0cdb8d8366e54a3977", "permanent": false },
{ "source": "/link/test-utils-mock-component", "destination": "https://gist.github.com/bvaughn/fbf41b3f895bf2d297935faa5525eee9", "permanent": false },
{ "source": "/link/uselayouteffect-ssr", "destination": "https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85", "permanent": false },
{ "source": "/link/react-devtools-faq", "destination": "https://github.com/facebook/react/tree/master/packages/react-devtools#faq", "permanent": false },
{ "source": "/link/setstate-in-render", "destination": "https://github.com/facebook/react/issues/18178#issuecomment-595846312", "permanent": false }
]
}