diff --git a/content/docs/implementation-notes.md b/content/docs/implementation-notes.md
index a035a5edf..69be6de5a 100644
--- a/content/docs/implementation-notes.md
+++ b/content/docs/implementation-notes.md
@@ -1,6 +1,6 @@
---
id: implementation-notes
-title: Implementation Notes
+title: 実装に関するメモ
layout: contributing
permalink: docs/implementation-notes.html
prev: codebase-overview.html
@@ -9,50 +9,50 @@ redirect_from:
- "contributing/implementation-notes.html"
---
-This section is a collection of implementation notes for the [stack reconciler](/docs/codebase-overview.html#stack-reconciler).
+この章は [stack リコンサイラ (reconciler)](/docs/codebase-overview.html#stack-reconciler) の実装に関するメモを集めたものです。
-It is very technical and assumes a strong understanding of React public API as well as how it's divided into core, renderers, and the reconciler. If you're not very familiar with the React codebase, read [the codebase overview](/docs/codebase-overview.html) first.
+これは非常に技術的な内容であり、React の公開 API だけでなく、React がどのようにコア、レンダラ (renderer) 、そしてリコンサイラに分割されているかについても、深く理解していることを前提としています。React のコードベースにあまり精通していないのであれば、まず[コードベースの概要](/docs/codebase-overview.html)を読んでください。
-It also assumes an understanding of the [differences between React components, their instances, and elements](/blog/2015/12/18/react-components-elements-and-instances.html).
+また、これは [React のコンポーネント、インスタンスおよび要素の違い](/blog/2015/12/18/react-components-elements-and-instances.html)についての理解を前提としています。
-The stack reconciler was used in React 15 and earlier. It is located at [src/renderers/shared/stack/reconciler](https://github.com/facebook/react/tree/15-stable/src/renderers/shared/stack/reconciler).
+stack リコンサイラは、React 15 およびそれ以前のバージョンで使われていました。[src/renderers/shared/stack/reconciler](https://github.com/facebook/react/tree/15-stable/src/renderers/shared/stack/reconciler) で見つけることができます。
-### Video: Building React from Scratch {#video-building-react-from-scratch}
+### 動画:React をスクラッチで作成する {#video-building-react-from-scratch}
-[Paul O'Shannessy](https://twitter.com/zpao) gave a talk about [building React from scratch](https://www.youtube.com/watch?v=_MAD4Oly9yg) that largely inspired this document.
+このドキュメントは、[Paul O'Shannessy](https://twitter.com/zpao) 氏の行った講演 [building React from scratch](https://www.youtube.com/watch?v=_MAD4Oly9yg) に大いに啓発されています。
-Both this document and his talk are simplifications of the real codebase so you might get a better understanding by getting familiar with both of them.
+このドキュメントと彼の講演は、ともに実際のコードベースを簡素化したもので、両方に親しむことでより深く理解することができるでしょう。
-### Overview {#overview}
+### 概要 {#overview}
-The reconciler itself doesn't have a public API. [Renderers](/docs/codebase-overview.html#stack-renderers) like React DOM and React Native use it to efficiently update the user interface according to the React components written by the user.
+リコンサイラそのものは公開 API を持ちません。リコンサイラは、React DOM や React Native のような [レンダラ](/docs/codebase-overview.html#stack-renderers) が、ユーザーの記述した React コンポーネントに応じてユーザーインターフェースを効率よく更新するために使用されます。
-### Mounting as a Recursive Process {#mounting-as-a-recursive-process}
+### 再帰的な処理としてマウントする {#mounting-as-a-recursive-process}
-Let's consider the first time you mount a component:
+一番最初にコンポーネントをマウントするときのことを考えてみましょう:
```js
ReactDOM.render(, rootEl);
```
-React DOM will pass `` along to the reconciler. Remember that `` is a React element, that is, a description of *what* to render. You can think about it as a plain object:
+React DOM はリコンサイラに `` を渡します。`` が React 要素であること、つまり、「何」をレンダリングするかの記述であることを思い出してください。これはプレーンなオブジェクトとして考えることができます:
```js
console.log();
// { type: App, props: {} }
```
-The reconciler will check if `App` is a class or a function.
+リコンサイラは `App` がクラスか関数かをチェックします。
-If `App` is a function, the reconciler will call `App(props)` to get the rendered element.
+もし `App` が関数なら、リコンサイラは `App(props)` を呼び出してレンダーされた要素を取得します。
-If `App` is a class, the reconciler will instantiate an `App` with `new App(props)`, call the `componentWillMount()` lifecycle method, and then will call the `render()` method to get the rendered element.
+もし `App` がクラスなら、リコンサイラは `new App(props)` で `App` をインスタンス化し、`componentWillMount()` ライフサイクルメソッドを呼び出し、それから `render()` メソッドを呼び出してレンダーされた要素を取得します。
-Either way, the reconciler will learn the element `App` "rendered to".
+どちらにせよ、リコンサイラは `App` が「レンダーされた」結果となる要素を手に入れます。
-This process is recursive. `App` may render to a ``, `Greeting` may render to a ``, and so on. The reconciler will "drill down" through user-defined components recursively as it learns what each component renders to.
+このプロセスは再帰的です。`App` は `` へとレンダーされるかもしれませんし、`Greeting` は `` にレンダーされるかもしれない、といったように続いていきます。リコンサイラはそれぞれのコンポーネントが何にレンダーされるかを学習しながら、ユーザ定義コンポーネントを再帰的に「掘り下げて」いきます。
-You can imagine this process as a pseudocode:
+この処理の流れは擬似コードで想像することができます:
```js
function isClass(type) {
@@ -103,42 +103,42 @@ var node = mount();
rootEl.appendChild(node);
```
->**Note:**
+>**補足:**
>
->This really *is* a pseudo-code. It isn't similar to the real implementation. It will also cause a stack overflow because we haven't discussed when to stop the recursion.
+>これは**全くの**擬似コードです。本物の実装に近いものではありません。また、いつ再帰を止めるか検討していないため、このコードはスタックオーバーフローを引き起こします。
-Let's recap a few key ideas in the example above:
+上記の例でいくつかの鍵となるアイデアをおさらいしましょう:
-* React elements are plain objects representing the component type (e.g. `App`) and the props.
-* User-defined components (e.g. `App`) can be classes or functions but they all "render to" elements.
-* "Mounting" is a recursive process that creates a DOM or Native tree given the top-level React element (e.g. ``).
+* React 要素とはコンポーネントの型(例えば `App`)と props を表すプレーンなオブジェクトである。
+* ユーザー定義コンポーネント(例えば `App`)はクラスであっても関数であってもよいが、それらは全て要素へと「レンダーされる」。
+* 「マウント」とは、最上位の React 要素(例えば ``)を受け取り、DOM もしくはネイティブなツリーを構築する再帰的な処理である。
-### Mounting Host Elements {#mounting-host-elements}
+### host要素のマウント {#mounting-host-elements}
-This process would be useless if we didn't render something to the screen as a result.
+このようにして要素ができても、それを使って画面に何か表示しなければ意味がありません。
-In addition to user-defined ("composite") components, React elements may also represent platform-specific ("host") components. For example, `Button` might return a `
` from its render method.
+ユーザー定義 ("composite") コンポーネントに加え、React 要素はプラットフォームに固有な ("host") コンポーネントも表すことができます。例えば、`Button` は render メソッドから `` を返すことが考えられます。
-If element's `type` property is a string, we are dealing with a host element:
+もし要素の `type` プロパティが文字列なら、私たちはいま host 要素を扱っていることになります:
```js
console.log();
// { type: 'div', props: {} }
```
-There is no user-defined code associated with host elements.
+host 要素に関連付けられているユーザー定義のコードはありません。
-When the reconciler encounters a host element, it lets the renderer take care of mounting it. For example, React DOM would create a DOM node.
+リコンサイラは host 要素を見つけると、レンダラに host 要素のマウントを任せます。例えば、React DOM は DOM ノードを生成します。
-If the host element has children, the reconciler recursively mounts them following the same algorithm as above. It doesn't matter whether children are host (like `
`), composite (like ``), or both.
+host 要素に子要素がある場合、リコンサイラは前節で述べたものと同じアルゴリズムに従い、子要素を再帰的にマウントします。子要素が(`
` のような)host なのか、(`` のような)composite なのか、もしくはその両方が含まれているかに関わらず、再帰的な処理が実行されます。
-The DOM nodes produced by the child components will be appended to the parent DOM node, and recursively, the complete DOM structure will be assembled.
+子コンポーネントにより生成された DOM ノードは親の DOM ノードに追加され、それが再帰的に行われることで、完全な DOM 構造が組み立てられます。
->**Note:**
+>**補足:**
>
->The reconciler itself is not tied to the DOM. The exact result of mounting (sometimes called "mount image" in the source code) depends on the renderer, and can be a DOM node (React DOM), a string (React DOM Server), or a number representing a native view (React Native).
+>リコンサイラそのものは DOM と結合していません。マウントの結果自体(時にソースコードでは "mount image" とも呼ばれます)はレンダラに依存し、それは(React DOM なら)DOM ノード であったり、(React DOM Server なら)文字列であったり、(React Native なら)ネイティブのビューを表す数字であったりします。
-If we were to extend the code to handle host elements, it would look like this:
+前出のコードを host 要素も扱えるように拡張するとすれば、以下のようなものになるでしょう:
```js
function isClass(type) {
@@ -229,11 +229,11 @@ var node = mount();
rootEl.appendChild(node);
```
-This is working but still far from how the reconciler is really implemented. The key missing ingredient is support for updates.
+このコードは動作しますが、それでもまだ現実のリコンサイラの実装方法からは隔たりがあります。ここにあるべき鍵となる要素は、更新に対応することです。
-### Introducing Internal Instances {#introducing-internal-instances}
+### 内部インスタンスの導入 {#introducing-internal-instances}
-The key feature of React is that you can re-render everything, and it won't recreate the DOM or reset the state:
+React の鍵となる機能は、あらゆるものを再描画できることであり、その際に DOM を再生成したり、state をリセットしたりしないことです:
```js
ReactDOM.render(, rootEl);
@@ -241,13 +241,13 @@ ReactDOM.render(, rootEl);
ReactDOM.render(, rootEl);
```
-However, our implementation above only knows how to mount the initial tree. It can't perform updates on it because it doesn't store all the necessary information, such as all the `publicInstance`s, or which DOM `node`s correspond to which components.
+しかし、前節で実装したコードは最初のツリーをマウントする方法しか知りません。前節のコードは、全ての `publicInstance` や、どの DOM `node` がどのコンポーネントに対応しているかなど、必要な全情報を保有しているわけではないので、更新を実行することができません。
-The stack reconciler codebase solves this by making the `mount()` function a method and putting it on a class. There are drawbacks to this approach, and we are going in the opposite direction in the [ongoing rewrite of the reconciler](/docs/codebase-overview.html#fiber-reconciler). Nevertheless this is how it works now.
+stack リコンサイラのコードベースでは、この問題を `mount()` 関数をメソッドとしてクラスに置くことで解決しています。しかしこのアプローチには欠点があるため、[進行中のリコンサイラの書き直し作業](/docs/codebase-overview.html#fiber-reconciler)では、反対の方向に進んでいます。それでも現時点では、この方式で動作しています。
-Instead of separate `mountHost` and `mountComposite` functions, we will create two classes: `DOMComponent` and `CompositeComponent`.
+別々の `mountHost` と `mountComposite` 関数の代わりに、2 つのクラスを作成します: `DOMComponent` と `CompositeComponent` です。
-Both classes have a constructor accepting the `element`, as well as a `mount()` method returning the mounted node. We will replace a top-level `mount()` function with a factory that instantiates the correct class:
+両方のクラスが `element` を受け入れるコンストラクタと、マウントされたノードを返す `mount()` メソッドを持ちます。最上位の `mount()` 関数を、正しいクラスをインスタンス化するファクトリに置き換えます:
```js
function instantiateComponent(element) {
@@ -262,7 +262,7 @@ function instantiateComponent(element) {
}
```
-First, let's consider the implementation of `CompositeComponent`:
+まず、`CompositeComponent` の実装から考えてみましょう:
```js
class CompositeComponent {
@@ -315,15 +315,15 @@ class CompositeComponent {
}
```
-This is not much different from our previous `mountComposite()` implementation, but now we can save some information, such as `this.currentElement`, `this.renderedComponent`, and `this.publicInstance`, for use during updates.
+以前の `mountComposite()` の実装と大きな違いはありませんが、更新時に使用する `this.currentElement` 、`this.renderedComponent` や、`this.publicInstance` のような情報を保存できるようになりました。
-Note that an instance of `CompositeComponent` is not the same thing as an instance of the user-supplied `element.type`. `CompositeComponent` is an implementation detail of our reconciler, and is never exposed to the user. The user-defined class is the one we read from `element.type`, and `CompositeComponent` creates an instance of it.
+`CompositeComponent` のインスタンスは、ユーザーが指定する `element.type` のインスタンスとは同一ではないことに注意してください。`CompositeComponent` はリコンサイラの実装の詳細であり、ユーザーには決して公開されません。ユーザー定義クラスとは `element.type` から読み込むものであり、`CompositeComponent` がそのインスタンスを作成するのです。
-To avoid the confusion, we will call instances of `CompositeComponent` and `DOMComponent` "internal instances". They exist so we can associate some long-lived data with them. Only the renderer and the reconciler are aware that they exist.
+混乱を避けるために、`CompositeComponent` と `DOMComponent` のインスタンスを「内部インスタンス」と呼ぶことにします。内部インスタンスは、長期間利用されるデータとそれらを関連付けられるようにするために存在します。それらの存在はレンダラとリコンサイラのみが認識しています。
-In contrast, we call an instance of the user-defined class a "public instance". The public instance is what you see as `this` in the `render()` and other methods of your custom components.
+一方、ユーザー定義クラスのインスタンスは「公開インスタンス」と呼ぶことにします。公開インスタンスは、独自コンポーネントの `render()` やその他のメソッド内で `this` として現れるものです。
-The `mountHost()` function, refactored to be a `mount()` method on `DOMComponent` class, also looks familiar:
+`mountHost()` 関数は、`DOMComponent` クラスの `mount()` メソッドとしてリファクタリングされ、こちらも見慣れたものになります:
```js
class DOMComponent {
@@ -374,9 +374,9 @@ class DOMComponent {
}
```
-The main difference after refactoring from `mountHost()` is that we now keep `this.node` and `this.renderedChildren` associated with the internal DOM component instance. We will also use them for applying non-destructive updates in the future.
+mountHost() からリファクタリングした後の主な違いは、`this.node` と `this.renderedChildren` を内部の DOM コンポーネントインスタンスに関連付け続けていることです。これらは、将来的に非破壊的な更新を適用する際にも使用します。
-As a result, each internal instance, composite or host, now points to its child internal instances. To help visualize this, if a function `` component renders a `