Skip to content

Commit 56b59b6

Browse files
Merge branch 'main' into pr/1670
2 parents 266dfd6 + 7b1b3fc commit 56b59b6

18 files changed

+236
-221
lines changed

src/content/blog/2024/04/25/react-19-upgrade-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To help make the upgrade to React 19 easier, we've published a `react@18.3` rele
2424

2525
We recommend upgrading to React 18.3 first to help identify any issues before upgrading to React 19.
2626

27-
For a list of changes in 18.3 see the [Release Notes](https://github.com/facebook/react/blob/main/CHANGELOG.md).
27+
For a list of changes in 18.3 see the [Release Notes](https://github.com/facebook/react/blob/main/CHANGELOG.md#1830-april-25-2024).
2828

2929
</Note>
3030

@@ -113,7 +113,7 @@ This will run the following codemods from `react-codemod`:
113113
- [`replace-string-ref`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-string-ref)
114114
- [`replace-act-import`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-act-import)
115115
- [`replace-use-form-state`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-use-form-state)
116-
- [`prop-types-typescript`](https://codemod.com/registry/react-prop-types-typescript)
116+
- [`prop-types-typescript`](https://github.com/reactjs/react-codemod#react-proptypes-to-prop-types)
117117

118118
This does not include the TypeScript changes. See [TypeScript changes](#typescript-changes) below.
119119

src/content/blog/2025/02/14/sunsetting-create-react-app.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "逐步淘汰 Create React App"
33
author: Matt Carroll 和 Ricky Hanlon
44
date: 2025/02/14
5-
description: 今天,我们不再推荐在新应用中使用 Create React App,并鼓励现有应用迁移到框架。当框架不适合你的项目,或者你更倾向于从构建一个框架开始时,我们还提供了文档。
5+
description: Today, we’re deprecating Create React App for new apps, and encouraging existing apps to migrate to a framework, or to migrate to a build tool like Vite, Parcel, or RSBuild. We’re also providing docs for when a framework isn’t a good fit for your project, you want to build your own framework, or you just want to learn how React works by building a React app from scratch.
66
---
77

88
2025 年 2 月 14 日,作者:[Matt Carroll](https://twitter.com/mattcarrollcode)[Ricky Hanlon](https://bsky.app/profile/ricky.fm)
@@ -11,7 +11,9 @@ description: 今天,我们不再推荐在新应用中使用 Create React App
1111

1212
<Intro>
1313

14-
今天,我们不再推荐在新应用中使用 [Create React App](https://create-react-app.dev/),并鼓励现有应用迁移到 [框架](/learn/creating-a-react-app)。当框架不适合你的项目,或者你更倾向于从 [构建一个框架](/learn/building-a-react-framework)开始时,我们还提供了文档。
14+
Today, we’re deprecating [Create React App](https://create-react-app.dev/) for new apps, and encouraging existing apps to migrate to a [framework](#how-to-migrate-to-a-framework), or to [migrate to a build tool](#how-to-migrate-to-a-build-tool) like Vite, Parcel, or RSBuild.
15+
16+
We’re also providing docs for when a framework isn’t a good fit for your project, you want to build your own framework, or you just want to learn how React works by [building a React app from scratch](/learn/build-a-react-app-from-scratch).
1517

1618
</Intro>
1719

@@ -27,7 +29,7 @@ Create React App 通过将多个工具整合到一个推荐的配置中,解决
2729

2830
## 弃用 Create React App {/*deprecating-create-react-app*/}
2931

30-
尽管 Create React App 可以轻松上手,但仍存在 [一些限制](#limitations-of-create-react-app),这些限制使得构建高性能的生产应用程序变得困难。原则上,我们可以通过将其逐步发展成一个 [框架](#why-we-recommend-frameworks) 来解决这些问题。
32+
Although Create React App makes it easy to get started, [there are several limitations](#limitations-of-build-tools) that make it difficult to build high performant production apps. In principle, we could solve these problems by essentially evolving it into a [framework](#why-we-recommend-frameworks).
3133

3234
然而,由于 Create React App 目前没有活跃的维护者,并且已经有许多现有的框架能够解决这些问题,我们决定弃用 Create React App。
3335

@@ -46,35 +48,44 @@ This error message will only be shown once per install.
4648
</ConsoleLogLine>
4749
</ConsoleBlockMulti>
4850

49-
我们推荐使用框架来 [创建新的 React 应用程序](/learn/creating-a-react-app)。我们推荐的所有框架都支持仅客户端的单页应用(SPA),并且可以在没有服务器的情况下部署到 CDN 或静态托管服务。
51+
We've also added a deprecation notice to the Create React App [website](https://create-react-app.dev/) and GitHub [repo](https://github.com/facebook/create-react-app). Create React App will continue working in maintenance mode, and we've published a new version of Create React App to work with React 19.
52+
53+
## How to Migrate to a Framework {/*how-to-migrate-to-a-framework*/}
54+
We recommend [creating new React apps](/learn/creating-a-react-app) with a framework. All the frameworks we recommend support client-side rendering ([CSR](https://developer.mozilla.org/en-US/docs/Glossary/CSR)) and single-page apps ([SPA](https://developer.mozilla.org/en-US/docs/Glossary/SPA)), and can be deployed to a CDN or static hosting service without a server.
5055

5156
对于现有的应用程序,这些指南将帮助你迁移到仅客户端的单页应用(SPA):
5257

5358
* [Next.js 的 Create React App 迁移指南](https://nextjs.org/docs/app/building-your-application/upgrading/from-create-react-app)
5459
* [React Router 的框架适配指南](https://reactrouter.com/upgrading/component-routes).
5560
* [Expo webpack 到 Expo Router 的迁移指南](https://docs.expo.dev/router/migrate/from-expo-webpack/)
5661

57-
Create React App 将继续以维护模式运行,并且我们已经发布了一个新版本的 Create React App 以支持 React 19。
62+
## How to Migrate to a Build Tool {/*how-to-migrate-to-a-build-tool*/}
5863

5964
如果你的应用程序有特殊的限制,或者你更喜欢通过构建自己的框架来解决这些问题,或者你只是想从头学习 React 的工作原理,你可以使用 Vite、Parcel 或 Rsbuild 来定制自己的 React 设置。
6065

61-
为了帮助用户开始使用 Vite、Parcel 或 Rsbuild,我们发布了新的文档,介绍如何 [构建一个框架](/learn/building-a-react-framework)。继续阅读以了解更多关于 [Create React App 的限制](#limitations-of-create-react-app),以及 [为什么我们推荐使用框架](#why-we-recommend-frameworks)
66+
For existing apps, these guides will help you migrate to a build tool:
6267

63-
<Note>
68+
* [Vite Create React App migration guide](https://www.robinwieruch.de/vite-create-react-app/)
69+
* [Parcel Create React App migration guide](https://stackoverflow.com/a/49605484)
70+
* [Rsbuild Create React App migration guide](https://rsbuild.dev/guide/migration/cra)
71+
72+
To help get started with Vite, Parcel or Rsbuild, we've added new docs for [Building a React App from Scratch](/learn/build-a-react-app-from-scratch).
6473

65-
#### 你推荐 Vite 吗? {/*do-you-recommend-vite*/}
74+
<DeepDive>
6675

67-
我们提供了几个基于 Vite 的建议。
76+
#### Do I need a framework? {/*do-i-need-a-framework*/}
6877

69-
React Router v7 是一个基于 Vite 的框架,它能让你在一个具备路由和数据获取功能的框架中,使用 Vite 快速的开发服务器和构建工具。就像我们推荐的其他框架一样,你可以使用 React Router v7 构建单页应用(SPA)。
78+
Most apps would benefit from a framework, but there are valid cases to build a React app from scratch. A good rule of thumb is if your app needs routing, you would probably benefit from a framework.
7079

71-
我们也推荐在 [React 添加到现有项目](/learn/add-react-to-an-existing-project)[构建一个框架](/learn/building-a-react-framework) 时使用 Vite。
80+
Just like Svelte has Sveltekit, Vue has Nuxt, and Solid has SolidStart, [React recommends using a framework](#why-we-recommend-frameworks) that fully integrates routing into features like data-fetching and code-splitting out of the box. This avoids the pain of needing to write your own complex configurations and essentially build a framework yourself.
7281

73-
就像 Svelte 有 SvelteKit、Vue 有 Nuxt、Solid 有 SolidStart 一样,对于新项目,React 建议使用能与 Vite 这类构建工具集成的框架。
82+
However, you can always [build a React app from scratch](/learn/build-a-react-app-from-scratch) using a build tool like Vite, Parcel, or Rsbuild.
7483

75-
</Note>
84+
</DeepDive>
85+
86+
Continue reading to learn more about the [limitations of build tools](#limitations-of-build-tools) and [why we recommend frameworks](#why-we-recommend-frameworks).
7687

77-
## Create React App 的局限性 {/*limitations-of-create-react-app*/}
88+
## Limitations of Build Tools {/*limitations-of-build-tools*/}
7889

7990
Create React App 及类似的构建工具使得开始构建 React 应用程序变得非常容易。运行 `npx create-react-app my-app` 后,你会得到一个完全配置好的 React 应用程序,包括开发服务器、代码检查和生产构建。
8091

src/content/blog/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ title: React Blog
1313

1414
<BlogCard title="Sunsetting Create React App" date="February 13, 2025" url="/blog/2025/02/14/sunsetting-create-react-app">
1515

16-
Today, we’re deprecating Create React App for new apps, and encouraging existing apps to migrate to a framework. We’re also providing docs for when a framework isn’t a good fit for your project, or you prefer to start by building a framework.
16+
Today, we’re deprecating Create React App for new apps, and encouraging existing apps to migrate to a framework, or to migrate to a build tool like Vite, Parcel, or RSBuild. We’re also providing docs for when a framework isn’t a good fit for your project, you want to build your own framework, or you just want to learn how React works by building a React app from scratch ...
1717

1818
</BlogCard>
1919

0 commit comments

Comments
 (0)