Skip to content

Commit 5c79337

Browse files
committed
Merge branch 'master' into translate/api-reference-react-component
2 parents bb7b035 + eec5450 commit 5c79337

12 files changed

+44
-30
lines changed

content/blog/2015-08-11-relay-technical-preview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ While React simplified the process of developing complex user-interfaces, it lef
1313

1414
Declarative data-fetching means that Relay applications specify *what* data they need, not *how* to fetch that data. Just as React uses a description of the desired UI to manage view updates, Relay uses a data description in the form of GraphQL queries. Given these descriptions, Relay coalesces queries into batches for efficiency, manages error-prone asynchronous logic, caches data for performance, and automatically updates views as data changes.
1515

16-
Relay is also component-oriented, extending the notion of a React component to include a description of what data is necessary to render it. This colocation allows developers to reason locally about their application and eliminates bugs such as under- or over-fetching data.
16+
Relay is also component-oriented, extending the notion of a React component to include a description of what data is necessary to render it. This collocation allows developers to reason locally about their application and eliminates bugs such as under- or over-fetching data.
1717

1818
Relay is in use at Facebook in production apps, and we're using it more and more because *Relay lets developers focus on their products and move fast*. It's working for us and we'd like to share it with the community.
1919

content/blog/2018-09-10-introducing-the-react-profiler.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ It also shows that each time it rendered, it was the most "expensive" component
140140

141141
To view this chart, either double-click on a component _or_ select a component and click on the blue bar chart icon in the right detail pane.
142142
You can return to the previous chart by clicking the "x" button in the right detail pane.
143-
You can aso double click on a particular bar to view more information about that commit.
143+
You can also double click on a particular bar to view more information about that commit.
144144

145145
![How to view all renders for a specific component](../images/blog/introducing-the-react-profiler/see-all-commits-for-a-fiber.gif)
146146

content/community/conferences.md

