Commit Graph
20451 Commits
Author SHA1 Message Date
Joe Savona 55308cd0ad Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-04 16:47:18 -07:00
Joe Savona 7899f0d8db Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-04 16:47:17 -07:00
Joe Savona ec7d810c8e Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-03 16:59:51 -07:00
Joe Savona 721a2951e0 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-03 16:59:50 -07:00
Joe Savona 7e3a373182 Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-03 11:32:57 -07:00
Joe Savona 704047f527 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-03 11:32:57 -07:00
Joe Savona c5621f6401 Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-03 09:00:25 -07:00
Joe Savona 3d2908ba0c Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-03 09:00:24 -07:00
Joe Savona 60b0839e85 Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-01 17:19:03 -07:00
Joe Savona 39fb05d9f9 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-06-01 17:19:02 -07:00
Joe Savona a868a76fa7 Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-30 16:29:13 -07:00
Joe Savona c62f08c187 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-30 16:29:12 -07:00
Joe Savona 2adcce65ac Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-30 15:56:39 -07:00
Joe Savona 29bef35fe2 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-30 15:56:38 -07:00
Joe Savona 3794d69366 Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-30 11:33:05 -07:00
Joe Savona a396caecb1 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-30 11:33:05 -07:00
Joe Savona 8a68666e4d Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-29 17:30:05 -07:00
Joe Savona e00246e1d4 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-29 17:30:05 -07:00
Joe Savona 4eff1efade Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 22:26:59 -07:00
Joe Savona 6ca431371c Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 22:26:58 -07:00
Joe Savona 2fece2811c Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 17:38:24 -07:00
Joe Savona 58ad928aa9 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 17:38:23 -07:00
Joe Savona b9c08a82d8 Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 16:29:11 -07:00
Joe Savona f50938f669 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 16:29:10 -07:00
Joe Savona eda0d6b61e Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 15:42:19 -07:00
Joe Savona 24ec1dfd04 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-28 15:42:18 -07:00
Joe Savona 8986f3678c Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-27 16:30:46 -07:00
Joe Savona d77415da4b Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-27 16:30:45 -07:00
Joe Savona 0ef3a89f3e Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-27 14:23:23 -07:00
Joe Savona d07f06653c Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-27 14:23:23 -07:00
Joe Savona 3474a7bfee Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-23 16:58:06 -07:00
Joe Savona 5ac1c8f285 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-23 16:58:06 -07:00
Joe Savona 310c5c6c28 Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-22 16:57:24 -07:00
Joe Savona e7d5506fd8 Update base for Update on "[compiler] avoid empty switch case bodies"
[ghstack-poisoned]
2025-05-22 16:57:24 -07:00
5dc1b212c3 [Fizz] Support basic SuspenseList forwards/backwards revealOrder (#33306)
Basically we track a `SuspenseListRow` on the task. These keep track of
"pending tasks" that block the row. A row is blocked by:

- First itself completing rendering.
- A previous row completing.
- Any tasks inside the row and before the Suspense boundary inside the
row. This is mainly because we don't yet know if we'll discover more
SuspenseBoundaries.
- Previous row's SuspenseBoundaries completing.

If a boundary might get outlined, then we can't consider it completed
until we have written it because it determined whether other future
boundaries in the row can finish.

This is just handling basic semantics. Features not supported yet that
need follow ups later:

- CSS dependencies of previous rows should be added as dependencies of
future row's suspense boundary. Because otherwise if the client is
blocked on CSS then a previous row could be blocked but the server
doesn't know it.
- I need a second pass on nested SuspenseList semantics.
- `revealOrder="together"`
- `tail="hidden"`/`tail="collapsed"`. This needs some new runtime
semantics to the Fizz runtime and to allow the hydration to handle
missing rows in the HTML. This should also be future compatible with
AsyncIterable where we don't know how many rows upfront.
- Need to double check resuming semantics.

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
2025-05-19 15:16:42 -04:00
Jan KassensandGitHub a3abf5f2f8 [eslint-plugin-react-hooks] add experimental_autoDependenciesHooks option (#33294) 2025-05-19 15:08:30 -04:00
Sebastian MarkbågeandGitHub 462d08f9ba Move SuspenseListProps into a shared/ReactTypes (#33298)
So they can be shared by server. Incorporates the types from definitely
typed too.
2025-05-17 20:00:56 -04:00
Sebastian MarkbågeandGitHub 6060367ef8 [Fizz] Wrap revealCompletedBoundaries in a ViewTransitions aware version (#33293)
When needed.

For the external runtime we always include this wrapper.

For others, we only include it if we have an ViewTransitions affecting.
If we discover the ViewTransitions late, then we can upgrade an already
emitted instruction.

This doesn't yet do anything useful with it, that's coming in a follow
up. This is just the mechanism for how it gets installed.
2025-05-17 18:18:24 -04:00
Sebastian MarkbågeandGitHub c250b7d980 [Fizz] Should be considered complete inside onShellReady callback (#33295)
We decremented `allPendingTasks` after invoking `onShellReady`. Which
means that in that scope it wasn't considered fully complete.

Since the pattern for flushing in Node.js is to start piping in
`onShellReady` and that's how you can get sync behavior, this led us to
think that we had more work left to do. For example we emitted the
`writeShellTimeInstruction` in this scenario before.
2025-05-16 14:53:40 -04:00
Jan KassensandGitHub 4448b18760 [eslint-plugin-react-hooks] fix exhaustive deps lint rule with component syntax (#33182) 2025-05-15 12:51:18 -04:00
RickyandGitHub 4a45ba92c4 [sync] Fix noop for xplat (#33214)
Noop detection for xplat syncs broke because `eslint-plugin-react-hooks`
uses versions like:

- `0.0.0-experimental-d85f86cf-20250514`

But xplat expects them to be of the form:

- `19.2.0-native-fb-63d664b2-20250514`

This PR fixes the noop by ignoring
`eslint-plugin-react-hooks/package.json` changes. This means we won't
create a sync if only that package.json changes, but that should be rare
and we can follow up with better detection if needed.

[Example failed
action](https://github.com/facebook/react/actions/runs/15032346805/job/42247414406):

<img width="1031" alt="Screenshot 2025-05-15 at 11 31 17 AM"
src="https://github.com/user-attachments/assets/d902079c-1afe-4e18-af1d-25e60e28929e"
/>

I believe the regression was caused by
https://github.com/facebook/react/pull/33104
2025-05-15 12:12:51 -04:00
laurenandGitHub 08cb2d7ee7 [ci] Log author_association (#33213)
For debugging purposes, log author_association
2025-05-15 11:49:56 -04:00
laurenandGitHub 203df2c940 [compiler] Update changelog for 19.1.0-rc.2 (#33207)
Update the changelog.
2025-05-15 10:34:11 -04:00
Sebastian MarkbågeandGitHub 65b5aae010 [Fizz] Add vt- prefix attributes to annotate <ViewTransition> in HTML (#33206)
Stacked on #33194 and #33200.

When Suspense boundaries reveal during streaming, the Fizz runtime will
be responsible for animating the reveal if necessary (not in this PR).
However, for the future runtime to know what to do it needs to know
about the `<ViewTransition>` configuration to apply.

Ofc, these are virtual nodes that disappear from the HTML. We could
model them as comments like we do with other virtual nodes like Suspense
and Activity. However, that doesn't let us target them with
querySelector and CSS (for no-JS transitions). We also don't have to
model every ViewTransition since not every combination can happen using
only the server runtime. So instead this collapses `<ViewTransition>`
and applies the configuration to the inner DOM nodes.

```js
<ViewTransition name="hi">
  <div />
  <div />
</ViewTransition>
```

Becomes:

```html
<div vt-name="hi" vt-update="auto"></div>
<div vt-name="hi_1" vt-update="auto"></div>
```

I use `vt-` prefix as opposed to `data-` to keep these virtual
attributes away from user specific ones but we're effectively claiming
this namespace.

There are four triggers `vt-update`, `vt-enter`, `vt-exit` and
`vt-share`. The server resolves which ones might apply to this DOM node.
The value represents the class name (after resolving
view-transition-type mappings) or `"auto"` if no specific class name is
needed but this is still a trigger.

The value can also be `"none"`. This is different from missing because
for example an `vt-update="none"` will block mutations inside it from
triggering the boundary where as a missing `vt-update` would bubble up
to be handled by a parent.

`vt-name` is technically only necessary when `vt-share` is specified to
find a pair. However, since an explicit name can also be used to target
specific CSS selectors, we include it even for other cases.

We want to exclude as many of these annotations as possible.

`vt-enter` can only affect the first DOM node inside a Suspense
boundary's content since the reveal would cause it to enter but nothing
deeper inside. Similarly `vt-exit` can only affect the first DOM node
inside a fallback. So for every other case we can exclude them. (For
future MPA ViewTransitions of the whole document it might also be
something we annotate to children inside the `<body>` as well.) Ideally
we'd only include `vt-enter` for Suspense boundaries that actually
flushed a fallback but since we prepare all that content earlier it's
hard to know.

`vt-share` can be anywhere inside an fallback or content. Technically we
don't have to include it outside the root most Suspense boundary or for
boundaries that are inlined into the root shell. However, this is tricky
to detect. It would also not be correct for future MPA ViewTransitions
because in that case the shared scenario can affect anything in the two
documents so it needs to be in every node everywhere which is
effectively what we do. If a `share` class is specified but it has no
explicit name, we can exclude it since it can't match anything.

`vt-update` is only necessary if something below or a sibling might
update like a Suspense boundary. However, since we don't know when
rendering a segment if it'll later asynchronously add a Suspense
boundary later we have to assume that anywhere might have a child. So
these are always included. We collapse to use the inner most one when
directly nested though since that's the one that ends up winning.

There are some weird edge cases that can't be fully modeled by the lack
of virtual nodes.
2025-05-15 01:04:10 -04:00
Sebastian MarkbågeandGitHub 3f67d0857e [Fizz] Track whether we're in a fallback on FormatContext (#33194)
Removes the `isFallback` flag on Tasks and tracks it on the
formatContext instead.

Less memory and avoids passing and tracking extra arguments to all the
pushStartInstance branches that doesn't need it.

We'll need to be able to track more Suspense related contexts on this
for View Transitions anyway.
2025-05-15 00:06:06 -04:00
Sebastian MarkbågeandGitHub 96eb84e493 Claim the useId name space for every auto named ViewTransition (#33200)
This is a partial revert of #33094. It's true that we don't need the
server and client ViewTransition names to line up. However the server
does need to be able to generate deterministic names for itself. The
cheapest way to do that is using the useId algorithm. When it's used by
the server, the client needs to also materialize an ID even if it
doesn't use it.
2025-05-14 17:52:41 -04:00
Sebastian MarkbågeandGitHub 63d664b220 Don't consider Portals animating unless they're wrapped in a ViewTransition (#33191)
And that doesn't disable with `update="none"`.

The principle here is that we want the content of a Portal to animate if
other things are animating with it but if other things aren't animating
then we don't.
2025-05-14 17:50:56 -04:00
Jan KassensandGitHub d85f86cf01 Delete stray file (#33199)
Not sure where this was coming from.
2025-05-14 11:27:36 -04:00
Sebastian MarkbågeandGitHub 3a5b326d81 [Fiber] Trigger default indicator for isomorphic async actions with no root associated (#33190)
Stacked on #33160, #33162, #33186 and #33188.

We have a special case that's awkward for default indicators. When you
start a new async Transition from `React.startTransition` then there's
not yet any associated root with the Transition because you haven't
necessarily `setState` on anything yet until the promise resolves.
That's what `entangleAsyncAction` handles by creating a lane that
everything entangles with until all async actions are done.

If there are no sync updates before the end of the event, we should
trigger a default indicator until either the async action completes
without update or if it gets entangled with some roots we should keep it
going until those roots are done.
2025-05-13 16:10:28 -04:00
Sebastian MarkbågeandGitHub 59440424d0 Implement Navigation API backed default indicator for DOM renderer (#33162)
Stacked on #33160.

By default, if `onDefaultTransitionIndicator` is not overridden, this
will trigger a fake Navigation event using the Navigation API. This is
intercepted to create an on-going navigation until we complete the
Transition. Basically each default Transition is simulated as a
Navigation.

This triggers the native browser loading state (in Chrome at least). So
now by default the browser spinner spins during a Transition if no other
loading state is provided. Firefox and Safari hasn't shipped Navigation
API yet and even in the flag Safari has, it doesn't actually trigger the
native loading state.

To ensures that you can still use other Navigations concurrently, we
don't start our fake Navigation if there's one on-going already.
Similarly if our fake Navigation gets interrupted by another. We wait
for on-going ones to finish and then start a new fake one if we're
supposed to be still pending.

There might be other routers on the page that might listen to intercept
Navigation Events. Typically you'd expect them not to trigger a refetch
when navigating to the same state. However, if they want to detect this
we provide the `"react-transition"` string in the `info` field for this
purpose.
2025-05-13 16:00:38 -04:00