From 82f2863efa4e94ec7d2c0d75c1710fbf0cb312b9 Mon Sep 17 00:00:00 2001 From: Batuhan Tomo <91488737+Rekl0w@users.noreply.github.com> Date: Sat, 28 Jun 2025 22:03:46 +0300 Subject: [PATCH 1/8] Fix #6915: typo fix (#6917) From 741e8d94a540dddb1b55ffe9258d1a2ef0edf82b Mon Sep 17 00:00:00 2001 From: Kunall Banerjee <14703164+yeskunall@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:15:48 -0400 Subject: [PATCH 2/8] fix: update ids to point to right part of the docs (#7854) --- src/content/reference/rsc/directives.md | 2 +- src/content/reference/rsc/server-components.md | 16 ++++++++-------- src/content/reference/rsc/use-client.md | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/content/reference/rsc/directives.md b/src/content/reference/rsc/directives.md index c17bcf3a8c..fe614fb27e 100644 --- a/src/content/reference/rsc/directives.md +++ b/src/content/reference/rsc/directives.md @@ -10,7 +10,7 @@ Directives are for use in [React Server Components](/reference/rsc/server-compon -Directives provide instructions to [bundlers compatible with React Server Components](/learn/start-a-new-react-project#bleeding-edge-react-frameworks). +Directives provide instructions to [bundlers compatible with React Server Components](/learn/start-a-new-react-project#full-stack-frameworks). diff --git a/src/content/reference/rsc/server-components.md b/src/content/reference/rsc/server-components.md index 9e6ab11eb4..f27fa8b860 100644 --- a/src/content/reference/rsc/server-components.md +++ b/src/content/reference/rsc/server-components.md @@ -4,7 +4,7 @@ title: Server Components -Server Components are for use in [React Server Components](/learn/start-a-new-react-project#bleeding-edge-react-frameworks). +Server Components are for use in [React Server Components](/learn/start-a-new-react-project#full-stack-frameworks). @@ -22,7 +22,7 @@ This separate environment is the "server" in React Server Components. Server Com #### How do I build support for Server Components? {/*how-do-i-build-support-for-server-components*/} -While React Server Components in React 19 are stable and will not break between minor versions, the underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. +While React Server Components in React 19 are stable and will not break between minor versions, the underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. To support React Server Components as a bundler or framework, we recommend pinning to a specific React version, or using the Canary release. We will continue working with bundlers and frameworks to stabilize the APIs used to implement React Server Components in the future. @@ -45,7 +45,7 @@ function Page({page}) { setContent(data.content); }); }, [page]); - + return
{sanitizeHtml(marked(content))}
; } ``` @@ -69,7 +69,7 @@ import sanitizeHtml from 'sanitize-html'; // Not included in bundle async function Page({page}) { // NOTE: loads *during* render, when the app is built. const content = await file.readFile(`${page}.md`); - + return
{sanitizeHtml(marked(content))}
; } ``` @@ -113,7 +113,7 @@ function Note({id}) { setNote(data.note); }); }, [id]); - + return (
@@ -253,7 +253,7 @@ This works by first rendering `Notes` as a Server Component, and then instructin

this is the second note

-
+ ``` @@ -270,8 +270,8 @@ import db from './database'; async function Page({id}) { // Will suspend the Server Component. const note = await db.notes.get(id); - - // NOTE: not awaited, will start here and await on the client. + + // NOTE: not awaited, will start here and await on the client. const commentsPromise = db.comments.get(note.id); return (
diff --git a/src/content/reference/rsc/use-client.md b/src/content/reference/rsc/use-client.md index e259585c49..5a0a7d96b4 100644 --- a/src/content/reference/rsc/use-client.md +++ b/src/content/reference/rsc/use-client.md @@ -41,7 +41,7 @@ export default function RichTextEditor({ timestamp, text }) { } ``` -When a file marked with `'use client'` is imported from a Server Component, [compatible bundlers](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) will treat the module import as a boundary between server-run and client-run code. +When a file marked with `'use client'` is imported from a Server Component, [compatible bundlers](/learn/start-a-new-react-project#full-stack-frameworks) will treat the module import as a boundary between server-run and client-run code. As dependencies of `RichTextEditor`, `formatDate` and `Button` will also be evaluated on the client regardless of whether their modules contain a `'use client'` directive. Note that a single module may be evaluated on the server when imported from server code and on the client when imported from client code. From c0c955ed1d1c4fe3bf3e18c06a8d121902a01619 Mon Sep 17 00:00:00 2001 From: Noritaka Kobayashi Date: Sun, 29 Jun 2025 04:20:02 +0900 Subject: [PATCH 3/8] chore: remove unused date-fns (#7856) --- package.json | 1 - yarn.lock | 5 ----- 2 files changed, 6 deletions(-) diff --git a/package.json b/package.json index 6d6b53f92d..918d42fa20 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "@radix-ui/react-context-menu": "^2.1.5", "body-scroll-lock": "^3.1.3", "classnames": "^2.2.6", - "date-fns": "^2.16.1", "debounce": "^1.2.1", "github-slugger": "^1.3.0", "next": "15.1.0", diff --git a/yarn.lock b/yarn.lock index a118cbeda5..e866a206bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2799,11 +2799,6 @@ data-view-byte-offset@^1.0.0: es-errors "^1.3.0" is-data-view "^1.0.1" -date-fns@^2.16.1: - version "2.28.0" - resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.28.0.tgz" - integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw== - debounce@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz" From b79ad220a4505415248892b881baa8f0ea1dff1d Mon Sep 17 00:00:00 2001 From: Batuhan Tomo <91488737+Rekl0w@users.noreply.github.com> Date: Wed, 2 Jul 2025 18:57:33 +0300 Subject: [PATCH 4/8] chore: fix typo in resource and metadata components documentation (#7006) From 341c312916e1b657262bbe14b134a6f1779fecf1 Mon Sep 17 00:00:00 2001 From: Dipesh B C <50456672+bcdipesh@users.noreply.github.com> Date: Wed, 2 Jul 2025 12:47:23 -0400 Subject: [PATCH 5/8] fix: correct typo in scaling-up-with-reducer-and-context.md (#7390) Fix typo in the 'Step 3: Use context anywhere in the tree' section by changing TaskContext to TasksContext for accuracy. --- src/content/learn/scaling-up-with-reducer-and-context.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/scaling-up-with-reducer-and-context.md b/src/content/learn/scaling-up-with-reducer-and-context.md index 91fb6803fb..fe1762d8ed 100644 --- a/src/content/learn/scaling-up-with-reducer-and-context.md +++ b/src/content/learn/scaling-up-with-reducer-and-context.md @@ -685,7 +685,7 @@ Now you don't need to pass the list of tasks or the event handlers down the tree ``` -Instead, any component that needs the task list can read it from the `TaskContext`: +Instead, any component that needs the task list can read it from the `TasksContext`: ```js {2} export default function TaskList() { From 48460207db61a657b31e57b9cbf7356b3a531555 Mon Sep 17 00:00:00 2001 From: Ricky Date: Wed, 9 Jul 2025 11:37:57 -0400 Subject: [PATCH 6/8] fix flushSync link (#7862) --- src/content/reference/react-dom/client/createRoot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/reference/react-dom/client/createRoot.md b/src/content/reference/react-dom/client/createRoot.md index adc6a8d37a..cb533ec78b 100644 --- a/src/content/reference/react-dom/client/createRoot.md +++ b/src/content/reference/react-dom/client/createRoot.md @@ -90,7 +90,7 @@ React will display `` in the `root`, and take over managing the DOM insid * If you call `render` on the same root more than once, React will update the DOM as necessary to reflect the latest JSX you passed. React will decide which parts of the DOM can be reused and which need to be recreated by ["matching it up"](/learn/preserving-and-resetting-state) with the previously rendered tree. Calling `render` on the same root again is similar to calling the [`set` function](/reference/react/useState#setstate) on the root component: React avoids unnecessary DOM updates. -* Although rendering is synchronous once it starts, `root.render(...)` is not. This means code after `root.render()` may run before any effects (`useLayoutEffect`, `useEffect`) of that specific render are fired. This is usually fine and rarely needs adjustment. In rare cases where effect timing matters, you can wrap `root.render(...)` in [`flushSync`](https://react.dev/reference/react-dom/client/flushSync) to ensure the initial render runs fully synchronously. +* Although rendering is synchronous once it starts, `root.render(...)` is not. This means code after `root.render()` may run before any effects (`useLayoutEffect`, `useEffect`) of that specific render are fired. This is usually fine and rarely needs adjustment. In rare cases where effect timing matters, you can wrap `root.render(...)` in [`flushSync`](https://react.dev/reference/react-dom/flushSync) to ensure the initial render runs fully synchronously. ```js const root = createRoot(document.getElementById('root')); From 84a56968d92b9a9e9bbac1ca13011e159e815dc1 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Thu, 10 Jul 2025 07:00:09 -0700 Subject: [PATCH 7/8] docs(react): fix grammar in forward ref deprecation message (#7864) --- src/content/reference/react/forwardRef.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/reference/react/forwardRef.md b/src/content/reference/react/forwardRef.md index 5b0e679b89..d035b9741a 100644 --- a/src/content/reference/react/forwardRef.md +++ b/src/content/reference/react/forwardRef.md @@ -6,7 +6,7 @@ title: forwardRef In React 19, `forwardRef` is no longer necessary. Pass `ref` as a prop instead. -`forwardRef` will deprecated in a future release. Learn more [here](/blog/2024/04/25/react-19#ref-as-a-prop). +`forwardRef` will be deprecated in a future release. Learn more [here](/blog/2024/04/25/react-19#ref-as-a-prop). From 4c72f01bc6ba92109209ebb7dea14c08346e7488 Mon Sep 17 00:00:00 2001 From: Xleine Date: Sun, 13 Jul 2025 09:15:15 +0800 Subject: [PATCH 8/8] fix conflict --- .../scaling-up-with-reducer-and-context.md | 6 +----- src/content/reference/rsc/directives.md | 6 +----- src/content/reference/rsc/server-components.md | 17 ++--------------- src/content/reference/rsc/use-client.md | 6 +----- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/content/learn/scaling-up-with-reducer-and-context.md b/src/content/learn/scaling-up-with-reducer-and-context.md index c92ed7546f..8fbb123222 100644 --- a/src/content/learn/scaling-up-with-reducer-and-context.md +++ b/src/content/learn/scaling-up-with-reducer-and-context.md @@ -690,11 +690,7 @@ ul, li { margin: 0; padding: 0; } ``` -<<<<<<< HEAD -相反,任何需要 tasks 的组件都可以从 `TaskContext` 中读取它: -======= -Instead, any component that needs the task list can read it from the `TasksContext`: ->>>>>>> 84a56968d92b9a9e9bbac1ca13011e159e815dc1 +相反,任何需要 tasks 的组件都可以从 `TasksContext` 中读取它: ```js {2} export default function TaskList() { diff --git a/src/content/reference/rsc/directives.md b/src/content/reference/rsc/directives.md index 7020618d3e..019fae9fdf 100644 --- a/src/content/reference/rsc/directives.md +++ b/src/content/reference/rsc/directives.md @@ -10,11 +10,7 @@ title: "指示符" -<<<<<<< HEAD -指示符(directive)向 [与 React 服务器组件兼容的捆绑器](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) 提供指令(instruction)。 -======= -Directives provide instructions to [bundlers compatible with React Server Components](/learn/start-a-new-react-project#full-stack-frameworks). ->>>>>>> 84a56968d92b9a9e9bbac1ca13011e159e815dc1 +指示符(directive)向 [与 React 服务器组件兼容的捆绑器](/learn/start-a-new-react-project#full-stack-frameworks) 提供指令(instruction)。 diff --git a/src/content/reference/rsc/server-components.md b/src/content/reference/rsc/server-components.md index d48c6d87e4..6d6bfbb348 100644 --- a/src/content/reference/rsc/server-components.md +++ b/src/content/reference/rsc/server-components.md @@ -4,11 +4,7 @@ title: 服务器组件 -<<<<<<< HEAD -服务器组件被用在 [React 服务器组件](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) 中。 -======= -Server Components are for use in [React Server Components](/learn/start-a-new-react-project#full-stack-frameworks). ->>>>>>> 84a56968d92b9a9e9bbac1ca13011e159e815dc1 +服务器组件被用在 [React 服务器组件](/learn/start-a-new-react-project#full-stack-frameworks) 中。 @@ -26,11 +22,7 @@ React 服务器组件中的「服务器」就是指这个独立的环境。服 #### 我如何构建对服务器组件的支持? {/*how-do-i-build-support-for-server-components*/} -<<<<<<< HEAD 虽然 React 19 中的 React 服务器组件是稳定的,并且在小版本之间不会发生破坏,但用于实现 React 服务器组件打包器或框架的底层 API 不遵循 semver,并可能在 React 19.x 的小版本之间发生破坏。 -======= -While React Server Components in React 19 are stable and will not break between minor versions, the underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. ->>>>>>> 84a56968d92b9a9e9bbac1ca13011e159e815dc1 为了支持 React 服务器组件作为打包器或框架,我们建议固定到特定的 React 版本,或者使用 Canary 发行版。我们将继续与打包器和框架合作,以在未来稳定用于实现 React 服务器组件的 API。 @@ -278,13 +270,8 @@ import db from './database'; async function Page({id}) { // 使用 await 会使服务器组件暂停 const note = await db.notes.get(id); -<<<<<<< HEAD - - // 注意: 没有使用 await, 所以从这里开始执行,但是客户端上面进行 await -======= - // NOTE: not awaited, will start here and await on the client. ->>>>>>> 84a56968d92b9a9e9bbac1ca13011e159e815dc1 + // 注意: 没有使用 await, 所以从这里开始执行,但是客户端上面进行 await const commentsPromise = db.comments.get(note.id); return (
diff --git a/src/content/reference/rsc/use-client.md b/src/content/reference/rsc/use-client.md index 8da6455202..99442bc395 100644 --- a/src/content/reference/rsc/use-client.md +++ b/src/content/reference/rsc/use-client.md @@ -41,11 +41,7 @@ export default function RichTextEditor({ timestamp, text }) { } ``` -<<<<<<< HEAD -当从服务器组件导入带有 `'use client'` 标记的文件时,[兼容的捆绑工具](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) 将模块导入视为服务器运行和客户端运行代码之间的边界。 -======= -When a file marked with `'use client'` is imported from a Server Component, [compatible bundlers](/learn/start-a-new-react-project#full-stack-frameworks) will treat the module import as a boundary between server-run and client-run code. ->>>>>>> 84a56968d92b9a9e9bbac1ca13011e159e815dc1 +当从服务器组件导入带有 `'use client'` 标记的文件时,[兼容的捆绑工具](/learn/start-a-new-react-project#full-stack-frameworks) 将模块导入视为服务器运行和客户端运行代码之间的边界。 作为 `RichTextEditor` 的依赖项,无论 `formatDate` 与 `Button` 的模块是否包含 `'use client'`,其都将在客户端上进行评估。请注意,当从服务器代码导入时,单个模块可能在服务器上进行评估,并且当从客户端代码导入时,可能在客户端上进行评估。