Skip to content

Sync with react.dev @ 47e64bf7#1152

Merged
jhonmike merged 132 commits into
mainfrom
sync-47e64bf7
May 20, 2026
Merged

Sync with react.dev @ 47e64bf7#1152
jhonmike merged 132 commits into
mainfrom
sync-47e64bf7

Conversation

@react-translations-bot
Copy link
Copy Markdown
Collaborator

This PR was automatically generated.

Merge changes from react.dev at 47e64bf

The following files have conflicts and may need new translations:

Please fix the conflicts by pushing new commits to this pull request, either by editing the files directly on GitHub or by checking out this branch.

DO NOT SQUASH MERGE THIS PULL REQUEST!

Doing so will "erase" the commits from main and cause them to show up as conflicts the next time we merge.

poteto and others added 30 commits September 16, 2025 11:05
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 facebook/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 facebook/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.
Previously, `createFileMap` split the MDX meta string on spaces and assumed the first token was the filename. Once we prefixed code fences with `{expectedErrors: ...}`, it would incorrectly parse the meta and crash.

This PR updates createFileMap to skip tokens in the meta containing a start and end brace pair (using a stack to ensure we close on the correct brace) while tokenizing the meta string as expected.

Test plan: pages reported in #7994 no longer crash on the next PR

Closes #7994
* Ignore braces when building Sandpack file map

Previously, `createFileMap` split the MDX meta string on spaces and assumed the first token was the filename. Once we prefixed code fences with `{expectedErrors: ...}`, it would incorrectly parse the meta and crash.

This PR updates createFileMap to skip tokens in the meta containing a start and end brace pair (using a stack to ensure we close on the correct brace) while tokenizing the meta string as expected.

Test plan: pages reported in #7994 no longer crash on the next PR

Closes #7994

* Restore lint corrections from #7989

Reverts the revert now that we've fixed the bug. These pages should no longer crash:

https://react-dev-git-pr7997-fbopensource.vercel.app/learn/referencing-values-with-refs
https://react-dev-git-pr7997-fbopensource.vercel.app/learn/synchronizing-with-effects
https://react-dev-git-pr7997-fbopensource.vercel.app/learn/separating-events-from-effects
https://react-dev-git-pr7997-fbopensource.vercel.app/learn/removing-effect-dependencies
https://react-dev-git-pr7997-fbopensource.vercel.app/learn/you-might-not-need-an-effect
For local dev and CI we want to have the eslint-local-rules running, so let's make sure both have their dependencies installed. We don't use a monorepo setup here, which is why they're currently setup as a two completely independent yarn workspaces.
Adds new docs for our new eslint rules.
* Fix view transition example

* Empty commit

* Fix fullscreen example
* Update useEffectEvent docs for canary

* Clean up prefixed imports

* Fix import

* Update blog post link
* Docs for `cacheSignal`

* Apply suggestion from review

Co-authored-by: Sebastian Markbåge <sebastian@calyptus.eu>

* Apply suggestion from review

Co-authored-by: Sebastian Markbåge <sebastian@calyptus.eu>

* Update src/content/reference/react/cacheSignal.md

---------

Co-authored-by: Sebastian Markbåge <sebastian@calyptus.eu>
* docs: scaffold docs structure for Performance tracks

* docs: initial draft of Tracks section

* refactor: moved to reference root section and added to the sidebar

* chore: updated to canary and minor changes
* Init PPR docs

* Overhaul

* Apply suggestions from code review

---------

Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
* wip

* feedback and rm canary stuff

* tweak

* fix json

* more canary stuff

* fix link

* update dates

* update meta description

* Expand performance track section

* adjust linter note

* edit perf tracks down

* edit perf tracks down more

* tweak note

* tweak useEffectEvent

* formatting

* tweaks

* ppr

* rm canary stuff

* fix json

* fix json

* tweaks

* linter note

* nit

* nit

* link

* nit

* ppr

