Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cn): translate blog/2021/06/08/the-plan-for-react-18 into Chinese #1246

Merged
merged 3 commits into from
Jul 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions src/content/blog/2021/06/08/the-plan-for-react-18.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
---
title: "The Plan for React 18"
title: "React 18 发布计划"
---

June 8, 2021 by [Andrew Clark](https://twitter.com/acdlite), [Brian Vaughn](https://github.com/bvaughn), [Christine Abernathy](https://twitter.com/abernathyca), [Dan Abramov](https://twitter.com/dan_abramov), [Rachel Nabors](https://twitter.com/rachelnabors), [Rick Hanlon](https://twitter.com/rickhanlonii), [Sebastian Markbåge](https://twitter.com/sebmarkbage), and [Seth Webster](https://twitter.com/sethwebster)
2021 年 7 月 8 日 2021,由 [Andrew Clark](https://twitter.com/acdlite)[Brian Vaughn](https://github.com/bvaughn)[Christine Abernathy](https://twitter.com/abernathyca)[Dan Abramov](https://twitter.com/dan_abramov)[Rachel Nabors](https://twitter.com/rachelnabors)[Rick Hanlon](https://twitter.com/rickhanlonii)[Sebastian Markbåge](https://twitter.com/sebmarkbage) [Seth Webster](https://twitter.com/sethwebster) 发布。

---

<Intro>

The React team is excited to share a few updates:
React 团队很高兴分享一些更新:

1. We’ve started work on the React 18 release, which will be our next major version.
2. We’ve created a Working Group to prepare the community for gradual adoption of new features in React 18.
3. We’ve published a React 18 Alpha so that library authors can try it and provide feedback.
1. 我们已经开始推进 React 18 的更新,也正是我们的下一个主要版本。
2. 我们已经创建了一些工作组,筹备 React 18 新功能在社区内逐步推广的相关工作。
3. 我们已经发布了一个 React 18 Alpha 版本,以便于一些库的作者们能够测试并反馈。

These updates are primarily aimed at maintainers of third-party libraries. If you’re learning, teaching, or using React to build user-facing applications, you can safely ignore this post. But you are welcome to follow the discussions in the React 18 Working Group if you're curious!
这些更新主要针对于第三方库的维护者们。如果你正在学习,教授或者使用 React 来构建面向用户的应用程序,你可以忽略这篇文章。但是如果你对此感到好奇,我们也非常欢迎你关注 React 18 工作组中的讨论。

---

</Intro>

## What’s coming in React 18 {/*whats-coming-in-react-18*/}
## React 18 带来了什么 {/*whats-coming-in-react-18*/}

When it’s released, React 18 will include out-of-the-box improvements (like [automatic batching](https://github.com/reactwg/react-18/discussions/21)), new APIs (like [`startTransition`](https://github.com/reactwg/react-18/discussions/41)), and a [new streaming server renderer](https://github.com/reactwg/react-18/discussions/37) with built-in support for `React.lazy`.
React 18 发布时,它将会有更好的开箱即用能力(如 [自动批处理](https://github.com/reactwg/react-18/discussions/21)),全新的 API(如 [`startTransition`](https://github.com/reactwg/react-18/discussions/41)),以及支持 `React.lazy` 的 [全新的流式服务端渲染](https://github.com/reactwg/react-18/discussions/37)

These features are possible thanks to a new opt-in mechanism we’re adding in React 18. It’s called “concurrent rendering” and it lets React prepare multiple versions of the UI at the same time. This change is mostly behind-the-scenes, but it unlocks new possibilities to improve both real and perceived performance of your app.
这些功能之所以能够实现,要归功于我们在 React 18 中新加入的可选择性启用的机制,“并发渲染”,并且它使得 React 可以同时准备多个版本的 UI。这些大部分都是对底层的改动,但是也为你的应用程序提高其真实性能和用户感知性能创造了新的可能性,

If you've been following our research into the future of React (we don't expect you to!), you might have heard of something called “concurrent mode” or that it might break your app. In response to this feedback from the community, we’ve redesigned the upgrade strategy for gradual adoption. Instead of an all-or-nothing “mode”, concurrent rendering will only be enabled for updates triggered by one of the new features. In practice, this means **you will be able to adopt React 18 without rewrites and try the new features at your own pace.**
如果你一直在关注我们对 React 的未来的研究(我们并不希望你这么做!),你可能已经听说过“并发模式”,或许还听说过它可能会对你的应用程序造成破坏性变更。为了回应社区对此的反馈,我们已经重新设计了渐进式的升级策略。相比于之前要么不升级,要么全部升级这样一刀切的方式,现在的只有被并发渲染相关的新功能触发的更新才会启用并发渲染。这对于工程实践的意义是,**你无需重写代码即可直接使用 React 18,并且可以根据自己的节奏和需求来尝试新特性**。

## A gradual adoption strategy {/*a-gradual-adoption-strategy*/}
## 渐进式应用策略 {/*a-gradual-adoption-strategy*/}

Since concurrency in React 18 is opt-in, there are no significant out-of-the-box breaking changes to component behavior. **You can upgrade to React 18 with minimal or no changes to your application code, with a level of effort comparable to a typical major React release**. Based on our experience converting several apps to React 18, we expect that many users will be able to upgrade within a single afternoon.
由于并发机制在 React 18 中是一个可选功能,没有对组件行为造成明显的破坏性变更。**你几乎不需要对应用程序中的代码进行任何改动,就可以直接升级到 React 18,这比以往的 React 版本升级要容易许多**。根据我们自己将几个应用程序升级到 React 18 的经验来看,预计大多数用户能在一个下午的时间内完成升级工作。

We successfully shipped concurrent features to tens of thousands of components at Facebook, and in our experience, we've found that most React components “just work” without additional changes. We're committed to making sure this is a smooth upgrade for the entire community, so today we're announcing the React 18 Working Group.
我们在 Facebook 上成功地将并发功能赋予给了数以万计的组件,并且以我们的实践经验来看,大部分的 React 组件无需任何改动就能正常工作。今天我们成立了 React 18 工作组,我们将致力于保证整个社区都能顺利升级。

## Working with the community {/*working-with-the-community*/}
## 与社区合作 {/*working-with-the-community*/}

We’re trying something new for this release: We've invited a panel of experts, developers, library authors, and educators from across the React community to participate in our [React 18 Working Group](https://github.com/reactwg/react-18) to provide feedback, ask questions, and collaborate on the release. We couldn't invite everyone we wanted to this initial, small group, but if this experiment works out, we hope there will be more in the future!
在这次更新中,我们正在尝试一些新的可能:我们邀请了 React 社区的专家、开发者、库的作者以及教育者参与我们的 [React 18 工作组](https://github.com/reactwg/react-18),以提供反馈,咨询问题以及参与版本更新。我们没有没办法将所有人都邀请到这个刚建立的小群体,但是如果这次试验成功的话,我们也期待更多人的加入。

**The goal of the React 18 Working Group is to prepare the ecosystem for a smooth, gradual adoption of React 18 by existing applications and libraries.** The Working Group is hosted on [GitHub Discussions](https://github.com/reactwg/react-18/discussions) and is available for the public to read. Members of the working group can leave feedback, ask questions, and share ideas. The core team will also use the discussions repo to share our research findings. As the stable release gets closer, any important information will also be posted on this blog.
**React 18 工作组的目标是为生态做好准备,使现有的应用程序和库能够顺利、渐进地采用 React 18**。该工作组被托管在 [Github 讨论区](https://github.com/reactwg/react-18/discussions) 以供公众阅读。工作组的成员也可以留下反馈,咨询问题以及分享想法。核心团队也将会使用这个代码仓库的讨论区来分享我们的研发成果。在新版本变得越来越稳定的同时,所有重要信息都会在博客上发布。
Yucohny marked this conversation as resolved.
Show resolved Hide resolved

For more information on upgrading to React 18, or additional resources about the release, see the [React 18 announcement post](https://github.com/reactwg/react-18/discussions/4).
想要了解关于升级到 React 18 的更多信息,或者关于该版本的其他资源,请参阅 [React 18 公告](https://github.com/reactwg/react-18/discussions/4)

## Accessing the React 18 Working Group {/*accessing-the-react-18-working-group*/}
## 访问 React 18 工作组 {/*accessing-the-react-18-working-group*/}

Everyone can read the discussions in the [React 18 Working Group repo](https://github.com/reactwg/react-18).
每个人都可以阅读在 [React 18 工作组代码仓库](https://github.com/reactwg/react-18) 中的讨论信息。

Because we expect an initial surge of interest in the Working Group, only invited members will be allowed to create or comment on threads. However, the threads are fully visible to the public, so everyone has access to the same information. We believe this is a good compromise between creating a productive environment for working group members, while maintaining transparency with the wider community.
我们预计对工作组感兴趣的人数会激增,所以目前只允许被邀请的成员可以创建或评论主题。不过,这些过程是完全公开的,所以每个人都能得到一致的信息。我们相信这是一个很好的折衷方案,既能为工作组的成员创造一个利于工作的环境,又能保持对广大社区的开放性。

As always, you can submit bug reports, questions, and general feedback to our [issue tracker](https://github.com/facebook/react/issues).
和从前一样,你仍然可以在我们的 [issue](https://github.com/facebook/react/issues) 中发布错误报告、疑难问题和反馈等信息。

## How to try React 18 Alpha today {/*how-to-try-react-18-alpha-today*/}
## 如何体验 React 18 alpha {/*how-to-try-react-18-alpha-today*/}

New alphas are [regularly published to npm using the `@alpha` tag](https://github.com/reactwg/react-18/discussions/9). These releases are built using the most recent commit to our main repo. When a feature or bugfix is merged, it will appear in an alpha the following weekday.
新的 alpha 版本是 [将 `@alpha` 标签定期发布到 npm 中](https://github.com/reactwg/react-18/discussions/9)。这些版本是由我们仓库主分支上最新的提交内容构建的。当一个新功能或者漏洞补丁被合并到主分支时,这些内容将在下一个工作日中出现在 alpha 版本中。

There may be significant behavioral or API changes between alpha releases. Please remember that **alpha releases are not recommended for user-facing, production applications**.
在 alpha 版本之间可能会有重大的行为逻辑或者 API 的变动。请谨记,**alpha 版本不建议在面向用户的生产环境应用中使用**。

## Projected React 18 release timeline {/*projected-react-18-release-timeline*/}
## React 18 的预计发布时间 {/*projected-react-18-release-timeline*/}

We don't have a specific release date scheduled, but we expect it will take several months of feedback and iteration before React 18 is ready for most production applications.
我们没有明确的版本更新排期,但是我们预计在 React 18 可以满足大部分的生产环境应用之前,需要几个月的时间来收集反馈和迭代更新。

* Library Alpha: Available today
* Public Beta: At least several months
* Release Candidate (RC): At least several weeks after Beta
* General Availability: At least several weeks after RC
* 库的 Alpha 版本:今天可用
* 公开的 Beta 版:至少几个月
* RC 版本:至少在 Beta 版发布后的几周
* 正式版:至少在 RC 版本发布之后的几周

More details about our projected release timeline are [available in the Working Group](https://github.com/reactwg/react-18/discussions/9). We'll post updates on this blog when we're closer to a public release.
关于发布任务排期的更多细节都在 [走近工作组](https://github.com/reactwg/react-18/discussions/9)。当临近公开发布时,我们会在这个博客上发布更新。