Skip to content

Sync with react.dev @ 383a1e92 - #402

Open
react-translations-bot wants to merge 183 commits into
mainfrom
sync-383a1e92
Open

Sync with react.dev @ 383a1e92#402
react-translations-bot wants to merge 183 commits into
mainfrom
sync-383a1e92

Conversation

@react-translations-bot

Copy link
Copy Markdown
Collaborator

sky21kr and others added 30 commits September 1, 2025 14:32
Co-authored-by: unknown <deepanshu.9dd@gmail.com~>
`a expensive` should be `an expensive`
Fix "documentatino" typo to "documentation" in comment about useOptimistic reference page.
…d example of the use API (#7767)

* Update "Deep Dive" in reusing-logic-with-custom-hooks.md with link to and example of the use API

* Remove mention of Server Components when explaining the use API

* Update src/content/learn/reusing-logic-with-custom-hooks.md

Co-authored-by: Ricky <rickhanlonii@gmail.com>

* fix: Correct which lines are highlighted in code example

---------

Co-authored-by: Ricky <rickhanlonii@gmail.com>
The previous examples used a service called loremflickr.com to link to  placeholder images. Since that service is now down, I updated them to reference placecats.com instead, which we already use in other examples as well. placecats doesn't have the same random cat feature so I roughly approximated it in the example code.

Closes #7966
* Fix handleClick compiler intro example

* Use a note instead

* Update src/content/learn/react-compiler/introduction.md
* fix: changed source file names in docs from App.js, index.js and styles.css to src/ dir

* fix: updated wrong image with the correct one with current sandbox file structure

* refactor: reverted all formatting and just just mention src folder in introductory section

* Reverted changes tutorial-tic-tac-toe.md

* added enhanced image of sandbox
* docs: add flushSync Troubleshooting section

* Update src/content/reference/react-dom/flushSync.md

* oops

* Apply suggestions from code review

* formatting and pitfall

---------

Co-authored-by: Ricky <rickhanlonii@gmail.com>
Co-authored-by: Rick Hanlon <rickhanlonii@meta.com>
* correct IconExperimental naming and usage (from #7972)

Co-authored-by: Tuna <198469603+TunaDev0@users.noreply.github.com>

* Bump Activity to Canary in docs

---------

Co-authored-by: Tuna <198469603+TunaDev0@users.noreply.github.com>
Happened to notice we were still on an old version of the compiler. This PR upgrades us to use the latest RC.
Copied over our copyright script from the react repo. I made a small fix to handle shebangs.
* Add copyright script

Copied over our copyright script from the react repo. I made a small fix to handle shebangs.

* Update copyright on all files

Run the script.
…iler (#7988)

In react/react#34462 for example, we found an issue where the compiler was incorrectly validating an example straight from the docs.

In order to find more issues like this + also provide more feedback to doc authors on valid/invalid patterns, this PR adds a new local eslint rule which validates all markdown codeblocks containing components/hooks with React Compiler. An autofixer is also provided.

To express that a codeblock has an expected error, we can use the following metadata:

```ts
// pseudo type def
type MarkdownCodeBlockMetadata = {
    expectedErrors?: {
      'react-compiler'?: number[];
    };
  };
```

and can be used like so:

````
```js {expectedErrors: {'react-compiler': [4]}}
// ❌ setState directly in render
function Component({value}) {
  const [count, setCount] = useState(0);
  setCount(value); // error on L4
  return <div>{count}</div>;
}
```
````

Because this is defined as a local rule, we don't have the same granular reporting that `eslint-plugin-react-hooks` yet. I can look into that later but for now this first PR just sets us up with something basic.
* Add local eslint rule to validate markdown codeblocks with React Compiler

In react/react#34462 for example, we found an issue where the compiler was incorrectly validating an example straight from the docs.

In order to find more issues like this + also provide more feedback to doc authors on valid/invalid patterns, this PR adds a new local eslint rule which validates all markdown codeblocks containing components/hooks with React Compiler. An autofixer is also provided.

To express that a codeblock has an expected error, we can use the following metadata:

```ts
// pseudo type def
type MarkdownCodeBlockMetadata = {
    expectedErrors?: {
      'react-compiler'?: number[];
    };
  };
```

and can be used like so:

````
```js {expectedErrors: {'react-compiler': [4]}}
// ❌ setState directly in render
function Component({value}) {
  const [count, setCount] = useState(0);
  setCount(value); // error on L4
  return <div>{count}</div>;
}
```
````

Because this is defined as a local rule, we don't have the same granular reporting that `eslint-plugin-react-hooks` yet. I can look into that later but for now this first PR just sets us up with something basic.

* fix compiler errors

I went through the list of existing errors and tried to separate the expected errors from those that seem to be flagging unexpected issues.  In particular, our effects validations are flagging patterns that our own docs examples use. I added todos for these and will follow up later.
aurorascharff and others added 25 commits June 24, 2026 22:50
* fix: update use.md pitfall to mention that bypassing use can corrupt React's internal state tracking

* Apply suggestion from @rickhanlonii

* Apply suggestion from @rickhanlonii

* Apply suggestion from @rickhanlonii

* Apply suggestion from @rickhanlonii

* Update use.md with caution on bypassing `use`

Add warning about bypassing `use` and its effects on React Suspense.

* Apply suggestion from @rickhanlonii

* Update guidance on using the `use` hook with Promises

Clarify usage of `use` hook regarding Promise handling.

* Clarify usage of `use` with Promises

---------

Co-authored-by: Ricky <rickhanlonii@gmail.com>
* Fix broken internal link in Component reference (anchor)

* chore: trigger CLA check
Co-authored-by: Daksh Dhami <hi@lucii.xyz>
Co-authored-by: Daksh Dhami <hi@lucii.xyz>
Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
…browser extension (#7726)

* Rewrite React Developer Tools section in tutorial-tic-tac-toe

CodeSandbox doesn't seem to support any platform React Developer Tools as is seen in tutorial.
This section is rewritten to use the browser extension directly on the preview.

* Fixed the preview URL to the codesandbox instance just before this section
* Clarify use vs await

* Refine based on feedback

* Address review comments
Co-authored-by: Tuna <tuna@MacBookPro.station>
…505)

* [Suspense] Add 'What activates a Suspense boundary' section

* [Suspense] Clarify image activation wording (review feedback)

* Define "suspense-enabled-framework"

* Update outdated framework-less data fetching note to reference use()

* fix: clarify Suspense boundary activation and fallback behavior

* Add code example

* update styling

* Cleanup caveat

* add link to blogpost

* Replace notes with link to suspense docs

* Tweak caveat

* Update caveat to clarify streaming behavior during server rendering

* Address feedback

* address feedback

* Clarify documentation on Suspense-enabled frameworks

* Update links and wording

* Improve example

* Clarify heading for Suspense-enabled frameworks section

* Restructure page

* Update to be docs compliant and clarify images

* Address review feedback

* Add more suspense examples

* Add more examples

* Clarify image loading behavior during <ViewTransition> updates in Suspense documentation

* Enhance Suspense documentation with additional details on font and image loading during <ViewTransition> updates

* Update

* Enhance Suspense documentation with examples of stylesheet loading behavior and vanilla DOM comparison

* agent review
* Polish Suspense activation examples

- Move Canary badges into section headings and render them icon-only
  in the table of contents
- Replace the image demo's text fallback with a profile skeleton
- Add a combined example coordinating data, a stylesheet, a font, and
  an image behind one boundary, with a plain DOM comparison
- Match skeleton dimensions to the revealed content

* Make the combined example's data delay consistent between runs
* Tune Suspense demo heights, data delay, and DOM comparison wording

* Make section openers stand alone and restore demo timing

* Shrink image demo portraits so both cards fit without layout shift

* Name the resources in the combined section opener

* State the ViewTransition condition in the combined section opener

* Align combined section opener with sibling sections

* Frame font and image waiting as Suspense behavior gated on ViewTransition

* Match the combined section opener to its sibling sections

* Document the experimental defer prop

* Reduce the combined example's data delay

* tweak
* Add dynamic OG images for docs pages

* Match OG card design to existing static images

* Generate OG images statically at build time

* Clean up orphaned lockfile entry

* Show section label on OG cards and guard pages without a card

* Center title and enlarge section label on OG cards
…Leadership Council, and refresh membership.

Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
* Resize long og image text

* address feedback
Please accept my changes for React Alicante and CityJS Athens

for (const fullPath of candidates) {
try {
const content = fs.readFileSync(fullPath, 'utf8');
Resolves all 40 conflict hunks across 19 files left unresolved by the
sync bot.

Non-Markdown files (not owned by this fork) take upstream wholesale:
- package.json: next 15.4.8 -> 15.1.12, matching upstream. The fork had
  diverged via dependabot #371, which is what made package.json conflict
  on every sync and broke `yarn install` (invalid JSON).
- yarn.lock

Markdown files keep the Hindi translation and adopt upstream's
structural changes:
- image host migration (i.imgur.com, loremflickr.com -> react.dev,
  placecats.com)
- expectedErrors code-fence annotations for the new markdown code-block
  lint rule
- link path updates (/learn/start-a-new-react-project ->
  /learn/creating-a-react-app, and similar)
- ordered-list numbering fix in typescript.md
- removal of the stale <RSC> block in server-components.md
- trailing whitespace cleanup

Three Hindi strings were updated where upstream changed the meaning
rather than the wording:
- manipulating-the-dom-with-refs.md: ref callback now clears via the
  returned cleanup function, not a null argument
- state-a-components-memory.md: linter guidance now points to
  /learn/editor-setup#linting
- thinking-in-react.md: "single responsibility principle" ->
  "separation of concerns", with upstream's link

No translated prose was lost; Devanagari character counts are unchanged
per file except for these three intentional edits.

`yarn ci-check` and `yarn build` both pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 115.15 KB (🟡 +5.02 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

New Page Added

The following page was added to the bundle from the code in this PR:

Page Size (compressed) First Load
/llms.txt 253 B 115.4 KB

Six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/404 127.56 KB (🟢 -2.9 KB) 242.71 KB
/500 127.57 KB (🟢 -2.9 KB) 242.72 KB
/[[...markdownPath]] 130.01 KB (🟢 -2.55 KB) 245.16 KB
/_error 190 B (🟡 +10 B) 115.34 KB
/errors 127.81 KB (🟢 -2.9 KB) 242.96 KB
/errors/[errorCode] 127.79 KB (🟢 -2.9 KB) 242.94 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.