Skip to content

Commit f6e0f9a

Browse files
Merge branch 'main' into react-complier
2 parents 657b8b4 + 81487f7 commit f6e0f9a

21 files changed

+1013
-1281
lines changed

.github/workflows/analyze.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,9 @@ on:
77
- main # change this if your default branch is named differently
88
workflow_dispatch:
99

10-
permissions: {}
10+
permissions: {}
1111

1212
jobs:
13-
event_type:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v3
17-
18-
- name: Save Event Type
19-
run: echo ${{ github.event_name }} > ./event_type
20-
21-
- name: Upload Event Type
22-
uses: actions/upload-artifact@v4
23-
with:
24-
path: ./event_type
25-
name: event_type
26-
2713
analyze:
2814
runs-on: ubuntu-latest
2915
steps:
@@ -75,7 +61,7 @@ jobs:
7561
if: success() && github.event.number
7662
with:
7763
workflow: analyze.yml
78-
branch: ${{ github.event.pull_request.base.ref || 'main' }}
64+
branch: ${{ github.event.pull_request.base.ref }}
7965
name: bundle_analysis.json
8066
path: .next/analyze/base/bundle
8167

@@ -93,7 +79,7 @@ jobs:
9379
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
9480
# entry in your package.json file.
9581
- name: Compare with base branch bundle
96-
if: success()
82+
if: success() && github.event.number
9783
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
9884

9985
- name: Upload analysis comment
@@ -102,13 +88,6 @@ jobs:
10288
name: analysis_comment.txt
10389
path: .next/analyze/__bundle_analysis_comment.txt
10490

105-
number:
106-
runs-on: ubuntu-latest
107-
needs: analyze
108-
if: github.event_name == 'pull_request'
109-
steps:
110-
- uses: actions/checkout@v3
111-
11291
- name: Save PR number
11392
run: echo ${{ github.event.number }} > ./pr_number
11493

.github/workflows/analyze_comment.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,11 @@ permissions:
1414
jobs:
1515
comment:
1616
runs-on: ubuntu-latest
17+
if: >
18+
${{ github.event.workflow_run.event == 'pull_request' &&
19+
github.event.workflow_run.conclusion == 'success' }}
1720
steps:
18-
- name: Download Event Type
19-
uses: dawidd6/action-download-artifact@v3
20-
with:
21-
workflow: analyze.yml
22-
run_id: ${{ github.event.workflow_run.id }}
23-
name: event_type
24-
path: event_type
25-
26-
- name: get type
27-
id: get-type
28-
run: |
29-
event_type=$(cat event_type/event_type)
30-
echo "event-type=$event_type" >> $GITHUB_OUTPUT
31-
3221
- name: Download base branch bundle stats
33-
if: github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request'
3422
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
3523
with:
3624
workflow: analyze.yml
@@ -39,7 +27,6 @@ jobs:
3927
path: analysis_comment.txt
4028

4129
- name: Download PR number
42-
if: github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request'
4330
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
4431
with:
4532
workflow: analyze.yml
@@ -49,7 +36,7 @@ jobs:
4936

5037
- name: Get comment body
5138
id: get-comment-body
52-
if: success() && github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request'
39+
if: success()
5340
run: |
5441
echo 'body<<EOF' >> $GITHUB_OUTPUT
5542
echo '' >> $GITHUB_OUTPUT

src/components/Layout/HomeContent.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,7 @@ function CommunityGallery() {
736736
}, []);
737737

