-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[Fizz] Track postponed holes in the prerender pass #27317
Commits on Aug 31, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 57488c6 - Browse repository at this point
Copy the full SHA 57488c6View commit details -
I renamed startWork to startRender and added a startPrerender. Later, we'll probably add a startResume. This just adds a non-null Map. This is a signal to the runtime to track postponed holes. Ideally this would be static but it's not worth the forking that would require. Especially since this is just a cost when you postpone other than a bit extra code.
Configuration menu - View commit details
-
Copy full SHA for d814510 - Browse repository at this point
Copy the full SHA d814510View commit details -
Return postponed state when some postponed were tracked
Todo this we need to stash the rootFormatContext on the request. It's unfortunate that this is state that's not needed for regular rendering.
Configuration menu - View commit details
-
Copy full SHA for 9286b09 - Browse repository at this point
Copy the full SHA 9286b09View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e4869f - Browse repository at this point
Copy the full SHA 5e4869fView commit details -
Track the key path on the SuspenseBoundary
This is unfortunate that we need to add this to the render path in general but this doesn't really cost anything extra in terms of allocations since this object would live anyway so it's an extra field.
Configuration menu - View commit details
-
Copy full SHA for d58d26d - Browse repository at this point
Copy the full SHA d58d26dView commit details -
For now this only tracks inside boundaries but it's set up to handle holes in the root too. We now need a status field on the boundary because pendingTasks === 0 no longer implies that a boundary is complete.
Configuration menu - View commit details
-
Copy full SHA for 3f0874a - Browse repository at this point
Copy the full SHA 3f0874aView commit details -
Encode postponed holes into a resumable path tree
This creates a tree that we can follow when replaying to find those holes. This flips the tree and encodes the ids at this point.
Configuration menu - View commit details
-
Copy full SHA for e8c8152 - Browse repository at this point
Copy the full SHA e8c8152View commit details -
Eagerly assign ids to postponed segments or boundaries
Because we don't flush the stream until later after we've returned we need to assign these points an ID early so that we can write them in the resume payload.
Configuration menu - View commit details
-
Copy full SHA for e96bb09 - Browse repository at this point
Copy the full SHA e96bb09View commit details -
Eagerly encode the serializable nodes
Since we're now assigning IDs eagerly to postponed boundaries and segments we can encode them into their serialized form eagerly. Instead of doing a second pass at the end.
Configuration menu - View commit details
-
Copy full SHA for 019dd90 - Browse repository at this point
Copy the full SHA 019dd90View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7733a15 - Browse repository at this point
Copy the full SHA 7733a15View commit details