Skip to content

Commit 02e4395

Browse files
authored
Merge pull request #890 from reactjs/sync-2534424e
Sync with react.dev @ 2534424
2 parents fe32a3c + f4b298c commit 02e4395

28 files changed

+69
-49
lines changed

.github/ISSUE_TEMPLATE/3-framework.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ body:
88
value: |
99
## Apply to be included as a recommended React framework
1010
11-
_This form is for framework authors to apply to be included as a recommended [React framework](https://react.dev/learn/start-a-new-react-project). If you are not a framework author, please contact the authors before submitting._
11+
_This form is for framework authors to apply to be included as a recommended [React framework](https://react.dev/learn/creating-a-react-app). If you are not a framework author, please contact the authors before submitting._
1212
1313
Our goal when recommending a framework is to start developers with a React project that solves common problems like code splitting, data fetching, routing, and HTML generation without any extra work later. We believe this will allow users to get started quickly with React, and scale their app to production.
1414
15-
While we understand that many frameworks may want to be featured, this page is not a place to advertise every possible React framework or all frameworks that you can add React to. There are many great frameworks that offer support for React that are not listed in our guides. The frameworks we recommend have invested significantly in the React ecosystem, and collaborated with the React team to be compatible with our [full-stack React architecture vision](https://react.dev/learn/start-a-new-react-project#which-features-make-up-the-react-teams-full-stack-architecture-vision).
15+
While we understand that many frameworks may want to be featured, this page is not a place to advertise every possible React framework or all frameworks that you can add React to. There are many great frameworks that offer support for React that are not listed in our guides. The frameworks we recommend have invested significantly in the React ecosystem, and collaborated with the React team to be compatible with our [full-stack React architecture vision](https://react.dev/learn/creating-a-react-app#which-features-make-up-the-react-teams-full-stack-architecture-vision).
1616
1717
To be included, frameworks must meet the following criteria:
1818

plugins/remark-smartypants.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,24 @@ const visit = require('unist-util-visit');
1414
const retext = require('retext');
1515
const smartypants = require('retext-smartypants');
1616

17-
function check(parent) {
17+
function check(node, parent) {
18+
if (node.data?.skipSmartyPants) return false;
1819
if (parent.tagName === 'script') return false;
1920
if (parent.tagName === 'style') return false;
2021
return true;
2122
}
2223

24+
function markSkip(node) {
25+
if (!node) return;
26+
node.data ??= {};
27+
node.data.skipSmartyPants = true;
28+
if (Array.isArray(node.children)) {
29+
for (const child of node.children) {
30+
markSkip(child);
31+
}
32+
}
33+
}
34+
2335
module.exports = function (options) {
2436
const processor = retext().use(smartypants, {
2537
...options,
@@ -43,8 +55,14 @@ module.exports = function (options) {
4355
let startIndex = 0;
4456
const textOrInlineCodeNodes = [];
4557

58+
visit(tree, 'mdxJsxFlowElement', (node) => {
59+
if (['TerminalBlock'].includes(node.name)) {
60+
markSkip(node); // Mark all children to skip smarty pants
61+
}
62+
});
63+
4664
visit(tree, ['text', 'inlineCode'], (node, _, parent) => {
47-
if (check(parent)) {
65+
if (check(node, parent)) {
4866
if (node.type === 'text') allText += node.value;
4967
// for the case when inlineCode contains just one part of quote: `foo'bar`
5068
else allText += 'A'.repeat(node.value.length);

src/components/Layout/HomeContent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export function HomeContent() {
292292
<CTA
293293
color="gray"
294294
icon="framework"
295-
href="/learn/start-a-new-react-project">
295+
href="/learn/creating-a-react-app">
296296
フレームワークで始める
297297
</CTA>
298298
</div>

src/components/MDX/TerminalBlock.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ function TerminalBlock({level = 'info', children}: TerminalBlockProps) {
7979
</div>
8080
</div>
8181
</div>
82-
<div
82+
<pre
8383
className="px-8 pt-4 pb-6 text-primary-dark dark:text-primary-dark font-mono text-code whitespace-pre overflow-x-auto"
8484
translate="no"
8585
dir="ltr">
86-
<LevelText type={level} />
87-
{message}
88-
</div>
86+
<code>
87+
<LevelText type={level} />
88+
{message}
89+
</code>
90+
</pre>
8991
</div>
9092
);
9193
}

src/content/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RSC は、サーバセントリックなマルチページアプリケーショ
3131

3232
データフェッチがかなり整理されましたので、クライアントからサーバという逆方向へのデータ送信を行って、データベース更新やフォームの実装ができる方法についても検討しています。サーバ/クライアントの境界を越えて Server Action 関数を渡せるようにすることで、クライアントがそれを呼び出し、シームレスな RPC を実現できるようする、という方法を考えています。Server Action により、JavaScript が読み込まれる前に段階的に動作するようになるフォームを提供することも可能です。
3333

34-
React Server Components は [Next.js App Router](/learn/start-a-new-react-project#nextjs-app-router) でリリースされました。これは RSC をプリミティブとして完全採用し深く統合を行ったルータのデモとなっていますが、これが RSC 互換ルータやフレームワークを構築するための唯一の方法というわけではありません。RSC 仕様が提供するものと、その実装が提供するものとの間には明確な区切りがあります。React Server Components は、互換のある複数の React フレームワーク間で動作する、コンポーネント仕様として作られています。
34+
React Server Components は [Next.js App Router](/learn/creating-a-react-app#nextjs-app-router) でリリースされました。これは RSC をプリミティブとして完全採用し深く統合を行ったルータのデモとなっていますが、これが RSC 互換ルータやフレームワークを構築するための唯一の方法というわけではありません。RSC 仕様が提供するものと、その実装が提供するものとの間には明確な区切りがあります。React Server Components は、互換のある複数の React フレームワーク間で動作する、コンポーネント仕様として作られています。
3535

3636
一般的には既存のフレームワークを使用することをお勧めしますが、自分自身のカスタムフレームワークの構築が必要な場合は、それも可能です。独自の RSC 互換フレームワークの構築は、主にバンドラとの深い統合が必要であるという理由により、我々が望むほど簡単なものにはなっていません。現行世代のバンドラはクライアントでの使用には適していますが、サーバとクライアントをまたいだ単一のモジュールグラフの分割を行うことを優先的なサポート項目として設計されてはいません。これが、現在 RSC のプリミティブを組み込んでもらうために、バンドラ開発者と直接協力している理由です。
3737

@@ -92,7 +92,7 @@ React コンポーネント内のプレーンな JavaScript をリアクティ
9292

9393
## トランジショントレーシング {/*transition-tracing*/}
9494

95-
Transition Tracing API により、[React のトランジション](/reference/react/useTransition)が遅くなったことを検出し、なぜ遅くなるのかを調査することができます。前回のお知らせ以降、API の初期設計を完了し、[RFC](https://github.com/reactjs/rfcs/pull/238) を公開しました。基本的な機能も実装されています。現在、プロジェクトは保留中です。RFC に対するフィードバックを歓迎します。React のパフォーマンス測定ツールをより良くするために開発を再開できるようになることを楽しみにしています。これは、[Next.js App Router](/learn/start-a-new-react-project#nextjs-app-router) のように React トランジション上に構築されたルータでは、特に役立ちます。
95+
Transition Tracing API により、[React のトランジション](/reference/react/useTransition)が遅くなったことを検出し、なぜ遅くなるのかを調査することができます。前回のお知らせ以降、API の初期設計を完了し、[RFC](https://github.com/reactjs/rfcs/pull/238) を公開しました。基本的な機能も実装されています。現在、プロジェクトは保留中です。RFC に対するフィードバックを歓迎します。React のパフォーマンス測定ツールをより良くするために開発を再開できるようになることを楽しみにしています。これは、[Next.js App Router](/learn/creating-a-react-app#nextjs-app-router) のように React トランジション上に構築されたルータでは、特に役立ちます。
9696

9797
* * *
9898
このページでのアップデートに加えて、私たちのチームは最近、コミュニティのポッドキャストやライブストリームにゲスト出演し、取り組みについてより多くのことをお話しし、質問に答える機会がありました。

src/content/blog/2024/12/05/react-19.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ async function handler(request) {
355355

356356
サーバコンポーネントは、クライアントアプリケーションや SSR サーバとは別の環境で、バンドル前にコンポーネントを事前レンダーするための新しいオプションです。React Server Components の "server" とはこの別の環境を指しています。サーバコンポーネントは、CI サーバでビルド時に一度だけ実行することも、ウェブサーバを使用してリクエストごとに実行することもできます。
357357

358-
React 19 には、Canary チャンネルにあったすべての React Server Components の機能が含まれています。これにより、サーバコンポーネントを使用するライブラリは、React 19 を peer dependency としてターゲットにすることができ、`react-server` [エクスポート条件](https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md#react-server-conditional-exports) を用いて[フルスタック React アーキテクチャ](/learn/start-a-new-react-project#which-features-make-up-the-react-teams-full-stack-architecture-vision)をサポートするフレームワークで使用できます。
358+
React 19 には、Canary チャンネルにあったすべての React Server Components の機能が含まれています。これにより、サーバコンポーネントを使用するライブラリは、React 19 を peer dependency としてターゲットにすることができ、`react-server` [エクスポート条件](https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md#react-server-conditional-exports) を用いて[フルスタック React アーキテクチャ](/learn/creating-a-react-app#which-features-make-up-the-react-teams-full-stack-architecture-vision)をサポートするフレームワークで使用できます。
359359

360360

361361
<Note>

src/content/blog/2025/10/07/react-compiler-1.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ _この例を [React Compiler Playground](https://playground.react.dev/#N4Igzg9g
6969

7070
npm
7171
<TerminalBlock>
72-
{`npm install --save-dev --save-exact babel-plugin-react-compiler@latest`}
72+
npm install --save-dev --save-exact babel-plugin-react-compiler@latest
7373
</TerminalBlock>
7474

7575
pnpm
7676
<TerminalBlock>
77-
{`pnpm add --save-dev --save-exact babel-plugin-react-compiler@latest`}
77+
pnpm add --save-dev --save-exact babel-plugin-react-compiler@latest
7878
</TerminalBlock>
7979

8080
yarn
8181
<TerminalBlock>
82-
{`yarn add --dev --exact babel-plugin-react-compiler@latest`}
82+
yarn add --dev --exact babel-plugin-react-compiler@latest
8383
</TerminalBlock>
8484

8585
この安定版リリースの一環として、React Compiler をプロジェクトに追加しやすくするための作業や、コンパイラがメモ化を行う方法に関しての最適化を行ってきました。React Compiler はオプショナルチェーンをサポートし、配列の添字を依存値として利用できるようになりました。これらの改善により、最終的な再レンダーが減少してよりレスポンシブな UI が実現される一方で、開発者が自然で宣言的なコードを書き続けることができます。
@@ -101,17 +101,17 @@ React Compiler には、[React のルール](/reference/rules)に違反したコ
101101

102102
npm
103103
<TerminalBlock>
104-
{`npm install --save-dev eslint-plugin-react-hooks@latest`}
104+
npm install --save-dev eslint-plugin-react-hooks@latest
105105
</TerminalBlock>
106106

107107
pnpm
108108
<TerminalBlock>
109-
{`pnpm add --save-dev eslint-plugin-react-hooks@latest`}
109+
pnpm add --save-dev eslint-plugin-react-hooks@latest
110110
</TerminalBlock>
111111

112112
yarn
113113
<TerminalBlock>
114-
{`yarn add --dev eslint-plugin-react-hooks@latest`}
114+
yarn add --dev eslint-plugin-react-hooks@latest
115115
</TerminalBlock>
116116

117117
```js {6}
@@ -153,19 +153,19 @@ Expo、Vite、Next.js のチームと提携し、新規アプリ作成時のフ
153153
[Expo SDK 54](https://docs.expo.dev/guides/react-compiler/) 以降では、デフォルトでコンパイラが有効になっているため、新しいアプリが最初から自動的にコンパイラを活用できるようになります。
154154

155155
<TerminalBlock>
156-
{`npx create-expo-app@latest`}
156+
npx create-expo-app@latest
157157
</TerminalBlock>
158158

159159
[Vite](https://vite.dev/guide/) および [Next.js](https://nextjs.org/docs/app/api-reference/cli/create-next-app) のユーザは、`create-vite` および `create-next-app` でコンパイラが有効化されたテンプレートを選択できます。
160160

161161
<TerminalBlock>
162-
{`npm create vite@latest`}
162+
npm create vite@latest
163163
</TerminalBlock>
164164

165165
<br />
166166

167167
<TerminalBlock>
168-
{`npx create-next-app@latest`}
168+
npx create-next-app@latest
169169
</TerminalBlock>
170170

171171
## React Compiler を段階的に採用する {/*adopt-react-compiler-incrementally*/}

src/content/learn/add-react-to-an-existing-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ title: 既存プロジェクトに React を追加する
2020

2121
以下の手順に従って設定することをお勧めします。
2222

23-
1. [React ベースのフレームワーク](/learn/start-a-new-react-project)のうちひとつを使い、アプリの **React 部分をビルド**します。
23+
1. [React ベースのフレームワーク](/learn/creating-a-react-app)のうちひとつを使い、アプリの **React 部分をビルド**します。
2424
2. フレームワークの設定で `/some-app`***base path* に指定**します(方法:[Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath)[Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/))。
2525
3. **サーバまたはプロキシを設定**して、`/some-app/` 以下のすべてのリクエストを React アプリで処理するようにします。
2626

@@ -149,7 +149,7 @@ root.render(<NavigationBar />);
149149

150150
`index.html` にあるオリジナルの HTML コンテンツはそのままに、自分の `NavigationBar` という React コンポーネントが、HTML の `<nav id="navigation">` 内に表示されるようになりました。React コンポーネントを既存の HTML ページの内部にレンダーする方法の詳細については、[`createRoot` 使用方法のドキュメント](/reference/react-dom/client/createRoot#rendering-a-page-partially-built-with-react) を参照してください。
151151

152-
既存のプロジェクトで React を使用する場合、まずはボタンのような小さなインタラクティブなコンポーネントから始め、その後、徐々に「上向きに」進んでいき、最終的にはページ全体が React で構築されるようにすることが一般的です。もしもそのような段階に到達した場合は、React の効果が最大限に得られるように、[React フレームワーク](/learn/start-a-new-react-project)に移行することをお勧めします。
152+
既存のプロジェクトで React を使用する場合、まずはボタンのような小さなインタラクティブなコンポーネントから始め、その後、徐々に「上向きに」進んでいき、最終的にはページ全体が React で構築されるようにすることが一般的です。もしもそのような段階に到達した場合は、React の効果が最大限に得られるように、[React フレームワーク](/learn/creating-a-react-app)に移行することをお勧めします。
153153

154154
## 既存のネイティブモバイルアプリ内で React Native を使用する {/*using-react-native-in-an-existing-native-mobile-app*/}
155155

src/content/learn/build-a-react-app-from-scratch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ React の始め方としてゼロからスタートするのは簡単ですが
3434
[Vite](https://vite.dev/) は、モダンなウェブプロジェクトのために素早くかつスリムな開発体験を提供することを目指したビルドツールです。
3535

3636
<TerminalBlock>
37-
{`npm create vite@latest my-app -- --template react-ts`}
37+
npm create vite@latest my-app -- --template react-ts
3838
</TerminalBlock>
3939

4040
Vite はデフォルトで適切な設定がされた、使い方に規約がある (opinionated) ツールです。Vite には、ファストリフレッシュ、JSX、Babel/SWC、その他の一般的な機能をサポートする豊富なプラグインのエコシステムがあります。Vite の [React プラグイン](https://vite.dev/plugins/#vitejs-plugin-react)[React SWC プラグイン](https://vite.dev/plugins/#vitejs-plugin-react-swc)[React SSR のサンプルプロジェクト](https://vite.dev/guide/ssr.html#example-projects) を参照して始めてみてください。
@@ -46,7 +46,7 @@ Vite は、[推奨フレームワーク](/learn/creating-a-react-app) のひと
4646
[Parcel](https://parceljs.org/) は、素晴らしい初期開発体験とスケーラブルなアーキテクチャの両方を備えており、プロジェクトを始めたばかりの状態から大規模な本番アプリケーションにまで成長させることができます。
4747

4848
<TerminalBlock>
49-
{`npm install --save-dev parcel`}
49+
npm install --save-dev parcel
5050
</TerminalBlock>
5151

5252
Parcel は、ファストリフレッシュ、JSX、TypeScript、Flow、スタイリングをデフォルトでサポートしています。[Parcel の React レシピ](https://parceljs.org/recipes/react/#getting-started)を参照して始めてみてください。
@@ -56,7 +56,7 @@ Parcel は、ファストリフレッシュ、JSX、TypeScript、Flow、スタ
5656
[Rsbuild](https://rsbuild.dev/) は、Rspack を基にしたビルドツールで、React アプリケーションのためのシームレスな開発体験を提供します。慎重に調整されたデフォルト設定とパフォーマンス最適化が最初から利用できます。
5757

5858
<TerminalBlock>
59-
{`npx create-rsbuild --template react`}
59+
npx create-rsbuild --template react
6060
</TerminalBlock>
6161

6262
Rsbuild には、ファストリフレッシュ、JSX、TypeScript、スタイリングなどの React 機能のサポートが組み込まれています。[Rsbuild の React ガイド](https://rsbuild.dev/guide/framework/react)を参照して始めてみてください。

src/content/learn/react-compiler/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default defineConfig({
114114
`vite-plugin-babel` をインストールし、コンパイラの Babel プラグインを追加します。
115115

116116
<TerminalBlock>
117-
{`npm install vite-plugin-babel`}
117+
npm install vite-plugin-babel
118118
</TerminalBlock>
119119

120120
```js {3-4,16}

0 commit comments

Comments
 (0)