Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
awxiaoxian2020 committed May 2, 2024
1 parent a770dcc commit 989f6b9
Show file tree
Hide file tree
Showing 31 changed files with 44 additions and 406 deletions.
6 changes: 1 addition & 5 deletions src/components/Layout/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ export function Page({
image={`/images/og-` + section + '.png'}
searchOrder={searchOrder}
/>
<<<<<<< HEAD
{/* <SocialBanner /> */}
=======
{(isHomePage || isBlogIndex) && (
<Head>
<link
Expand All @@ -144,8 +141,7 @@ export function Page({
/>
</Head>
)}
<SocialBanner />
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
{/* <SocialBanner /> */}
<TopNav
section={section}
routeTree={routeTree}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "介绍零打包大小的 React 服务器组件"
=======
title: "Introducing Zero-Bundle-Size React Server Components"
author: Dan Abramov, Lauren Tan, Joseph Savona, and Sebastian Markbage
date: 2020/12/21
description: 2020 has been a long year. As it comes to an end we wanted to share a special Holiday Update on our research into zero-bundle-size React Server Components.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2020 年 12 月 21 日 [Dan Abramov](https://twitter.com/dan_abramov)[Lauren Tan](https://twitter.com/potetotes)[Joseph Savona](https://twitter.com/en_JS)[Sebastian Markbåge](https://twitter.com/sebmarkbage)
Expand Down
4 changes: 0 additions & 4 deletions src/content/blog/2021/06/08/the-plan-for-react-18.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "React 18 发布计划"
=======
title: "The Plan for React 18"
author: Andrew Clark, Brian Vaughn, Christine Abernathy, Dan Abramov, Rachel Nabors, Rick Hanlon, Sebastian Markbage, and Seth Webster
date: 2021/06/08
description: The React team is excited to share a few updates. We’ve started work on the React 18 release, which will be our next major version. We’ve created a Working Group to prepare the community for gradual adoption of new features in React 18. We’ve published a React 18 Alpha so that library authors can try it and provide feedback...
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2021 年 7 月 8 日 [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)
Expand Down
4 changes: 0 additions & 4 deletions src/content/blog/2021/12/17/react-conf-2021-recap.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "回顾 React Conf 2021"
=======
title: "React Conf 2021 Recap"
author: Jesslyn Tannady and Rick Hanlon
date: 2021/12/17
description: Last week we hosted our 6th React Conf. In previous years, we've used the React Conf stage to deliver industry changing announcements such as React Native and React Hooks. This year, we shared our multi-platform vision for React, starting with the release of React 18 and gradual adoption of concurrent features.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2021 年 12 月 17 日 [Jesslyn Tannady](https://twitter.com/jtannady)[Rick Hanlon](https://twitter.com/rickhanlonii)
Expand Down
4 changes: 0 additions & 4 deletions src/content/blog/2022/03/08/react-18-upgrade-guide.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "如何升级到 React 18"
=======
title: "How to Upgrade to React 18"
author: Rick Hanlon
date: 2022/03/08
description: As we shared in the release post, React 18 introduces features powered by our new concurrent renderer, with a gradual adoption strategy for existing applications. In this post, we will guide you through the steps for upgrading to React 18.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2022 年 8 月 3 日 [Rick Hanlon](https://twitter.com/rickhanlonii)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "React Labs:我们正在努力的方向——2022 年 6 月"
=======
title: "React Labs: What We've Been Working On – June 2022"
author: Andrew Clark, Dan Abramov, Jan Kassens, Joseph Savona, Josh Story, Lauren Tan, Luna Ruan, Mengdi Chen, Rick Hanlon, Robert Zhang, Sathya Gunasekaran, Sebastian Markbage, and Xuan Huang
date: 2022/06/15
description: React 18 was years in the making, and with it brought valuable lessons for the React team. Its release was the result of many years of research and exploring many paths. Some of those paths were successful; many more were dead-ends that led to new insights. One lesson we’ve learned is that it’s frustrating for the community to wait for new features without having insight into these paths that we’re exploring.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2022 年 6 月 15 日 [Andrew Clark](https://twitter.com/acdlite)[Dan Abramov](https://twitter.com/dan_abramov)[Jan Kassens](https://twitter.com/kassens)[Joseph Savona](https://twitter.com/en_JS)[Josh Story](https://twitter.com/joshcstory)[Lauren Tan](https://twitter.com/potetotes)[Luna Ruan](https://twitter.com/lunaruan)[Mengdi Chen](https://twitter.com/mengdi_en)[Rick Hanlon](https://twitter.com/rickhanlonii)[Robert Zhang](https://twitter.com/jiaxuanzhang01)[Sathya Gunasekaran](https://twitter.com/_gsathya)[Sebastian Markbåge](https://twitter.com/sebmarkbage)[Xuan Huang](https://twitter.com/Huxpro)
Expand Down
4 changes: 0 additions & 4 deletions src/content/blog/2023/03/16/introducing-react-dev.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "介绍 react.dev"
=======
title: "Introducing react.dev"
author: Dan Abramov and Rachel Nabors
date: 2023/03/16
description: Today we are thrilled to launch react.dev, the new home for React and its documentation. In this post, we would like to give you a tour of the new site.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2023 年 3 月 16 日 [Dan Abramov](https://twitter.com/dan_abramov)[Rachel Nabors](https://twitter.com/rachelnabors)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "React Labs:我们正在努力的方向——2023 年 3 月"
=======
title: "React Labs: What We've Been Working On – March 2023"
author: Joseph Savona, Josh Story, Lauren Tan, Mengdi Chen, Samuel Susla, Sathya Gunasekaran, Sebastian Markbage, and Andrew Clark
date: 2023/03/22
description: In React Labs posts, we write about projects in active research and development. We've made significant progress on them since our last update, and we'd like to share what we learned.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2023 年 3 月 22 日 [Joseph Savona](https://twitter.com/en_JS)[Josh Story](https://twitter.com/joshcstory)[Lauren Tan](https://twitter.com/potetotes)[Mengdi Chen](https://twitter.com/mengdi_en)[Samuel Susla](https://twitter.com/SamuelSusla)[Sathya Gunasekaran](https://twitter.com/_gsathya)[Sebastian Markbåge](https://twitter.com/sebmarkbage)[Andrew Clark](https://twitter.com/acdlite)
Expand Down
4 changes: 0 additions & 4 deletions src/content/blog/2023/05/03/react-canaries.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "React Canaries:在 Meta 之外逐步推出新功能"
=======
title: "React Canaries: Enabling Incremental Feature Rollout Outside Meta"
author: Dan Abramov, Sophie Alpert, Rick Hanlon, Sebastian Markbage, and Andrew Clark
date: 2023/05/03
description: We'd like to offer the React community an option to adopt individual new features as soon as their design is close to final, before they're released in a stable version--similar to how Meta has long used bleeding-edge versions of React internally. We are introducing a new officially supported [Canary release channel](/community/versioning-policy#canary-channel). It lets curated setups like frameworks decouple adoption of individual React features from the React release schedule.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2023 年 5 月 3 日 [Dan Abramov](https://twitter.com/dan_abramov)[Sophie Alpert](https://twitter.com/sophiebits)[Rick Hanlon](https://twitter.com/rickhanlonii)[Sebastian Markbåge](https://twitter.com/sebmarkbage)[Andrew Clark](https://twitter.com/acdlite)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
<<<<<<< HEAD
title: "React Labs:我们正在努力的方向——2024 年 2 月"
=======
title: "React Labs: What We've Been Working On – February 2024"
author: Joseph Savona, Ricky Hanlon, Andrew Clark, Matt Carroll, and Dan Abramov
date: 2024/02/15
description: In React Labs posts, we write about projects in active research and development. We’ve made significant progress since our last update, and we’d like to share our progress.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
---

2024 年 2 月 15 日 [Joseph Savona](https://twitter.com/en_JS)[Ricky Hanlon](https://twitter.com/rickhanlonii)[Andrew Clark](https://twitter.com/acdlite)[Matt Carroll](https://twitter.com/mattcarrollcode)[Dan Abramov](https://twitter.com/dan_abramov)
Expand Down Expand Up @@ -59,11 +55,7 @@ JavaScript 是一个因其松散规则和动态特性而闻名的具有挑战性
</form>
```

<<<<<<< HEAD
`action` 函数可以同步或异步执行。你可以在客户端使用标准 JavaScript 定义它们,也可以在服务器上使用 [`'use server'`](/reference/react/use-server) 指示符。当使用 action 时,React 将帮助管理数据提交的生命周期,提供类似 [`useFormStatus`](/reference/react-dom/hooks/useFormStatus)[`useFormState`](/reference/react-dom/hooks/useFormState) 的 Hook,以访问表单操作的当前 state 与响应。
=======
The `action` function can operate synchronously or asynchronously. You can define them on the client side using standard JavaScript or on the server with the [`'use server'`](/reference/rsc/use-server) directive. When using an action, React will manage the life cycle of the data submission for you, providing hooks like [`useFormStatus`](/reference/react-dom/hooks/useFormStatus), and [`useActionState`](/reference/react/useActionState) to access the current state and response of the form action.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
`action` 函数可以同步或异步执行。你可以在客户端使用标准 JavaScript 定义它们,也可以在服务器上使用 [`'use server'`](/reference/rsc/use-server) 指示符。当使用 action 时,React 将帮助管理数据提交的生命周期,提供类似 [`useFormStatus`](/reference/react-dom/hooks/useFormStatus)[`useActionState`](/reference/react/useActionState) 的 Hook,以访问表单操作的当前 state 与响应。

默认情况下,Action 在 [transition](/reference/react/useTransition) 中提交,使当前页面在操作处理过程中保持交互性。由于 Action 支持异步函数,我们还添加了在 transitions 中使用 `async/await` 的功能,这允许在异步请求(如 `fetch`)开始时使用转换的 `isPending` 状态显示待处理 UI,并在应用更新时始终显示待处理 UI。

Expand All @@ -83,21 +75,13 @@ Canaries 是我们开发 React 的一种变化。以前,功能会在 Meta 内

React 服务器组件、资源加载、文档元数据与 Action 都已经加入了 React Canary,并且我们已经在 react.dev 上为这些功能添加了文档:

<<<<<<< HEAD
- **指示符**[`"use client"`](/reference/react/use-client)[`"use server"`](/reference/react/use-server) 是设计用于全栈 React 框架的打包功能。它们标记了两个环境之间的“分割点”:use client 指示符指示打包工具生成一个 `<script>` 标签(类似于 [Astro Islands](https://docs.astro.build/en/concepts/islands/#creating-an-island)),而 use server 告诉打包工具生成一个 POST 端点(类似于 [tRPC Mutations](https://trpc.io/docs/concepts))。它们让你可以编写将客户端交互性与相关的服务器端逻辑组合在一起的可重用组件。
=======
- **Directives**: [`"use client"`](/reference/rsc/use-client) and [`"use server"`](/reference/rsc/use-server) are bundler features designed for full-stack React frameworks. They mark the "split points" between the two environments: `"use client"` instructs the bundler to generate a `<script>` tag (like [Astro Islands](https://docs.astro.build/en/concepts/islands/#creating-an-island)), while `"use server"` tells the bundler to generate a POST endpoint (like [tRPC Mutations](https://trpc.io/docs/concepts)). Together, they let you write reusable components that compose client-side interactivity with the related server-side logic.
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
- **指示符**[`"use client"`](/reference/rsc/use-client)[`"use server"`](/reference/rsc/use-server) 是设计用于全栈 React 框架的打包功能。它们标记了两个环境之间的“分割点”:use client 指示符指示打包工具生成一个 `<script>` 标签(类似于 [Astro Islands](https://docs.astro.build/en/concepts/islands/#creating-an-island)),而 use server 告诉打包工具生成一个 POST 端点(类似于 [tRPC Mutations](https://trpc.io/docs/concepts))。它们让你可以编写将客户端交互性与相关的服务器端逻辑组合在一起的可重用组件。

- **文档元数据**:我们内置支持在组件树中的任何位置渲染 [`<title>`](/reference/react-dom/components/title)[`<meta>`](/reference/react-dom/components/meta) 和元数据 [`<link>`](/reference/react-dom/components/link) 标签。这些在所有环境中都以相同的方式工作,包括完全客户端代码、SSR 和 RSC。这为像 [React Helmet](https://github.com/nfl/react-helmet) 这样的库开创的功能提供了内置支持。

- **资源加载**:我们将 Suspense 与样式表、字体和脚本等资源的加载生命周期集成在一起,以便 React 考虑它们来确定像 [`<style>`](/reference/react-dom/components/style)[`<link>`](/reference/react-dom/components/link)[`<script>`](/reference/react-dom/components/script) 这样的元素中的内容是否已准备就绪。我们还添加了新的 [资源加载 API](/reference/react-dom#resource-preloading-apis),如 `preload``preinit`,以提供更大的控制权,指示何时应加载和初始化资源。

<<<<<<< HEAD
- **Action**:如上所述,我们已将 Action 添加到管理从客户端发送数据到服务器的功能中。现在可以将 `action` 添加到像 [`<form/>`](/reference/react-dom/components/form) 这样的元素中,使用 [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) 访问状态,使用 [`useFormState`](/reference/react-dom/hooks/useFormState) 处理结果,并使用 [`useOptimistic`](/reference/react/useOptimistic) 乐观地更新 UI。
=======
- **Actions**: As shared above, we've added Actions to manage sending data from the client to the server. You can add `action` to elements like [`<form/>`](/reference/react-dom/components/form), access the status with [`useFormStatus`](/reference/react-dom/hooks/useFormStatus), handle the result with [`useActionState`](/reference/react/useActionState), and optimistically update the UI with [`useOptimistic`](/reference/react/useOptimistic).
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
- **Action**:如上所述,我们已将 Action 添加到管理从客户端发送数据到服务器的功能中。现在可以将 `action` 添加到像 [`<form/>`](/reference/react-dom/components/form) 这样的元素中,使用 [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) 访问状态,使用 [`useActionState`](/reference/react/useActionState) 处理结果,并使用 [`useOptimistic`](/reference/rsc/useOptimistic) 乐观地更新 UI。

由于所有这些功能是相互配合的,因此单独在稳定渠道中发布它们是困难的。发布 Action 而不带有用于访问表单状态的补充 Hook 会限制 Action 的实际可用性。引入 React 服务器组件而不集成 Server Action 会把在服务器上修改数据变得复杂化。

Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/2024/04/25/react-19.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const [error, submitAction, isPending] = useActionState(

<Note>

`React.useActionState` was previously called `ReactDOM.useFormState` in the Canary releases, but we've renamed it and deprecated `useFormState`.
`React.useActionState` was previously called `ReactDOM.useActionState` in the Canary releases, but we've renamed it and deprecated `useActionState`.

See [#28491](https://github.com/facebook/react/pull/28491) for more info.

Expand Down
4 changes: 0 additions & 4 deletions src/content/blog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ title: React Blog

<div className="sm:-mx-5 flex flex-col gap-5 mt-12">

<<<<<<< HEAD
<BlogCard title="React Labs:我们正在努力的方向——2024 年 2 月" date="February 15, 2024" url="/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024">
=======
<BlogCard title="React 19 Beta " date="April 25, 2024" url="/blog/2024/04/25/react-19">

In the React 19 Beta Upgrade Guide, we shared step-by-step instructions for upgrading your app to React 19 Beta. In this post, we'll give an overview of the new features in React 19, and how you can adopt them.
Expand All @@ -26,7 +23,6 @@ The improvements added to React 19 require some breaking changes, but we've work
</BlogCard>

<BlogCard title="React Labs: What We've Been Working On – February 2024" date="February 15, 2024" url="/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024">
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134

在 React Labs 的文章中,我们讲述了正在进行研究与开发的项目。自从上次更新以来,我们在 React 编译器、新功能和 React 19 方面取得了重大进展,除此之外我们还想要分享我们从中学到的东西。

Expand Down
8 changes: 0 additions & 8 deletions src/content/community/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,11 @@ React 核心团队成员全职致力于核心组件 API 的开发,负责 React
</TeamMember>

<TeamMember name="Lauren Tan" permalink="lauren-tan" photo="/images/team/lauren.jpg" github="poteto" twitter="potetotes" threads="potetotes" personal="no.lol" title="Engineer at Meta">
<<<<<<< HEAD
Lauren 的编程生涯在她首次发现 `<marquee>` 标签时达到了巅峰,自此以后,她就一直追求这种感觉。在为 React 除错之余,她喜欢在聊天中发送风趣的表情包,还喜欢和伴侣以及她的狗狗 Zelda 一起玩各种电子游戏。
</TeamMember>

<TeamMember name="Luna Wei" permalink="luna-wei" photo="/images/team/luna-wei.jpg" github="lunaleaps" twitter="lunaleaps" threads="lunaleaps" title="Engineer at Meta">
Luna 在仅有 6 岁的时候,就从父亲那里学到了 Python 的基本原理。从那以后,她的学习之路一直畅通无阻。Luna 有志成为 Z 世代的一员,她的成功之路充满了对环境的倡导,城市园艺的热爱,以及与她的 Voo-Doo'd(如图)共享的宝贵时光。
=======
Lauren's programming career peaked when she first discovered the `<marquee>` tag. She’s been chasing that high ever since. She studied Finance instead of CS in college, so she learned to code using Excel instead of Java. Lauren enjoys dropping cheeky memes in chat, playing video games with her partner, and petting her dog Zelda.
</TeamMember>

<TeamMember name="Luna Wei" permalink="luna-wei" photo="/images/team/luna-wei.jpg" github="lunaleaps" twitter="lunaleaps" threads="lunaleaps" title="Engineer at Meta">
Luna first learnt the fundamentals of python at the age of 6 from her father. Since then, she has been unstoppable. Luna aspires to be a gen z, and the road to success is paved with environmental advocacy, urban gardening and lots of quality time with her Voo-Doo’d (as pictured).
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
</TeamMember>

<TeamMember name="Matt Carroll" permalink="matt-carroll" photo="/images/team/matt-carroll.png" github="mattcarrollcode" twitter="mattcarrollcode" threads="mattcarrollcode" title="Developer Advocate at Meta">
Expand Down
6 changes: 1 addition & 5 deletions src/content/community/versioning-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ title: 版本策略

</Intro>

<<<<<<< HEAD
## 稳定版本 {/*stable-releases*/}
=======
For a list of previous releases, see the [Versions](/versions) page.

## Stable releases {/*stable-releases*/}
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
## 稳定版本 {/*stable-releases*/}

稳定的 React 版本(也被称为 Latest 发布渠道)遵循语义化版本控制(semver)的原则。

Expand Down
8 changes: 0 additions & 8 deletions src/content/learn/manipulating-the-dom-with-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,11 @@ li {
ref={node => {
const map = getMap();
if (node) {
<<<<<<< HEAD
// 添加到 Map
map.set(cat.id, node);
} else {
// 从 Map 删除
map.delete(cat.id);
=======
// Add to the Map
map.set(cat, node);
} else {
// Remove from the Map
map.delete(cat);
>>>>>>> a2f8ff3cfd9348dc69ea3347a6b9e836f0ebc134
}
}}
>
Expand Down
Loading

0 comments on commit 989f6b9

Please sign in to comment.