You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fizz] Hoist hoistables to each row and transfer the dependencies to future rows (facebook#33312)
Stacked on facebook#33311.
When a row contains Suspense boundaries that themselves depend on CSS,
they will not resolve until the CSS has loaded on the client. We need
future rows in a list to be blocked until this happens. We could do
something in the runtime but a simpler approach is to just add those CSS
dependencies to all those boundaries as well.
To do this, we first hoist the HoistableState from a completed boundary
onto its parent row. Then when the row finishes do we hoist it onto the
next row and onto any boundaries within that row.
Copy file name to clipboardExpand all lines: packages/react-server/src/ReactFizzServer.js
+33-5Lines changed: 33 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,8 @@ type LegacyContext = {
236
236
typeSuspenseListRow={
237
237
pendingTasks: number,// The number of tasks, previous rows and inner suspense boundaries blocking this row.
238
238
boundaries: null|Array<SuspenseBoundary>,// The boundaries in this row waiting to be unblocked by the previous row. (null means this row is not blocked)
239
+
hoistables: HoistableState,// Any dependencies that this row depends on. Future rows need to also depend on it.
240
+
inheritedHoistables: null|HoistableState,// Any dependencies that previous row depend on, that new boundaries of this row needs.
239
241
together: boolean,// All the boundaries within this row must be revealed together.
240
242
next: null|SuspenseListRow,// The next row blocked by this one.
241
243
};
@@ -790,6 +792,10 @@ function createSuspenseBoundary(
0 commit comments