-
Notifications
You must be signed in to change notification settings - Fork 49k
[Fizz] Wrap revealCompletedBoundaries in a ViewTransitions aware version #33293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…n 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.
7b9c112
to
5425556
Compare
…io that might need it We don't know if we'll actually outline a boundary to need this but just in case.
ffe59f1
to
a38be02
Compare
window['$RV'] = revealCompletedBoundariesWithViewTransitions.bind( | ||
null, | ||
revealCompletedBoundaries, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we’d want to make sure static functions like this gets inlined but since this function will be pass as first call into startViewTransition and reused in multiple places it needs to be a separate function anyway.
null, | ||
// eslint-disable-next-line dot-notation | ||
window['$RV'], | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could optimize this by special casing when it goes together with the complete boundary instruction but it’s not really much difference atm so not worth it.
a38be02
to
fd248c9
Compare
@@ -896,6 +900,7 @@ export function getChildFormatContext( | |||
} | |||
|
|||
function getSuspenseViewTransition( | |||
resumableState: ResumableState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally thought I'd do it in both branches but then realized that I could do it only if we ever render the fallback.
…ion (#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. DiffTrain build for [6060367](6060367)
Follow up to #33293. This solves a race condition when boundaries are added to the batch after the `startViewTransition` call. This doesn't matter yet but it will once we start assigning names before the `startViewTransition` call. A possible alternative solution might be to ensure the names are added synchronously in the event that adds to the batch. It's possible to keep adding to a batch until the snapshot has happened.
Follow up to #33293. This solves a race condition when boundaries are added to the batch after the `startViewTransition` call. This doesn't matter yet but it will once we start assigning names before the `startViewTransition` call. A possible alternative solution might be to ensure the names are added synchronously in the event that adds to the batch. It's possible to keep adding to a batch until the snapshot has happened. DiffTrain build for [91ac1fe](91ac1fe)
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.