Skip to content

Commit

Permalink
Start prerendering Suspense retries immediately (#30934)
Browse files Browse the repository at this point in the history
When a component suspends and is replaced by a fallback, we should start
prerendering the fallback immediately, even before any new data is
received. During the retry, we can enter prerender mode directly if
we're sure that no new data was received since we last attempted to
render the boundary.

To do this, when completing the fallback, we leave behind a pending
retry lane on the Suspense boundary. Previously we only did this once a
promise resolved, but by assigning a lane during the complete phase, we
will know that there's speculative work to be done.

Then, upon committing the fallback, we mark the retry lane as suspended
— but only if nothing was pinged or updated in the meantime. That allows
us to immediately enter prerender mode (i.e. render without skipping any
siblings) when performing the retry.

DiffTrain build for commit d6cb4e7.
  • Loading branch information
acdlite committed Sep 11, 2024
1 parent 9b5d5c3 commit f9e2396
Show file tree
Hide file tree
Showing 14 changed files with 1,547 additions and 940 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.0.0-native-fb-a5a7f106-20240910
19.0.0-native-fb-d6cb4e77-20240911
Loading

0 comments on commit f9e2396

Please sign in to comment.