* missing await

* add lint v6

* fix link

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
We're updating eslint-plugin-react-hooks with support for useEffectEvent usage and updated configuration options for applying the useEffectEvent and other effect rules to custom effect hooks.

This adds the documentation for the config syntax and adds mention to the useEffectEvent reference page that the linter should be used to ensure proper usage of Effect Events.
* Fix Activity sandboxes

* hacky fix
* Use stable release in demos with HTML output

* Fix Activity sandboxes (#8035)

* Fix Activity sandboxes

* hacky fix

* Revert "Fix Activity sandboxes (#8035)"

This reverts commit f9fd07c.

* Bump to 19.2

* cleanup rest of sandpacks

* Pin deps

* Add back package.json with third-party deps

* "^" should be fixed now

* add back package.json for more toastify deps

* fuggin whitespace

* more fuggin whitespace

* fml like fr fr

---------

Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
Co-authored-by: Ricky <rickhanlonii@gmail.com>
Co-authored-by: Rick Hanlon <rickhanlonii@meta.com>
gaearon and others added 9 commits March 8, 2026 00:59
Imgur withdrew from the UK due to the Online Safety Act, breaking all
images in the docs for UK-based users. This replaces all 195 Imgur
image references across 18 documentation files with locally hosted
copies served from react.dev/images/docs/scientists/.

50 image files are added to cover all direct references and dynamic
size variants (s/m/b/l suffixes used by the getImageUrl helper).

Fixes #8110

Co-authored-by: Tadao <tadao@travisfixes.com>
… (#8364)

* fix(docs): Change 'a Action' to 'an Action' in useOptimistic.md

This fixes a grammar error where 'a Action' should be 'an Action' since
'Action' starts with a vowel sound.

Related to #6713 - Capitalize React concepts in docs

* docs: Update Vite React Compiler setup for @vitejs/plugin-react@6.0.0

- Add instructions for using reactCompilerPreset with @rolldown/plugin-babel
- Document that inline babel option was removed in version 6.0.0
- Keep backward compatibility note for older versions
- Remove outdated vite-plugin-babel reference

Fixes #8353
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pt-br-react-dev Building Building Preview, Comment May 20, 2026 12:34pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pt-br-legacy-reactjs-org Ignored Ignored Preview May 20, 2026 12:34pm

Request Review


for (const fullPath of candidates) {
try {
const content = fs.readFileSync(fullPath, 'utf8');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vou deixar esse fluxo para o time da doc oficial em ingles ajustar e quando subirem atualizamos aqui também

Resolve all 86 files with conflict markers from the upstream sync.
Strategy: keep/update Portuguese translations, follow upstream changes
faithfully, translate new English content to PT-BR.

Key changes incorporated:
- React Compiler: RC → Stable (removed RC notes, updated docs)
- Version bump: 19.1 → 19.2 in versions.md
- Branding: RedwoodJS → RedwoodSDK (rwsdk.com)
- Image URLs: i.imgur.com → react.dev/images/docs/scientists/
- Link updates: /learn/start-a-new-react-project → /learn/creating-a-react-app
- Bug fix: /errors/421 → /errors/149 in errors/index.md
- API docs: useOptimistic, useActionState, cache rewritten upstream — fully translated to PT-BR
…ontent.js

- package.json: keep next@15.4.8 (dependabot bump)
- yarn.lock: keep next@15.4.8 entries, remove 15.1.x entries
- HomeContent.js: update Remix → React Router (reactrouter.com),
  update CTA href to /learn/creating-a-react-app
Smart quotes (U+2018/U+2019) were introduced during conflict resolution
in the JSX {' '} space expressions, causing an ESLint syntax error.
@jhonmike jhonmike merged commit 0a5ad94 into main May 20, 2026
8 of 10 checks passed
@jhonmike jhonmike deleted the sync-47e64bf7 branch May 20, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 upstream update Doc has changed in the upstream repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.