738738
return (
739-
<div
740-
ref={ref}
741-
className="relative flex overflow-x-hidden overflow-y-visible w-auto">
739+
<div ref={ref} className="relative flex overflow-x-clip w-auto">
742740
<div
743741
className="w-full py-12 lg:py-20 whitespace-nowrap flex flex-row animate-marquee lg:animate-large-marquee"
744742
style={{
@@ -765,21 +763,26 @@ const CommunityImages = memo(function CommunityImages({isLazy}) {
765763
<div
766764
key={i}
767765
className={cn(
768-
`group flex justify-center px-5 min-w-[50%] lg:min-w-[25%] rounded-2xl relative`
766+
`group flex justify-center px-5 min-w-[50%] lg:min-w-[25%] rounded-2xl`
769767
)}>
770768
<div
771769
className={cn(
772-
'h-auto relative rounded-2xl overflow-hidden before:-skew-x-12 before:absolute before:inset-0 before:-translate-x-full group-hover:before:animate-[shimmer_1s_forwards] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent transition-all ease-in-out duration-300',
770+
'h-auto rounded-2xl before:rounded-2xl before:absolute before:pointer-events-none before:inset-0 before:transition-opacity before:-z-1 before:shadow-lg lg:before:shadow-2xl before:opacity-0 before:group-hover:opacity-100 transition-transform ease-in-out duration-300',
773771
i % 2 === 0
774-
? 'rotate-2 group-hover:rotate-[-1deg] group-hover:scale-110 group-hover:shadow-lg lg:group-hover:shadow-2xl'
775-
: 'group-hover:rotate-1 group-hover:scale-110 group-hover:shadow-lg lg:group-hover:shadow-2xl rotate-[-2deg]'
772+
? 'rotate-2 group-hover:rotate-[-1deg] group-hover:scale-110'
773+
: 'group-hover:rotate-1 group-hover:scale-110 rotate-[-2deg]'
776774
)}>
777-
<img
778-
loading={isLazy ? 'lazy' : 'eager'}
779-
src={src}
780-
alt={alt}
781-
className="aspect-[4/3] h-full w-full flex object-cover rounded-2xl bg-gray-10 dark:bg-gray-80"
782-
/>
775+
<div
776+
className={cn(
777+
'overflow-clip relative before:absolute before:inset-0 before:pointer-events-none before:-translate-x-full group-hover:before:animate-[shimmer_1s_forwards] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent transition-transform ease-in-out duration-300'
778+
)}>
779+
<img
780+
loading={isLazy ? 'lazy' : 'eager'}
781+
src={src}
782+
alt={alt}
783+
className="aspect-[4/3] h-full w-full flex object-cover rounded-2xl bg-gray-10 dark:bg-gray-80"
784+
/>
785+
</div>
783786
</div>
784787
</div>
785788
))}

src/content/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ React 服务器组件、资源加载、文档元数据与 Action 都已经加入
8181

8282
- **资源加载**:我们将 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`,以提供更大的控制权,指示何时应加载和初始化资源。
8383

84-
- **Action**:如上所述,我们已将 Action 添加到管理从客户端发送数据到服务器的功能中。现在可以将 `action` 添加到像 [`<form/>`](/reference/react-dom/components/form) 这样的元素中,使用 [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) 访问状态,使用 [`useActionState`](/reference/react/useActionState) 处理结果,并使用 [`useOptimistic`](/reference/rsc/useOptimistic) 乐观地更新 UI。
84+
- **Action**:如上所述,我们已将 Action 添加到管理从客户端发送数据到服务器的功能中。现在可以将 `action` 添加到像 [`<form/>`](/reference/react-dom/components/form) 这样的元素中,使用 [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) 访问状态,使用 [`useActionState`](/reference/react/useActionState) 处理结果,并使用 [`useOptimistic`](/reference/react/useOptimistic) 乐观地更新 UI。
8585

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This error message will only be shown once per install.
5151
我们已在 Create React App 的 [官网](https://create-react-app.dev/) 和 GitHub [代码仓库](https://github.com/facebook/create-react-app) 添加了弃用通知。Create React App 将以维护模式继续运行,并发布了与 React 19 兼容的新版本 Create React App。
5252

5353
## 如何迁移到框架 {/*how-to-migrate-to-a-framework*/}
54-
我们推荐使用 [框架创建新的 React 应用](/learn/creating-a-react-app)。所有推荐的框架均支持客户端渲染([CSR](https://developer.mozilla.org/en-US/docs/Glossary/CSR))和单页面应用([SPA](https://developer.mozilla.org/en-US/docs/Glossary/SPA)),并可通过 CDN 或静态托管服务部署,无需服务器支持。
54+
我们推荐使用 [框架创建新的 React 应用](/learn/creating-a-react-app)。所有推荐的框架均支持客户端渲染([CSR](https://developer.mozilla.org/en-US/docs/Glossary/CSR))和单页面应用([SPA](https://developer.mozilla.org/zh-CN/docs/Glossary/SPA)),并可通过 CDN 或静态托管服务部署,无需服务器支持。
5555

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
---
2-
title: Translations
2+
title: 翻译
33
---
44

55
<Intro>
66

7-
React docs are translated by the global community into many languages all over the world.
7+
React 文档由全球社区翻译成多种语言,涵盖世界各地。
88

99
</Intro>
1010

11-
## Source site {/*main-site*/}
11+
## 来源站点 {/*main-site*/}
1212

13-
All translations are provided from the canonical source docs:
13+
所有翻译均来源于官方文档:
1414

1515
- [English](https://react.dev/) &mdash; [Contribute](https://github.com/reactjs/react.dev/)
1616

17-
## Full translations {/*full-translations*/}
17+
## 已完成的翻译 {/*full-translations*/}
1818

1919
{/* If you are a language maintainer and want to add your language here, finish the "Core" translations and edit `deployedTranslations` under `src/utils`. */}
2020

2121
<LanguageList progress="complete" />
2222

23-
## In-progress translations {/*in-progress-translations*/}
23+
## 正在进行的翻译工作 {/*in-progress-translations*/}
2424

25-
For the progress of each translation, see: [Is React Translated Yet?](https://translations.react.dev/)
25+
有关每种语言翻译的进度,请参见:[React 是否已被翻译?](https://translations.react.dev/)
2626

2727
<LanguageList progress="in-progress" />
2828

29-
## How to contribute {/*how-to-contribute*/}
29+
## 如何参与贡献 {/*how-to-contribute*/}
3030

31-
You can contribute to the translation efforts!
31+
你可以为这项翻译工作贡献出自己的力量!
3232

33-
The community conducts the translation work for the React docs on each language-specific fork of react.dev. Typical translation work involves directly translating a Markdown file and creating a pull request. Click the "contribute" link above to the GitHub repository for your language, and follow the instructions there to help with the translation effort.
33+
每个语言在社区有其对应的 react.dev 的 fork,来进行 React 文档的翻译工作。典型的翻译流程是直接翻译 Markdown 文件并创建拉取请求。你可以点击上方的“Contribute”链接,前往你所用语言的 GitHub 仓库,并按照那里的说明参与翻译工作。
3434

35-
If you want to start a new translation for your language, visit: [translations.react.dev](https://github.com/reactjs/translations.react.dev)
35+
如果你想为你的语言启动新的翻译项目,请访问:[translations.react.dev](https://github.com/reactjs/translations.react.dev)

0 commit comments

Comments
 (0)