Date: Tue, 22 Apr 2025 13:38:13 +0800
Subject: [PATCH 10/13] fix conflict
---
src/content/blog/index.md | 13 +---
src/content/learn/creating-a-react-app.md | 4 --
src/content/learn/react-compiler.md | 74 ++---------------------
src/content/versions.md | 11 +---
4 files changed, 9 insertions(+), 93 deletions(-)
diff --git a/src/content/blog/index.md b/src/content/blog/index.md
index ffb33ff378..5fc7160232 100644
--- a/src/content/blog/index.md
+++ b/src/content/blog/index.md
@@ -4,30 +4,21 @@ title: React Blog
-<<<<<<< HEAD
这个博客是 React 团队更新的官方来源。任何重要的内容,包括发布说明或弃用通知,都会首先在这里发布。
-=======
-This blog is the official source for the updates from the React team. Anything important, including release notes or deprecation notices, will be posted here first.
-
-You can also follow the [@react.dev](https://bsky.app/profile/react.dev) account on Bluesky, or [@reactjs](https://twitter.com/reactjs) account on Twitter, but you won’t miss anything essential if you only read this blog.
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
你也可以在 Bluesky 上关注 [@react.dev](https://bsky.app/profile/react.dev),或者在 Twitter 上关注 [@reactjs](https://twitter.com/reactjs)。不过只要你阅读这个博客,就不会错过任何重要内容。
-<<<<<<< HEAD
-
-=======
We are releasing the compiler's first Release Candidate (RC) today.
+我们今天将发布 React Compiler 的第一个候选发布版(RC)。
-
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
+
今日起,我们将正式弃用 Create React App 作为新应用的推荐工具,并建议现有应用迁移至框架或构建工具(如 Vite、Parcel 和 RSBuild)。我们还提供了相关文档用于这些情况:你的项目不适合使用框架、你想要构建自己的框架,或者只是想通过从零开始构建一个 React 应用来了解 React 的工作原理等等……
diff --git a/src/content/learn/creating-a-react-app.md b/src/content/learn/creating-a-react-app.md
index aa11dcaee9..759b3b69cf 100644
--- a/src/content/learn/creating-a-react-app.md
+++ b/src/content/learn/creating-a-react-app.md
@@ -106,11 +106,7 @@ Next.js 的 App Router 还集成了 [使用 Suspense 的数据获取](/blog/2022
从零开始可以给你更多的灵活性,但同时也要求你必须自己选择用于路由、数据获取以及其他常见使用模式的工具。这更像自己构建一个框架,而不是使用一个已经存在的框架。[我们推荐的框架](#full-stack-frameworks) 为这些问题提供了内置的解决方案。
-<<<<<<< HEAD
如果你想构建自己的解决方案,请参阅我们的 [从零构建一个 React 应用](/learn/build-a-react-app-from-scratch) 指南,该指南提供了如何使用 [Vite](https://vite.dev/), [Parcel](https://parceljs.org/),或 [RSbuild](https://rsbuild.dev/) 等构建工具设置新 React 项目的说明。
-=======
-If you want to build your own solutions, see our guide to [build a React app from Scratch](/learn/build-a-react-app-from-scratch) for instructions on how to set up a new React project starting with a build tool like [Vite](https://vite.dev/), [Parcel](https://parceljs.org/), or [RSbuild](https://rsbuild.dev/).
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
-----
diff --git a/src/content/learn/react-compiler.md b/src/content/learn/react-compiler.md
index 4f842eabbc..55c8e9ea50 100644
--- a/src/content/learn/react-compiler.md
+++ b/src/content/learn/react-compiler.md
@@ -6,13 +6,6 @@ title: React Compiler
本页面将为你介绍新的 React Compiler,以及如何成功试用。
-<<<<<<< HEAD
-
-这些文档仍在不断完善中。更多文档可在 [React Compiler 工作组代码库](https://github.com/reactwg/react-compiler/discussions) 中找到,并在这些文档更加稳定时被整合进来。
-
-
-=======
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
* 开始使用 React Compiler
@@ -22,10 +15,9 @@ title: React Compiler
-<<<<<<< HEAD
-React Compiler 是一个处于 Beta 阶段的新的编译器,我们将其开源以获取社区的早期反馈。虽然Meta 等公司已经在生产中使用它,但是能否在你的应用程序中使用它取决于代码库的健康状态以及你遵守 [React 规则](/reference/rules) 的程度。
+React Compiler 是一个处于 RC 阶段的新的编译器,我们将其开源以获取社区反馈。现在我们建议所有人都使用编译器。
-最新的 Beta 版本发布于 `@beta` 标签,每日实验版本发布于 `@experimental` 标签。
+最新的 RC 版本发布于 `@rc` 标签,每日实验版本发布于 `@experimental` 标签。
React Compiler 是一个新编译器,我们将其开源以获取社区的早期反馈。它是一个仅在构建时使用的工具,可以自动优化你的 React 应用程序。它可以与纯 JavaScript 一起使用,并且了解 [React 规则](/reference/rules),因此你无需重写任何代码即可使用它。
@@ -34,18 +26,6 @@ React Compiler 是一个新编译器,我们将其开源以获取社区的早
编译器还包括一个 [ESLint 插件](#installing-eslint-plugin-react-compiler),可以在你的编辑器中直接显示编译器的分析结果。**我们强烈建议大家使用 linter。** 不过 linter 并不需要安装编译器,因此即使你还没有准备好尝试编译器也可以使用它。
编译器目前处于 `beta` 阶段,并且可以在 React 17+ 应用程序和库上使用。安装方式如下:
-=======
-React Compiler is a new compiler currently in RC, that we've open sourced to get feedback from the community. We now recommend everyone to try the compiler and provide feedback.
-
-The latest RC release can be found with the `@rc` tag, and daily experimental releases with `@experimental`.
-
-
-React Compiler is a new compiler that we've open sourced to get feedback from the community. It is a build-time only tool that automatically optimizes your React app. It works with plain JavaScript, and understands the [Rules of React](/reference/rules), so you don't need to rewrite any code to use it.
-
-eslint-plugin-react-hooks also includes an [ESLint rule](#installing-eslint-plugin-react-compiler) that surfaces the analysis from the compiler right in your editor. **We strongly recommend everyone use the linter today.** The linter does not require that you have the compiler installed, so you can use it even if you are not ready to try out the compiler.
-
-The compiler is currently released as `rc`, and is available to try out on React 17+ apps and libraries. To install the RC:
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
{`npm install -D babel-plugin-react-compiler@rc eslint-plugin-react-hooks@^6.0.0-rc.1`}
@@ -133,11 +113,7 @@ function TableContainer({ items }) {
### 我应该尝试一下编译器吗? {/*should-i-try-out-the-compiler*/}
-<<<<<<< HEAD
-请注意,编译器仍处于 Beta 阶段,存在许多不完善之处。虽然它已经在 Meta 等公司的生产环境中使用过,但将编译器应用于你的应用程序生产环境将取决于你的代码库的健康状况以及你是否遵循了 [React 的规则](/reference/rules)。
-=======
-The compiler is now in RC and has been tested extensively in production. While it has been used in production at companies like Meta, rolling out the compiler to production for your app will depend on the health of your codebase and how well you've followed the [Rules of React](/reference/rules).
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
+请注意,编译器处于 RC 阶段,并已在生产中进行了广泛测试。虽然它已经在 Meta 等公司的生产环境中使用过,但将编译器应用于你的应用程序生产环境将取决于你的代码库的健康状况以及你是否遵循了 [React 的规则](/reference/rules)。
**你现在不必急着使用编译器。在采用它之前等到它达到稳定版本是可以的。** 然而,我们确实赞赏在你的应用程序中进行小型实验,以便你可以向我们 [提供反馈](#reporting-issues),帮助使编译器更好。
@@ -145,53 +121,15 @@ The compiler is now in RC and has been tested extensively in production. While i
除了这些文档之外,我们还建议查看 [React Compiler 工作组](https://github.com/reactwg/react-compiler),以获取有关编译器的更多信息和讨论。
-<<<<<<< HEAD
-### 安装 eslint-plugin-react-compiler {/*installing-eslint-plugin-react-compiler*/}
-
-React Compiler 还为 ESLint 插件提供支持。ESLint 插件可以**独立**于编译器使用,这意味着即使你不使用编译器,也可以使用 ESLint 插件。
-=======
-### Installing eslint-plugin-react-hooks {/*installing-eslint-plugin-react-compiler*/}
+### 安装 eslint-plugin-react-hooks {/*installing-eslint-plugin-react-compiler*/}
-React Compiler also powers an ESLint plugin. You can try it out by installing eslint-plugin-react-hooks@^6.0.0-rc.1.
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
+React Compiler 还支持作为 ESLint 插件。你可以通过安装 eslint-plugin-react-hooks@^6.0.0-rc.1 来使用它。
{`npm install -D eslint-plugin-react-hooks@^6.0.0-rc.1`}
-<<<<<<< HEAD
-然后,将其添加到你的 ESLint 配置中:
-
-```js
-import reactCompiler from 'eslint-plugin-react-compiler'
-
-export default [
- {
- plugins: {
- 'react-compiler': reactCompiler,
- },
- rules: {
- 'react-compiler/react-compiler': 'error',
- },
- },
-]
-```
-
-或者使用已弃用的 eslintrc 配置格式:
-
-```js
-module.exports = {
- plugins: [
- 'eslint-plugin-react-compiler',
- ],
- rules: {
- 'react-compiler/react-compiler': 'error',
- },
-}
-```
-=======
-See our [editor setup](/learn/editor-setup#linting) guide for more details.
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
+查看 [编辑器设置](/learn/editor-setup#linting) 指南来了解更多信息。
ESLint 插件将在编辑器中显示任何违反 React 规则的行为。当它这样做时,这意味着编译器跳过了优化该组件或钩子。这是完全可以的,编译器可以恢复并继续优化代码库中的其他组件。
diff --git a/src/content/versions.md b/src/content/versions.md
index a45e206b7b..a1fd732b5b 100644
--- a/src/content/versions.md
+++ b/src/content/versions.md
@@ -10,13 +10,8 @@ React 文档位于 [react.dev](https://react.dev),提供最新版本 React 的
我们致力于在主要版本内保持文档的更新,并不会为每个次要版本或补丁版本发布单独的文档版本。当一个新的主要版本发布时,我们会将前一个版本的文档存档为 `x.react.dev`。有关更多信息,请参阅我们的[版本控制政策](/community/versioning-policy)。
-<<<<<<< HEAD
你可以在下方找到以前主要版本的存档。
-## 最新版本:19.0 {/*latest-version*/}
-=======
-You can find an archive of previous major versions below.
-## Latest version: 19.1 {/*latest-version*/}
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
+## 最新版本:19.1 {/*latest-version*/}
- [react.dev](https://react.dev) {/*docs-19*/}
@@ -55,12 +50,8 @@ You can find an archive of previous major versions below.
- [React Compiler Case Studies](https://www.youtube.com/watch?v=lvhPq5chokM)
- [React 19 Deep Dive: Coordinating HTML](https://www.youtube.com/watch?v=IBBN-s77YSI)
-<<<<<<< HEAD
**发布版本**
-=======
-**Releases**
- [v19.1.0 (March, 2025)](https://github.com/facebook/react/blob/main/CHANGELOG.md#1910-march-28-2025)
->>>>>>> 740016e4dea7e518bd045309bc3e828cc2a787a4
- [v19.0.0 (December, 2024)](https://github.com/facebook/react/blob/main/CHANGELOG.md#1900-december-5-2024)
### React 18 {/*react-18*/}
From 43af5bd4ab481be234aa9c5c9ab166d85deb0623 Mon Sep 17 00:00:00 2001
From: Xleine
Date: Tue, 22 Apr 2025 13:40:17 +0800
Subject: [PATCH 11/13] Update src/content/blog/index.md
---
src/content/blog/index.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/content/blog/index.md b/src/content/blog/index.md
index 5fc7160232..edde294551 100644
--- a/src/content/blog/index.md
+++ b/src/content/blog/index.md
@@ -13,7 +13,6 @@ title: React Blog
-We are releasing the compiler's first Release Candidate (RC) today.
我们今天将发布 React Compiler 的第一个候选发布版(RC)。
From 304fa8ab1e6939f14115d3a7f505f6f4dba333f8 Mon Sep 17 00:00:00 2001
From: Xleine
Date: Tue, 22 Apr 2025 13:42:49 +0800
Subject: [PATCH 12/13] Update
src/content/blog/2024/10/21/react-compiler-beta-release.md
---
src/content/blog/2024/10/21/react-compiler-beta-release.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content/blog/2024/10/21/react-compiler-beta-release.md b/src/content/blog/2024/10/21/react-compiler-beta-release.md
index a50120e922..2a71f6e64a 100644
--- a/src/content/blog/2024/10/21/react-compiler-beta-release.md
+++ b/src/content/blog/2024/10/21/react-compiler-beta-release.md
@@ -14,7 +14,7 @@ October 21, 2024 by [Lauren Tan](https://twitter.com/potetotes).
### React Compiler is now in RC! {/*react-compiler-is-now-in-rc*/}
-Please see the [RC blog post](/blog/2025/04/21/react-compiler-rc) for details.
+有关详细信息,请参阅 [RC 博客文章](/blog/2025/04/21/react-compiler-rc)。
From 66a166a6848541fc03393c531ac8eb7f5ca2c383 Mon Sep 17 00:00:00 2001
From: Xleine
Date: Tue, 22 Apr 2025 13:43:42 +0800
Subject: [PATCH 13/13] Update
src/content/blog/2024/10/21/react-compiler-beta-release.md
---
src/content/blog/2024/10/21/react-compiler-beta-release.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content/blog/2024/10/21/react-compiler-beta-release.md b/src/content/blog/2024/10/21/react-compiler-beta-release.md
index 2a71f6e64a..04f77ab3ae 100644
--- a/src/content/blog/2024/10/21/react-compiler-beta-release.md
+++ b/src/content/blog/2024/10/21/react-compiler-beta-release.md
@@ -12,7 +12,7 @@ October 21, 2024 by [Lauren Tan](https://twitter.com/potetotes).
-### React Compiler is now in RC! {/*react-compiler-is-now-in-rc*/}
+### React Compiler 现在处于 RC 版本!{/*react-compiler-is-now-in-rc*/}
有关详细信息,请参阅 [RC 博客文章](/blog/2025/04/21/react-compiler-rc)。