Commit Graph

6874 Commits

Author SHA1 Message Date
Sophie Alpert
775d895c98 fix typo 2025-10-03 03:33:02 -07:00
Sebastian "Sebbie" Silbermann
996ef72c1a Prerender can be aborted in stable (#8039) 2025-10-02 19:24:24 +02:00
Rick Hanlon
07b7a5d999 s/19.3/19.2 2025-10-02 10:27:17 -04:00
Ricky
42037e2dfd Few cleanups for 19.2 (#8046) 2025-10-02 10:06:30 -04:00
dan
9850724eb4 Upgrade sandboxes to 19.2 (#8037)
* 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 f9fd07ca59.

* 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>
2025-10-02 09:58:19 -04:00
Sebastian "Sebbie" Silbermann
37f862a64b Latest release is 19.2 (#8040) 2025-10-02 14:02:23 +02:00
Ricky
f9fd07ca59 Fix Activity sandboxes (#8035)
* Fix Activity sandboxes

* hacky fix
2025-10-01 19:23:34 -04:00
Jack Pope
0a803f61d8 Update eslint-plugin-react-hooks config docs (#8030)
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.
2025-10-01 17:55:59 -04:00
Ricky
c3d7560005 Blog post for React 19.2 (#8028)
* 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>
2025-10-01 17:42:52 -04:00
Sebastian "Sebbie" Silbermann
dc86f88afe Overview for React Server Performance tracks (#8031) 2025-10-01 21:28:18 +02:00
dan
10e5ad50cf Conditionally deriving state is allowed (#8033) 2025-10-01 20:11:07 +01:00
Ricky
aba6b86772 Docs for partial-prerendering APIs (#7869)
* Init PPR docs

* Overhaul

* Apply suggestions from code review

---------

Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
2025-10-01 13:48:16 -04:00
Ruslan Lesiutin
9fddeca99b docs: initial docs for Performance tracks (#7938)
* 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
2025-10-01 13:34:56 +01:00
Sebastian "Sebbie" Silbermann
3f0235be3d Docs for cacheSignal (#8023)
* 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>
2025-10-01 08:20:52 -04:00
Karl Horky
c60922ff73 Fix incorrect negative in use-memo intro (#8027) 2025-09-30 21:01:55 -04:00
Jack Pope
49c2d26722 Update useEffectEvent docs for canary (#8025)
* Update useEffectEvent docs for canary

* Clean up prefixed imports

* Fix import

* Update blog post link
2025-09-28 11:36:27 -04:00
Radoš Milićev
1b20061b10 Fix value wrongly formatted as code in useDeferredValue.md (#8024) 2025-09-26 18:15:37 +02:00
Eugene Choi
790625fd22 Fix ViewTransition examples (#7999)
* Fix view transition example

* Empty commit

* Fix fullscreen example
2025-09-23 17:25:52 -04:00
Radoš Milićev
170e5b904a Remove unnecessary spaces from useCallback.md (#8006) 2025-09-23 09:58:55 +02:00
Ricky
c8211fc21e Add RC badge to RC-only lint rules (#8005) 2025-09-22 10:18:10 -04:00
lauren
366b5fbdad Add new eslint rule reference docs (#7986)
Adds new docs for our new eslint rules.
2025-09-19 16:19:48 -04:00
lauren
c15e20f811 Install eslint-local-rules as postinstall (#7993)
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.
2025-09-19 11:19:36 -04:00
lauren
730d045c71 Restore lint corrections from #7989 (#7997)
* 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
2025-09-18 19:18:19 -04:00
lauren
f369f3efdf Ignore braces when building Sandpack file map (#7996)
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
2025-09-18 19:18:09 -04:00
lauren
2a9ef2d173 Revert "fix compiler errors (#7989)" (#7995)
This reverts commit 5cc9b7ba31.
2025-09-18 18:06:43 -04:00
lauren
5cc9b7ba31 fix compiler errors (#7989)
* Add local eslint rule to validate markdown codeblocks with React Compiler

In https://github.com/facebook/react/pull/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.
2025-09-18 15:32:27 -04:00
lauren
b6a32d1e0e Add local eslint rule to validate markdown codeblocks with React Compiler (#7988)
In https://github.com/facebook/react/pull/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.
2025-09-18 15:32:18 -04:00
lauren
bd03b86c02 Update copyright on all files (#7992)
* 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.
2025-09-18 14:42:36 -04:00
lauren
a566d87b2b Add copyright script (#7991)
Copied over our copyright script from the react repo. I made a small fix to handle shebangs.
2025-09-18 14:42:27 -04:00
lauren
5b9a2ce649 Upgrade babel-plugin-react-compiler (#7985)
Happened to notice we were still on an old version of the compiler. This PR upgrades us to use the latest RC.
2025-09-16 11:05:33 -04:00
Ricky
a5181c291f Bump Activity docs to canary (#7974)
* 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>
2025-09-12 12:47:11 -04:00
Akshay Ashok
0bfd418252 docs: add flushSync Troubleshooting section (#7978)
* 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>
2025-09-11 12:27:28 -04:00
Ricky
4d3d495919 Add React Conf 2024 to /videos (#7977) 2025-09-09 11:57:29 -04:00
Muhammad Tayyab
d34c6a2c6f Fix/tictactoe docs invalid file names (#7969)
* 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
2025-09-04 15:06:14 -04:00
Ricky
b8e9faf702 Fix handleClick compiler intro example (#7967)
* Fix handleClick compiler intro example

* Use a note instead

* Update src/content/learn/react-compiler/introduction.md
2025-09-03 14:42:35 -04:00
lauren
85ee6b205c Remove deprecated loremflickr placeholder images (#7968)
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
2025-09-03 13:33:41 -04:00
Ricky
ff11cd2818 Add note that form actions are actions (#7964) 2025-09-02 16:53:29 -04:00
Aurora Scharff
2217f4549d Update "Deep Dive" in reusing-logic-with-custom-hooks.md with link and 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>
2025-09-02 15:53:23 -04:00
Jinhyun Park
e9efd19e5a fix : typo in form component documentation (#7894)
Fix "documentatino" typo to "documentation" in comment about useOptimistic reference page.
2025-09-02 14:01:37 -04:00
Fergus Ruston
337d5eaf7d docs: minor grammar correction (#7906)
`a expensive` should be `an expensive`
2025-09-02 13:58:37 -04:00
Dejumo
afd84d136a Recommend installing @types/* as dev dependencies 2025-09-02 19:54:00 +02:00
Raghunath Prabhakar
0cc37ee979 fix: typo (#7914) 2025-09-02 13:42:32 -04:00
Deepanshu
67584b31ab Fix: grammar and add comma (#7917)
Co-authored-by: unknown <deepanshu.9dd@gmail.com~>
2025-09-02 13:42:06 -04:00
Vitor Monteiro
ca3e2718ba fix: definition typo on view transitions blog post (#7918) 2025-09-02 13:41:22 -04:00
Ricky
a4a37d8f23 Add setup to home sidebar (#7963) 2025-09-02 13:40:40 -04:00
ninamma
03a546551a Docs: update ref callback behaviour (#7927) 2025-09-02 13:26:56 -04:00
Mohammad Reza Badri
fc27b0aa9a docs: fix ordered list numbering in TypeScript with React Components section (#7941) 2025-09-02 13:00:49 -04:00
Brooks Lybrand
73a5fdd7fa docs: fix typo in update useTransition.md (#7936) 2025-09-02 12:39:02 -04:00
asimno
4d53629a66 Introduce Liverpool and Edinburgh meetup groups. (#7950) 2025-09-02 12:38:25 -04:00
Mohammad Reza Badri
04feec4582 fix(rtl): resolve RTL issues in Challenges component (#7942) 2025-09-02 12:37:21 -04:00