+15
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1616
January 31, 2019 in Tehran, Iran
1717
[Website](http://reactiran.com) - [Instagram](https://www.instagram.com/reactiran/)
1818

19+
### Reactathon 2019 {#reactathon-2019}
20+
March 30-31, 2019 in San Francisco, USA
21+
22+
[Website](https://www.reactathon.com/) - [Twitter](https://twitter.com/reactathon)
23+
1924
### App.js Conf 2019 {#appjs-conf-2019}
2025
April 4-5, 2019 in Kraków, Poland
2126

@@ -31,11 +36,21 @@ May 23-24, 2019 in Paris, France
3136

3237
[Website](https://www.react-europe.org) - [Twitter](https://twitter.com/ReactEurope) - [Facebook](https://www.facebook.com/ReactEurope) - [Videos](https://www.youtube.com/c/ReacteuropeOrgConf)
3338

39+
### React Conf Armenia 2019 {#react-conf-am-19}
40+
May 25, 2019 in Yerevan, Armenia
41+
42+
[Website](https://reactconf.am/) - [Twitter](https://twitter.com/ReactConfAM) - [Facebook](https://www.facebook.com/reactconf.am/) - [YouTube](https://www.youtube.com/c/JavaScriptConferenceArmenia) - [CFP](http://bit.ly/speakReact)
43+
3444
### React Norway 2019 {#react-norway-2019}
3545
June 12, 2019. Larvik, Norway
3646

3747
[Website](https://reactnorway.com) - [Twitter](https://twitter.com/ReactNorway)
3848

49+
### React Loop 2019 {#react-loop-2019}
50+
June 21, 2019 Chicago, Illinois USA
51+
52+
[Website](https://reactloop.com) - [Twitter](https://twitter.com/ReactLoop)
53+
3954
### ComponentsConf 2019 {#componentsconf-2019}
4055
September 6, 2019 in Melbourne, Australia
4156
[Website](https://www.componentsconf.com.au/) - [Twitter](https://twitter.com/componentsconf)

content/docs/addons-test-utils.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Pass a mocked component module to this method to augment it with useful methods
139139

140140
> Note:
141141
>
142-
> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/test-utils.html#shallow-rendering) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead.
142+
> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/shallow-renderer.html) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead.
143143
144144
* * *
145145

content/docs/faq-internals.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
22
id: faq-internals
3-
title: Virtual DOM and Internals
3+
title: 仮想 DOM と内部処理
44
permalink: docs/faq-internals.html
55
layout: docs
66
category: FAQ
77
---
88

9-
### What is the Virtual DOM? {#what-is-the-virtual-dom}
9+
### 仮想 DOM とは? {#what-is-the-virtual-dom}
1010

11-
The virtual DOM (VDOM) is a programming concept where an ideal, or "virtual", representation of a UI is kept in memory and synced with the "real" DOM by a library such as ReactDOM. This process is called [reconciliation](/docs/reconciliation.html).
11+
仮想 DOM (virtual DOM; VDOM) は、インメモリに保持された想像上のまたは「仮想の」UI 表現が、ReactDOM のようなライブラリによって「実際の」DOM と同期されるというプログラミング上の概念です。このプロセスは[差分検出処理 (reconciliation)](/docs/reconciliation.html)と呼ばれます。
1212

13-
This approach enables the declarative API of React: You tell React what state you want the UI to be in, and it makes sure the DOM matches that state. This abstracts out the attribute manipulation, event handling, and manual DOM updating that you would otherwise have to use to build your app.
13+
このアプローチにより React の宣言型 API が可能になっています。あなたは UI をどのような状態にしたいのか React に伝え、React は必ず DOM をその状態と一致させます。これにより、React なしではアプリケーションを構築するために避けて通れない属性の操作やイベントハンドリング、および手動での DOM 更新が抽象化されます。
1414

15-
Since "virtual DOM" is more of a pattern than a specific technology, people sometimes say it to mean different things. In React world, the term "virtual DOM" is usually associated with [React elements](/docs/rendering-elements.html) since they are the objects representing the user interface. React, however, also uses internal objects called "fibers" to hold additional information about the component tree. They may also be considered a part of "virtual DOM" implementation in React.
15+
"仮想 DOM" は特定の技術というよりむしろ 1 つのパターンなので、時たま違う意味で使われることがあります。React の世界において "仮想 DOM" という用語は通常、ユーザインタフェースを表現するオブジェクトである [React 要素](/docs/rendering-elements.html) と結びつけて考えられます。React は一方で、コンポーネントツリーに関する追加情報を保持するため "ファイバー (fiber)" と呼ばれる内部オブジェクトも使用します。これらも React における "仮想 DOM" 実装の一部と見なすことができます。
1616

17-
### Is the Shadow DOM the same as the Virtual DOM? {#is-the-shadow-dom-the-same-as-the-virtual-dom}
17+
### Shadow DOM は仮想 DOM と同じもの? {#is-the-shadow-dom-the-same-as-the-virtual-dom}
1818

19-
No, they are different. The Shadow DOM is a browser technology designed primarily for scoping variables and CSS in web components. The virtual DOM is a concept implemented by libraries in JavaScript on top of browser APIs.
19+
いいえ、違います。Shadow DOM は、本来 web components において変数や CSS をスコープ化するために設計されたブラウザ技術です。仮想 DOM JavaScript のライブラリによってブラウザ API の上に実装された概念です。
2020

21-
### What is "React Fiber"? {#what-is-react-fiber}
21+
### React Fiber」とは? {#what-is-react-fiber}
2222

23-
Fiber is the new reconciliation engine in React 16. Its main goal is to enable incremental rendering of the virtual DOM. [Read more](https://github.com/acdlite/react-fiber-architecture).
23+
Fiber React 16 の新しい差分検出処理エンジンです。その主な目的は仮想 DOM の逐次レンダーを可能にすることです。[さらに読む](https://github.com/acdlite/react-fiber-architecture)

content/docs/higher-order-components.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const EnhancedComponent = higherOrderComponent(WrappedComponent);
1414

1515
コンポーネントが props を UI に変換するのに対して、高階コンポーネントはコンポーネントを別のコンポーネントに変換します。
1616

17-
HOC は Redux における [`connect 関数`](https://github.com/reactjs/react-redux/blob/master/docs/api/connect.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) や Relay における [`createFragmentContainer`](http://facebook.github.io/relay/docs/en/fragment-container.html) のように、サードパーティ製の React ライブラリでは一般的なものです。
17+
HOC は Redux における [`connect`](https://github.com/reactjs/react-redux/blob/master/docs/api/connect.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) や Relay における [`createFragmentContainer`](http://facebook.github.io/relay/docs/en/fragment-container.html) のように、サードパーティ製の React ライブラリでは一般的なものです。
1818

1919
このドキュメントでは、なぜ高階コンポーネントが便利で、自身でどのように記述するのかを説明します。
2020

content/docs/hooks-faq.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ Note that this approach won't work in a loop because Hook calls [can't](/docs/ho
466466

467467
### How to create expensive objects lazily? {#how-to-create-expensive-objects-lazily}
468468

469-
`useMemo` lets you [memoize an expensive calculation](#how-to-memoize-calculations) if the inputs are the same. However, it only serves as a hint, and doesn't *guarantee* the computation won't re-run. But sometimes need to be sure an object is only created once.
469+
`useMemo` lets you [memoize an expensive calculation](#how-to-memoize-calculations) if the inputs are the same. However, it only serves as a hint, and doesn't *guarantee* the computation won't re-run. But sometimes you need to be sure an object is only created once.
470470

471471
**The first common use case is when creating the initial state is expensive:**
472472

@@ -560,7 +560,7 @@ In large component trees, an alternative we recommend is to pass down a `dispatc
560560
const TodosDispatch = React.createContext(null);
561561
562562
function TodosApp() {
563-
// Tip: `dispatch` won't change between re-renders
563+
// Note: `dispatch` won't change between re-renders
564564
const [todos, dispatch] = useReducer(todosReducer);
565565
566566
return (

content/docs/hooks-intro.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ React 開発者はプロダクト開発に注力する必要があり、リリ
9797

9898
また、React に新しい基本機能を付け加えるハードルが非常に高いということも理解しています。興味ある読者のために我々は[詳しい RFC](https://github.com/reactjs/rfcs/pull/68) を用意しています。そこではより詳しく動機を掘り下げており、関連する先行技術や個別の設計上の選択についての概要が述べられています。
9999

100-
**肝心なことですが、フックは既存のコードと併用することができるので、段階的に採用していくことが可能です。**我々は将来の React を形作っていくことに興味があるコミュニティの人々から初期フィードバックを得るためにこの実験的な API を公開しており、開かれた場で開発サイクルを進めていきます。
101-
102-
最後に、フックへの移行を急ぐ必要はありません。特に既存の複雑なコンポーネントについては、「大幅な書き換え」は避けることを推奨します。『フックで考えられる』ようになるには若干の思考の転換が必要です。我々の経験上は、あまり重要でない新しいコンポーネントでまずフックの使い方を練習し、チームの全員が慣れるようにすることが最良です。フックを試してみたら、どうぞお気軽に[フィードバックを送って](https://github.com/facebook/react/issues/new)ください。ポジティブなものでもネガティブなものでも構いません。
100+
**肝心なことですが、フックは既存のコードと併用することができるので、段階的に採用していくことが可能です。**フックへの移行を急ぐ必要はありません。特に既存の複雑なコンポーネントについては、「大幅な書き換え」は避けることを推奨します。『フックで考えられる』ようになるには若干の思考の転換が必要です。我々の経験上は、あまり重要でない新しいコンポーネントでまずフックの使い方を練習し、チームの全員が慣れるようにすることが最良です。フックを試してみたら、どうぞお気軽に[フィードバックを送って](https://github.com/facebook/react/issues/new)ください。ポジティブなものでもネガティブなものでも構いません。
103101

104102
クラスコンポーネントのユースケースをすべてフックがカバーできるようにする予定ではいますが、**クラスコンポーネントのサポートも予見可能な将来にわたって続けていきます。**Facebook では何万というコンポーネントがクラスとして書かれており、それらを書き換える予定は全くありません。代わりに、クラスと併用しながら新しいコードでフックを使っていく予定でいます。
105103

content/docs/hooks-overview.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ React は `useState` のような幾つかのビルトインのフックを提
6868
>
6969
> ステートフックについてはこちらのページを参照してください:[ステートフックの利用法](/docs/hooks-state.html).
7070
71-
## ⚡️ 副作用フック {#️effect-hook}
71+
## ⚡️ 副作用フック {#effect-hook}
7272

7373
これまでに React コンポーネントの内部から、外部データの取得や購読、あるいは手動での DOM 更新を行ったことがおありでしょう。これらの操作は他のコンポーネントに影響することがあり、またレンダーの最中に実行することができないので、われわれはこのような操作を "副作用 (side-effects)"、あるいは省略して "作用 (effects)" と呼んでいます。
7474

@@ -159,7 +159,7 @@ function FriendStatusWithCounter(props) {
159159
>
160160
> `useEffect` についての更なる詳細は[副作用フックの利用法](/docs/hooks-effect.html)を参照してください。
161161
162-
## ✌️ フックのルール {#️rules-of-hooks}
162+
## ✌️ フックのルール {#rules-of-hooks}
163163

164164
フックは JavaScript の関数ですが、2 つの追加のルールがあります。
165165

content/docs/static-type-checking.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,18 @@ Congrats! You've installed the latest version of TypeScript into your project. I
216216
```
217217

218218
### Configuring the TypeScript Compiler {#configuring-the-typescript-compiler}
219-
The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file run:
219+
The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file:
220+
221+
If you use [Yarn](https://yarnpkg.com/), run:
222+
223+
```bash
224+
yarn run tsc --init
225+
```
226+
227+
If you use [npm](https://www.npmjs.com/), run:
220228

221229
```bash
222-
tsc --init
230+
npx tsc --init
223231
```
224232

225233
Looking at the now generated `tsconfig.json`, you can see that there are many options you can use to configure the compiler. For a detailed description of all the options, check [here](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).

content/docs/strict-mode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ React used to support `findDOMNode` to search the tree for a DOM node given a cl
5757

5858
`findDOMNode` can also be used on class components but this was breaking abstraction levels by allowing a parent to demand that certain children was rendered. It creates a refactoring hazard where you can't change the implementation details of a component because a parent might be reaching into its DOM node. `findDOMNode` only returns the first child, but with the use of Fragments, it is possible for a component to render multiple DOM nodes. `findDOMNode` is a one time read API. It only gave you an answer when you asked for it. If a child component renders a different node, there is no way to handle this change. Therefore `findDOMNode` only worked if components always return a single DOM node that never changes.
5959

60-
You can instead make this explicit by pass a ref to your custom component and pass that along to the DOM using [ref forwarding](/docs/forwarding-refs.html#forwarding-refs-to-dom-components).
60+
You can instead make this explicit by passing a ref to your custom component and pass that along to the DOM using [ref forwarding](/docs/forwarding-refs.html#forwarding-refs-to-dom-components).
6161

6262
You can also add a wrapper DOM node in your component and attach a ref directly to it.
6363

src/pages/index.js

-7
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,6 @@ Home.propTypes = {
310310
}).isRequired,
311311
};
312312

313-
function renderExamplePlaceholder(containerId) {
314-
ReactDOM.render(
315-
<h4>Loading code example...</h4>,
316-
document.getElementById(containerId),
317-
);
318-
}
319-
320313
const CtaItem = ({children, primary = false}) => (
321314
<div
322315
css={{

0 commit comments

Comments
 (0)