Skip to content

Commit c39182b

Browse files
authored
Merge pull request #237 from reactjs/sync-ddbd064d
Sync with reactjs.org @ ddbd064
2 parents 8c49856 + 6ff11de commit c39182b

31 files changed

+1202
-53
lines changed

content/blog/2018-03-27-update-on-async-rendering.md

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ These lifecycle methods have often been misunderstood and subtly misused; furthe
2525

2626
We maintain over 50,000 React components at Facebook, and we don't plan to rewrite them all immediately. We understand that migrations take time. We will take the gradual migration path along with everyone in the React community.
2727

28+
If you don't have the time to migrate or test these components, we recommend running a ["codemod"](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) script that renames them automatically:
29+
30+
```bash
31+
cd your_project
32+
npx react-codemod rename-unsafe-lifecycles
33+
```
34+
35+
Learn more about this codemod on the [16.9.0 release post.](https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#renaming-unsafe-lifecycle-methods)
36+
2837
---
2938

3039
## Migrating from Legacy Lifecycles {#migrating-from-legacy-lifecycles}

content/blog/2018-11-27-react-16-roadmap.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ author: [gaearon]
44
---
55

66
You might have heard about features like "Hooks", "Suspense", and "Concurrent Rendering" in the previous blog posts and talks. In this post, we'll look at how they fit together and the expected timeline for their availability in a stable release of React.
7+
8+
> An Update from August, 2019
9+
>
10+
> You can find an update to this roadmap in the [React 16.9 release blog post](/blog/2019/08/08/react-v16.9.0.html#an-update-to-the-roadmap).
11+
712

813
## tl;dr {#tldr}
914

content/blog/2019-02-06-react-v16.8.0.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Even while Hooks were in alpha, the React community created many interesting [ex
5050

5151
## Testing Hooks {#testing-hooks}
5252

53-
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://github.com/kentcdodds/react-testing-library)'s `render` and `fireEvent` utilities do this).
53+
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://testing-library.com/react)'s `render` and `fireEvent` utilities do this).
5454

5555
For example, the counter example from [this page](/docs/hooks-effect.html) can be tested like this:
5656

@@ -95,7 +95,7 @@ The calls to `act()` will also flush the effects inside of them.
9595

9696
If you need to test a custom Hook, you can do so by creating a component in your test, and using your Hook from it. Then you can test the component you wrote.
9797

98-
To reduce the boilerplate, we recommend using [`react-testing-library`](https://git.io/react-testing-library) which is designed to encourage writing tests that use your components as the end users do.
98+
To reduce the boilerplate, we recommend using [`react-testing-library`](https://testing-library.com/react) which is designed to encourage writing tests that use your components as the end users do.
9999

100100
## Thanks {#thanks}
101101

content/blog/2019-08-08-react-v16.9.0.md

+241
Large diffs are not rendered by default.

content/community/articles.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ permalink: community/articles.html
1313
- [Timeline for Learning React](https://daveceddia.com/timeline-for-learning-react/) - Dave Ceddia's recommended timeline for learning React and the React ecosystem.
1414
- [Simple React Development in 2017](https://hackernoon.com/simple-react-development-in-2017-113bd563691f) - Joshua Comeau's guide to showcase how easy it can be to start modern React development.
1515
- [Visual Guide to State in React](https://daveceddia.com/visual-guide-to-state-in-react/) - Dave Ceddia's visual guide to React state.
16+
- [The Hands-On Guide to Learning React Hooks](https://www.telerik.com/kendo-react-ui/react-hooks-guide/)

content/community/conferences.md

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1212

1313
## Upcoming Conferences {#upcoming-conferences}
1414

15+
### React Conf Iran 2019 {#react-conf-iran-2019}
16+
August 29, 2019. Tehran, Iran.
17+
18+
[Website](https://reactconf.ir/) - [Twitter](https://twitter.com/reactconf_ir) - [Instagram](https://www.instagram.com/reactconf/)
19+
1520
### React Rally 2019 {#react-rally-2019}
1621
August 22-23, 2019. Salt Lake City, USA.
1722

content/community/meetups.md

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
2222
## Brazil {#brazil}
2323
* [Belo Horizonte](https://www.meetup.com/reactbh/)
2424
* [Curitiba](https://www.meetup.com/pt-br/ReactJS-CWB/)
25+
* [Joinville](https://www.meetup.com/pt-BR/React-Joinville/)
2526
* [Rio de Janeiro](https://www.meetup.com/pt-BR/React-Rio-de-Janeiro/)
2627
* [São Paulo](https://www.meetup.com/pt-BR/ReactJS-SP/)
2728

@@ -107,8 +108,12 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
107108
## Scotland (UK) {#scotland-uk}
108109
* [Edinburgh](https://www.meetup.com/React-Scotland/)
109110

111+
## Singapore {#singapore}
112+
* [Singapore - React Knowledgeable](https://reactknowledgeable.org/)
113+
110114
## Spain {#spain}
111115
* [Barcelona](https://www.meetup.com/ReactJS-Barcelona/)
116+
* [Canarias](https://www.meetup.com/React-Canarias/)
112117

113118
## Sweden {#sweden}
114119
* [Goteborg](https://www.meetup.com/ReactJS-Goteborg/)
@@ -130,6 +135,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
130135
* [Leesburg, VA - ReactJS](https://www.meetup.com/React-NOVA/)
131136
* [Los Angeles, CA - ReactJS](https://www.meetup.com/socal-react/)
132137
* [Los Angeles, CA - React Native](https://www.meetup.com/React-Native-Los-Angeles/)
138+
* [Miami, FL - ReactJS](https://www.meetup.com/React-Miami/)
133139
* [Nashville, TN - ReactJS](https://www.meetup.com/NashReact-Meetup/)
134140
* [New York, NY - ReactJS](https://www.meetup.com/NYC-Javascript-React-Group/)
135141
* [New York, NY - React Ladies](https://www.meetup.com/React-Ladies/)

content/community/nav.yml

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
title: Model Management
3535
- id: data-fetching
3636
title: Data Fetching
37-
- id: testing
38-
title: Testing
3937
- id: ui-components
4038
title: UI Components
4139
- id: misc

content/community/tools-testing.md

-13
This file was deleted.

content/community/videos.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ Facebook engineers Bill Fisher and Jing Chen talk about Flux and React at Forwar
5353
### Going Big with React {#going-big-with-react}
5454

5555
Areeb Malik investigates how React performs in a high stress situation, and how it helped his team build safe code on a massive scale - (2014 - 0h31m).
56-
[![going big with React](https://i.vimeocdn.com/video/481670116_650.jpg)]
57-
56+
<iframe title="Areeb Malik : Going big with React" width="650" height="366" src="https://www.youtube-nocookie.com/embed/9qcBlN6-qwY" frameborder="0" allowfullscreen></iframe>
5857

5958
### Rethinking Best Practices {#rethinking-best-practices}
6059

content/docs/addons-test-utils.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ it('can render and update a counter', () => {
122122
});
123123
```
124124

125-
DOM イベントのディスパッチは、DOM コンテナが `document` に追加されたときだけ動作することを忘れないでください。[`react-testing-library`](https://github.com/kentcdodds/react-testing-library) のようなヘルパーを使えばボイラープレートのコードを減らせます。
125+
- DOM イベントのディスパッチは、DOM コンテナが `document` に追加されたときだけ動作することを忘れないでください。[React Testing Library](https://testing-library.com/react) のようなヘルパーを使えばボイラープレートのコードを減らせます。
126+
127+
- [`recipes`](/docs/recipes.html) ドキュメントには `act()` がどのように動作するのかについて例や使用法を交えた詳しい解説があります。
126128

127129
* * *
128130

@@ -139,7 +141,7 @@ mockComponent(
139141

140142
> 補足:
141143
>
142-
> `mockComponent()` はレガシーな API です。その代わりとして [shallow rendering](/docs/test-utils.html#shallow-rendering)[`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) の使用をおすすめします。
144+
> `mockComponent()` はレガシーな API です。その代わりとして [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) の使用をおすすめします。
143145
144146
* * *
145147

content/docs/code-splitting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ permalink: docs/code-splitting.html
66

77
## バンドル {#bundling}
88

9-
多くの React アプリケーションは、[Webpack](https://webpack.js.org/)[Browserify](http://browserify.org/) などの
9+
多くの React アプリケーションは、[Webpack](https://webpack.js.org/)[Rollup](https://rollupjs.org/)[Browserify](http://browserify.org/) などの
1010
ツールを使ってファイルを「バンドル」しています。
1111
バンドルはインポートされたファイルをたどって、それらを 1 つのファイルにまとめるプロセスです。
1212
このバンドルされたファイルを Web ページ内に置くことによって、アプリ全体を一度に読み込むことができます。

content/docs/error-boundaries.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class ErrorBoundary extends React.Component {
3636
return { hasError: true };
3737
}
3838
39-
componentDidCatch(error, info) {
39+
componentDidCatch(error, errorInfo) {
4040
// You can also log the error to an error reporting service
41-
logErrorToMyService(error, info);
41+
logErrorToMyService(error, errorInfo);
4242
}
4343
4444
render() {

content/docs/faq-styling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ _注意:この機能は React の一部ではありません。サードパー
4848

4949
### React でアニメーションは使えますか? {#can-i-do-animations-in-react}
5050

51-
React を使ってアニメーションを動かすことは可能です。例として、[React Transition Group](https://reactcommunity.org/react-transition-group/)[React Motion](https://github.com/chenglou/react-motion) をご覧ください。
51+
React を使ってアニメーションを動かすことは可能です。例として、[React Transition Group](https://reactcommunity.org/react-transition-group/)[React Motion](https://github.com/chenglou/react-motion)[React Spring](https://github.com/react-spring/react-spring) をご覧ください。

content/docs/hooks-effect.md

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function Example() {
131131
useEffect(() => {
132132
document.title = `You clicked ${count} times`;
133133
});
134+
}
134135
```
135136

136137
ここでは `count` という state 変数を宣言し、次に副作用を使うことを React に伝えています。`useEffect` フックには関数を渡しています。この関数こそが副作用関数です。この副作用関数内で `document.title` というブラウザ API を使ってドキュメントのタイトルを設定しています。副作用関数は関数スコープ内にあるため最新の `count` の値は副作用内から参照可能です。React がコンポーネントをレンダーする際に React はこの副作用を覚えておき、DOM を更新した後に呼び出します。これは初回を含む毎回のレンダー時に発生します。

content/docs/hooks-faq.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ React Native はバージョン 0.59 以降でフックをサポートします
106106

107107
これまでと同様に全く同じ API を使用し続けることができます。それらは動作し続けます。
108108

109-
将来的には、これらのライブラリの新バージョンが、例えば `useRedux()``useRouter()` のようなカスタムフックをエクスポートし、ラッパコンポーネントなしで同様の機能が使えるようになるかもしれません。
109+
React Redux は v7.1.0 より [フック API をサポート](https://react-redux.js.org/api/hooks)しており、`useDispatch``useSelector` といったフックを提供しています。
110+
111+
React Router のようなライブラリも将来的にフックをサポートするかもしれません。
110112

111113
### フックは静的型付けと組み合わせてうまく動きますか? {#do-hooks-work-with-static-typing}
112114

@@ -118,6 +120,10 @@ React Native はバージョン 0.59 以降でフックをサポートします
118120

119121
React の観点から見れば、フックを使ったコンポーネントは単なる普通のコンポーネントです。あなたのテストソリューションが React の内部動作に依存しているのでない場合、フックを使ったコンポーネントのテストのやり方は、あなたが普段コンポーネントをテストしているやり方と変わらないはずです。
120122

123+
> 補足
124+
>
125+
> [Testing Recipes](/docs/testing-recipes.html) にコピー・ペーストで使えるたくさんの例が掲載されています。
126+
121127
例えばこのようなカウンタコンポーネントがあるとしましょう:
122128

123129
```js
@@ -180,7 +186,9 @@ it('can render and update a counter', () => {
180186

181187
カスタムフックをテストしたい場合は、テスト内でコンポーネントを作って中でそのカスタムフックを使うようにしてください。そうすればそのコンポーネントをテストできます。
182188

183-
ボイラープレートを減らすため、エンドユーザが使うのと同じ形でコンポーネントを使ってテストが記述できるように設計されている、[`react-testing-library`](https://git.io/react-testing-library) の利用をお勧めします。
189+
ボイラープレートを減らすため、エンドユーザが使うのと同じ形でコンポーネントを使ってテストが記述できるように設計されている、[React Testing Library](https://testing-library.com/react) の利用をお勧めします。
190+
191+
詳細については、[Testing Recipes](/docs/testing-recipes.html) をご覧ください。
184192

185193
### [Lint ルール](https://www.npmjs.com/package/eslint-plugin-react-hooks) は具体的に何を強制するのですか? {#what-exactly-do-the-lint-rules-enforce}
186194

content/docs/nav.yml

+10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
title: パフォーマンス最適化
6060
- id: portals
6161
title: ポータル
62+
- id: profiler
63+
title: Profiler
6264
- id: react-without-es6
6365
title: ES6 なしで React を使う
6466
- id: react-without-jsx
@@ -123,6 +125,14 @@
123125
title: フック API リファレンス
124126
- id: hooks-faq
125127
title: フックに関するよくある質問
128+
- title: Testing
129+
items:
130+
- id: testing
131+
title: Testing Overview
132+
- id: testing-recipes
133+
title: Testing Recipes
134+
- id: testing-environments
135+
title: Testing Environments
126136
- title: Contributing
127137
items:
128138
- id: how-to-contribute

0 commit comments

Comments
 (0)