Skip to content

Commit bab0404

Browse files
committed
Translate Adopting Concurrent Mode
1 parent 2cacc5b commit bab0404

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed
+51-51
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
---
22
id: concurrent-mode-adoption
3-
title: Adopting Concurrent Mode (Experimental)
3+
title: 並列モードの利用開始 (実験的機能)
44
permalink: docs/concurrent-mode-adoption.html
55
prev: concurrent-mode-patterns.html
66
next: concurrent-mode-reference.html
77
---
88

9-
>Caution:
9+
>警告:
1010
>
11-
>This page describes **experimental features that are not yet available in a stable release**. Don't rely on experimental builds of React in production apps. These features may change significantly and without a warning before they become a part of React.
11+
> このページでは**安定リリースで[まだ利用できない](/docs/concurrent-mode-adoption.html)実験的機能**を説明しています。本番のアプリケーションで React の実験的ビルドを利用しないでください。これらの機能は React の一部となる前に警告なく大幅に変更される可能性があります。
1212
>
13-
>This documentation is aimed at early adopters and people who are curious. If you're new to React, don't worry about these features -- you don't need to learn them right now.
13+
> このドキュメントは興味のある読者やアーリーアダプター向けのものです。React が初めての方はこれらの機能を気にしないで構いません -- 今すぐに学ぶ必要はありません。
1414
15-
- [Installation](#installation)
16-
- [Who Is This Experimental Release For?](#who-is-this-experimental-release-for)
17-
- [Enabling Concurrent Mode](#enabling-concurrent-mode)
18-
- [What to Expect](#what-to-expect)
19-
- [Migration Step: Blocking Mode](#migration-step-blocking-mode)
20-
- [Why So Many Modes?](#why-so-many-modes)
21-
- [Feature Comparison](#feature-comparison)
15+
- [インストール](#installation)
16+
- [この実験的リリースは誰のためのものか?](#who-is-this-experimental-release-for)
17+
- [並列モードの有効化](#enabling-concurrent-mode)
18+
- [期待されること](#what-to-expect)
19+
- [移行ステップ:ブロッキングモード](#migration-step-blocking-mode)
20+
- [何故こんなにモードがあるのか?](#why-so-many-modes)
21+
- [機能の比較](#feature-comparison)
2222

23-
## Installation {#installation}
23+
## インストール {#installation}
2424

25-
Concurrent Mode is only available in the [experimental builds](/blog/2019/10/22/react-release-channels.html#experimental-channel) of React. To install them, run:
25+
並列モードは React の[実験的ビルド (experimental build)](/blog/2019/10/22/react-release-channels.html#experimental-channel) でのみ利用可能です。インストールするには以下を実行してください:
2626

2727
```
2828
npm install react@experimental react-dom@experimental
2929
```
3030

31-
**There are no semantic versioning guarantees for the experimental builds.**
32-
APIs may be added, changed, or removed with any `@experimental` release.
31+
**実験的ビルドにはセマンティック・バージョニングに準拠するという保証がありません。**
32+
API は `@experimental` のどのリリースにおいても追加・変更・削除される可能性があります。
3333

34-
**Experimental releases will have frequent breaking changes.**
34+
**実験的ビルドは破壊的変更が頻繁に起こります。**
3535

36-
You can try these builds on personal projects or in a branch, but we don't recommend running them in production. At Facebook, we *do* run them in production, but that's because we're also there to fix bugs when something breaks. You've been warned!
36+
これらのビルドを個人的プロジェクトやブランチで試すのは構いませんが、本番環境で実行することは推奨しません。Facebook では実際に本番環境で実行しているのですが、それは何かが壊れた時に直せるよう我々もそこにいるからです。警告はしましたよ!
3737

38-
### Who Is This Experimental Release For? {#who-is-this-experimental-release-for}
38+
### この実験的リリースは誰のためのものか? {#who-is-this-experimental-release-for}
3939

40-
This release is primarily aimed at early adopters, library authors, and curious people.
40+
このリリースは主にアーリーアダプター、ライブラリ作者、その他興味がある人向けです。
4141

42-
We're using this code in production (and it works for us) but there are still some bugs, missing features, and gaps in the documentation. We'd like to hear more about what breaks in Concurrent Mode so we can better prepare it for an official stable release in the future.
42+
我々はこのコードを本番環境で使っています(我々のところでは動いています)が、まだいくつかのバグや欠けている機能、ドキュメントとの齟齬があります。将来の公式安定リリースに向けてよりよい準備ができるよう、並列モードでどこが壊れるのかについてもっと意見を集めたいと思っています。
4343

44-
### Enabling Concurrent Mode {#enabling-concurrent-mode}
44+
### 並列モードの有効化 {#enabling-concurrent-mode}
4545

46-
Normally, when we add features to React, you can start using them immediately. Fragments, Context, and even Hooks are examples of such features. You can use in new code without making any changes to the existing code.
46+
通常、React に機能を加える際は、それをすぐ使い始めることができます。フラグメント、コンテクスト、そしてフックですら、そのような機能の例です。既存のコードに何ら変更を加えずに新しいコードで使うことができます。
4747

48-
Concurrent Mode is different. It introduces semantic changes to how React works. Otherwise, the [new features](/docs/concurrent-mode-patterns.html) enabled by it *wouldn't be possible*. This is why they're grouped into a new "mode" rather than released one by one in isolation.
48+
並列モードは異なります。React がどのように動作するのかについて意味上の変更が行われています。そうしなければ並列モードで有効になる[新機能](/docs/concurrent-mode-patterns.html)*実現不可能だった*でしょう。これが、新機能がひとつずつ分割してリリースされるのではなく、新しい「モード」としてグループ化されている理由です。
4949

50-
You can't opt into Concurrent Mode on a per-subtree basis. Instead, to opt in, you have to do it in the place where today you call `ReactDOM.render()`.
50+
サブツリーごとに並列モードを使い始めることはできません。代わりに、使い始めると宣言するには、現在 `ReactDOM.render()` と呼ばれている場所でそれを行う必要があります。
5151

52-
**This will enable Concurrent Mode for the whole `<App />` tree:**
52+
**これにより並列モードが `<App />` のツリー全体で有効化されます:**
5353

5454
```js
5555
import ReactDOM from 'react-dom';
@@ -65,37 +65,37 @@ ReactDOM.createRoot(
6565
).render(<App />);
6666
```
6767

68-
>Note:
68+
> 補足:
6969
>
70-
>Concurrent Mode APIs such as `createRoot` only exist in the experimental builds of React.
70+
> `createRoot` のような並列モードの API は React の実験的ビルドにのみ存在しています。
7171
72-
In Concurrent Mode, the lifecycle methods [previously marked](https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html) as "unsafe" actually *are* unsafe, and lead to bugs even more than in today's React. We don't recommend trying Concurrent Mode until your app is [Strict Mode](https://reactjs.org/docs/strict-mode.html)-compatible.
72+
並列モードでは、"unsafe" であると[以前にマークされている](https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html)ライフサイクルメソッドは*本当に*安全ではなくなっており、現行の React よりもさらに多くのバグを引き起こします。あなたのアプリケーションが [Strict Mode](https://reactjs.org/docs/strict-mode.html) 互換になっていない限り、並列モードを試すことは勧められません。
7373

74-
## What to Expect {#what-to-expect}
74+
## 期待されること {#what-to-expect}
7575

76-
If you have a large existing app, or if your app depends on a lot of third-party packages, please don't expect that you can use the Concurrent Mode immediately. **For example, at Facebook we are using Concurrent Mode for the new website, but we're not planning to enable it on the old website.** This is because our old website still uses unsafe lifecycle methods in the product code, incompatible third-party libraries, and patterns that don't work well with the Concurrent Mode.
76+
もし大きな既存のアプリケーションがあるか、あなたのアプリケーションが多くのサードパーティのパッケージに依存している場合、並列モードがすぐに使えるとは期待しないでください。**例えば、Facebook では新ウェブサイトで並列モードを使っていますが、旧サイトで有効化する予定はありません。**これは我々の旧サイトでは依然 unsafe なライフライクルメソッドや互換性のないサードパーティのライブラリ、並列モードではうまく動かないパターンが本番コードで使われているからです。
7777

78-
In our experience, code that uses idiomatic React patterns and doesn't rely on external state management solutions is the easiest to get running in the Concurrent Mode. We will describe common problems we've seen and the solutions to them separately in the coming weeks.
78+
我々の経験上、理想的な React のパターンを利用し、外部の状態管理ソリューションに依存していないコードが、並列モードで最も動作させやすくなっています。向こう数週で、我々が見てきたよくある問題やそれらの解決方法について個別に説明してく予定です。
7979

80-
### Migration Step: Blocking Mode {#migration-step-blocking-mode}
80+
### 移行ステップ:ブロッキングモード {#migration-step-blocking-mode}
8181

82-
For older codebases, Concurrent Mode might be a step too far. This is why we also provide a new "Blocking Mode" in the experimental React builds. You can try it by substituting `createRoot` with `createBlockingRoot`. It only offers a *small subset* of the Concurrent Mode features, but it is closer to how React works today and can serve as a migration step.
82+
古いコードベースにとって並列モードはかけ離れすぎているかもしれません。このため、実験用 React ビルドは新たな "ブロッキングモード (blocking mode)" を提供しています。これは `createRoot` `createBlockingRoot` で置き換えることで試すことができます。これは並列モードの機能の*小さなサブセット*のみを提供しますが、現行の React の動作に近いため、移行用のステップとして利用することができます。
8383

84-
To recap:
84+
まとめると:
8585

86-
* **Legacy Mode:** `ReactDOM.render(<App />, rootNode)`. This is what React apps use today. There are no plans to remove the legacy mode in the observable future — but it won't be able to support these new features.
87-
* **Blocking Mode:** `ReactDOM.createBlockingRoot(rootNode).render(<App />)`. It is currently experimental. It is intended as a first migration step for apps that want to get a subset of Concurrent Mode features.
88-
* **Concurrent Mode:** `ReactDOM.createRoot(rootNode).render(<App />)`. It is currently experimental. In the future, after it stabilizes, we intend to make it the default React mode. This mode enables *all* the new features.
86+
* **レガシーモード:**`ReactDOM.render(<App />, rootNode)`. 現行の React アプリケーションが使っているものです。予見可能な範囲でレガシーモードを削除する予定はありません。しかし新機能をサポートすることはできません。
87+
* **ブロッキングモード:**`ReactDOM.createBlockingRoot(rootNode).render(<App />)`. 現在は実験用機能です。並列モードの機能の一部を使いたい場合の移行用ステップとして使われることが意図されています。
88+
* **並列モード:**`ReactDOM.createRoot(rootNode).render(<App />)`. 現在は実験用機能です。将来的に安定した後でデフォルトの React モードになることが意図されています。新機能の*すべて*が有効になります。
8989

90-
### Why So Many Modes? {#why-so-many-modes}
90+
### 何故こんなにモードがあるのか? {#why-so-many-modes}
9191

92-
We think it is better to offer a [gradual migration strategy](/docs/faq-versioning.html#commitment-to-stability) than to make huge breaking changes — or to let React stagnate into irrelevance.
92+
[段階的な移行方法](/docs/faq-versioning.html#commitment-to-stability)を提供することが望ましいと考えているからです -- さもなくば React の成長は止まり、使われないものになってしまうでしょう。
9393

94-
In practice, we expect that most apps using Legacy Mode today should be able to migrate at least to the Blocking Mode (if not Concurrent Mode). This fragmentation can be annoying for libraries that aim to support all Modes in the short term. However, gradually moving the ecosystem away from the Legacy Mode will also *solve* problems that affect major libraries in the React ecosystem, such as [confusing Suspense behavior when reading layout](https://github.com/facebook/react/issues/14536) and [lack of consistent batching guarantees](https://github.com/facebook/react/issues/15080). There's a number of bugs that can't be fixed in Legacy Mode without changing semantics, but don't exist in Blocking and Concurrent Modes.
94+
現実的には、現在レガシーモードを利用しているほとんどのアプリケーションは、(並列モードは難しくとも)少なくともブロッキングモードには移行可能であると期待しています。この分断化は、すべてのモードをサポートしようとするライブラリにとって短期的には煩わしいものかもしれません。しかし、エコシステムを徐々にレガシーモードから移行させることによって、[レイアウトを読み出す際の混乱を招くサスペンスの挙動](https://github.com/facebook/react/issues/14536)や[一貫性のあるバッチ保証の欠如](https://github.com/facebook/react/issues/15080)といった、著名ライブラリに影響する問題を*解決する*ことにもなります。レガシーモードではコードの意味を変えずには修正不可能だったが、ブロッキングモードや並列モードには存在しないというバグが数多くあります。
9595

96-
You can think of the Blocking Mode as a "gracefully degraded" version of the Concurrent Mode. **As a result, in longer term we should be able to converge and stop thinking about different Modes altogether.** But for now, Modes are an important migration strategy. They let everyone decide when a migration is worth it, and upgrade at their own pace.
96+
ブロッキングモードは並列モードが「うまく劣化した」バージョンであると考えることができます。**そのため、長期的には移行が完了でき、異なるモードについて考える必要が全くなくなるはずです。**しかし今のところは、モードの存在は移行のための重要な戦略です。これにより全員がマイグレーションに価値があるかを決められるようになり、個々のペースでアップグレードが行えるようになります。
9797

98-
### Feature Comparison {#feature-comparison}
98+
### 機能の比較 {#feature-comparison}
9999

100100
<style>
101101
#feature-table table { border-collapse: collapse; }
@@ -105,26 +105,26 @@ You can think of the Blocking Mode as a "gracefully degraded" version of the Con
105105

106106
<div id="feature-table">
107107

108-
| |Legacy Mode |Blocking Mode |Concurrent Mode |
108+
| |レガシーモード |ブロッキングモード |並列モード |
109109
|--- |--- |--- |--- |
110-
|String Refs ||🚫** |🚫** |
111-
|Legacy Context ||🚫** |🚫** |
110+
|文字列 Ref ||🚫** |🚫** |
111+
|レガシー版コンテクスト ||🚫** |🚫** |
112112
|findDOMNode ||🚫** |🚫** |
113113
|Suspense ||||
114114
|SuspenseList |🚫 |||
115115
|Suspense SSR + Hydration |🚫 |||
116116
|Progressive Hydration |🚫 |||
117117
|Selective Hydration |🚫 |🚫 ||
118118
|Cooperative Multitasking |🚫 |🚫 ||
119-
|Automatic batching of multiple setStates    |🚫* |||
120-
|Priority-based Rendering |🚫 |🚫 ||
121-
|Interruptible Prerendering |🚫 |🚫 ||
119+
|複数の setStates の自動バッチ処理    |🚫* |||
120+
|優先度ベースのレンダー |🚫 |🚫 ||
121+
|中断可能なプリレンダリング |🚫 |🚫 ||
122122
|useTransition |🚫 |🚫 ||
123123
|useDeferredValue |🚫 |🚫 ||
124-
|Suspense Reveal "Train" |🚫 |🚫 ||
124+
|「電車式」サスペンス開放 |🚫 |🚫 ||
125125

126126
</div>
127127

128-
\*: Legacy mode has automatic batching in React-managed events but it's limited to one browser task. Non-React events must opt-in using `unstable_batchedUpdates`. In Blocking Mode and Concurrent Mode, all `setState`s are batched by default.
128+
\*: レガシーモードには React で管理されるイベントの自動的なバッチ処理がありますが、単一のブラウザタスクに制限されています。非 React のイベントは `unstable_batchedUpdates` を使ってオプトインする必要があります。ブロッキングモードと並列モードではすべての `setState` は自動でバッチ化されます。
129129

130-
\*\*: Warns in development.
130+
\*\*: 開発モードでは警告を表示します。

0 commit comments

Comments
 (0)