[Fizz] Support nested enter/exit ViewTransition animations - #36917
Conversation
|
Comparing: 689a4fa...025afa2 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show |
5604455 to
d678a75
Compare
| props.parentEnter !== undefined | ||
| ? getViewTransitionClassName(props.default, props.parentEnter) | ||
| : undefined, | ||
| props.parentExit !== undefined | ||
| ? getViewTransitionClassName(props.default, props.parentExit) | ||
| : undefined, | ||
| // A ViewTransition with an onParentEnter/onParentExit handler but no class | ||
| // still relays the activation to its descendants, so the relay must continue | ||
| // through it even though the handler itself emits no annotation. | ||
| props.onParentEnter != null, | ||
| props.onParentExit != null, |
There was a problem hiding this comment.
Should these be gated on the feature flag?
| htmlElement.getAttribute('vt-parent-enter') || | ||
| htmlElement.getAttribute('vt-parent-exit') |
There was a problem hiding this comment.
Prob missing the feature flag?
| // Relay the exit to nested ViewTransitions that opted in | ||
| const relayExitElements = | ||
| exitElement.querySelectorAll('[vt-parent-exit]'); | ||
| for (let j = 0; j < relayExitElements.length; j++) { | ||
| applyViewTransitionName(relayExitElements[j], 'vt-parent-exit'); | ||
| } |
There was a problem hiding this comment.
Do we have the infra to have an experimental version?
There was a problem hiding this comment.
It doesn't look like it. So the instruction set will always be able to handle the annotations, but there won't be any outside of experimental
4c2cfed to
2b9e4ef
Compare
2b9e4ef to
6665441
Compare
Adds vt-parent-enter/vt-parent-exit SSR scope propagation and client hydration support for the parent enter/exit props.
6665441 to
7fe3a87
Compare
|
Can you double check why this hits the stacktrace limit earlier now? Iirc Meta hits those limits regularly. We want to pay extra attention if this somehow doubles the stackframes used per Component. |
|
@eps1lon Ran some more comparisons locally. This isn't increasing the number of frames, its adding a bit of overhead to the functions which bumps the amount of frames needed to overflow slightly in the extreme recursion case. In one local test it overflowed at 537 levels vs 545 before (so certainly not double), but updated handling in #36977 allows recovering, and that change should be a general improvement for the Meta case, especially based on the old test TODO. cc @hoxyq that these two PRs will need monitoring when syncing in |
eps1lon
left a comment
There was a problem hiding this comment.
Thanks for checking! I couldn't spot if we added frames so this was confusing at first. But makes sense that there's also a constant factor wrt to frame size.
Ran into this test failure as part of #36917 - it seems that the added code was just enough to increase stack size and fail the deep tree recovery test in CI. Looking into that, there appears to be a gap here with retries, including a TODO test case for the scenario. Fizz recovers from stack overflows in extremely deep trees by catching the first overflow in the `renderNode` trampoline and spawning a continuation task. That continuation is retried via `retryRenderTask β retryNode`, which has no trampoline above it. So if the remaining tree still doesn't fit in one fresh stack, the overflow was treated as a fatal error instead of recovering again. This fix re-schedules the task when a retried render overflows but `task.node` advanced (proving forward progress was made). If this is a real in-component overflow, `task.node` doesn't advance and we still fail. The existing test used `n={1000}`, which only required one recovery round and didn't catch this gap in source mode. It's updated to `n={1200}`, which reliably requires multiple recovery rounds.
Ran into this test failure as part of #36917 - it seems that the added code was just enough to increase stack size and fail the deep tree recovery test in CI. Looking into that, there appears to be a gap here with retries, including a TODO test case for the scenario. Fizz recovers from stack overflows in extremely deep trees by catching the first overflow in the `renderNode` trampoline and spawning a continuation task. That continuation is retried via `retryRenderTask β retryNode`, which has no trampoline above it. So if the remaining tree still doesn't fit in one fresh stack, the overflow was treated as a fatal error instead of recovering again. This fix re-schedules the task when a retried render overflows but `task.node` advanced (proving forward progress was made). If this is a real in-component overflow, `task.node` doesn't advance and we still fail. The existing test used `n={1000}`, which only required one recovery round and didn't catch this gap in source mode. It's updated to `n={1200}`, which reliably requires multiple recovery rounds. DiffTrain build for [689a4fa](689a4fa)
Adds SSR support for nested parentEnter/parentExit View Transitions. Fizz now emits vt-parent-enter/vt-parent-exit annotations during streaming, and the client picks them up on hydration, so nested enter/exit animations work for Suspense reveals. DiffTrain build for [8384090](react@8384090)
Adds SSR support for nested parentEnter/parentExit View Transitions. Fizz now emits vt-parent-enter/vt-parent-exit annotations during streaming, and the client picks them up on hydration, so nested enter/exit animations work for Suspense reveals. DiffTrain build for [8384090](react@8384090)
Adds SSR support for nested parentEnter/parentExit View Transitions. Fizz now emits vt-parent-enter/vt-parent-exit annotations during streaming, and the client picks them up on hydration, so nested enter/exit animations work for Suspense reveals. DiffTrain build for [8384090](react@8384090)
Adds SSR support for nested parentEnter/parentExit View Transitions. Fizz now emits vt-parent-enter/vt-parent-exit annotations during streaming, and the client picks them up on hydration, so nested enter/exit animations work for Suspense reveals. DiffTrain build for [8384090](react@8384090)
Resolves the semantic conflict between the open-tag fusion commit and react#36917: the new vt-parent-enter/vt-parent-exit attributes now emit from viewTransitionAttributesToString (as part of the fused open tag) instead of the pushViewTransitionAttributes wrapper, where the auto-merge had stranded them without a viewTransition binding. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds SSR support for nested parentEnter/parentExit View Transitions. Fizz now emits vt-parent-enter/vt-parent-exit annotations during streaming, and the client picks them up on hydration, so nested enter/exit animations work for Suspense reveals.