-
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
[Fiber] render boundary in fallback if it contains a new stylesheet during sync update #28965
[Fiber] render boundary in fallback if it contains a new stylesheet during sync update #28965
Conversation
Comparing: 0a0a5c0...8839e50 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
|
workInProgress.flags |= ShouldSuspendCommit; | ||
} else { | ||
const rootRenderLanes = getWorkInProgressRootRenderLanes(); | ||
if (!includesOnlyNonUrgentLanes(rootRenderLanes) && required) { |
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 don't really like introducing this concept of required and not-required resources. It also only gets read when you're rendering a new tree, not during an update; when you rendering a new tree, it's pretty much always fine to show a fallback, even if the render is synchronous.
The case where you might want to distinguish between "required" and "not required" resources is during a sync update, when the choice is between a stale resource or replacing the existing UI with a fallback (bad).
But that can be modeled during the waitForCommitToBeReady
phase by effectively assigning this resource a timeout of 0. I think that's the better strategy.
da0b480
to
946168d
Compare
946168d
to
af03a72
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
af03a72
to
13b9396
Compare
13b9396
to
1798c2c
Compare
1798c2c
to
27bf255
Compare
27bf255
to
8596091
Compare
8596091
to
68d05e4
Compare
68d05e4
to
3cf4ab1
Compare
…uring sync update When we implemented Suspensey CSS we had a heuristic that if the update was sync we would ignore the loading states of any new stylesheets and just do the commit. But for a stylesheet capability to be useful it needs to reliably prevent FOUC and since the stylesheet api is opt-in through precedence we don't have to maintain backaward compat (old stylesheets do not block commit but then nobody really renders them because of FOUC anyway) This update modifies the logic to put a boundary back into fallback if a sync update would lead to a stylesheet commiting before it loaded.
3cf4ab1
to
8839e50
Compare
…uring sync update (#28965) Updates Suspensey instances and resources to preload even during urgent updates and to potentially suspend. The current implementation is unchanged for transitions but for sync updates if there is a suspense boundary above the resource/instance it will be rendered in fallback mode instead. Note: This behavior is not what we want for images once we make them suspense enabled. We will need to have forked behavior here to distinguish between stylesheets which should never commit when not loaded and images which should commit after a small delay DiffTrain build for commit 217b2cc.
…uring sync update (#28965) Updates Suspensey instances and resources to preload even during urgent updates and to potentially suspend. The current implementation is unchanged for transitions but for sync updates if there is a suspense boundary above the resource/instance it will be rendered in fallback mode instead. Note: This behavior is not what we want for images once we make them suspense enabled. We will need to have forked behavior here to distinguish between stylesheets which should never commit when not loaded and images which should commit after a small delay DiffTrain build for [217b2cc](217b2cc)
Updates Suspensey instances and resources to preload even during urgent updates and to potentially suspend.
The current implementation is unchanged for transitions but for sync updates if there is a suspense boundary above the resource/instance it will be rendered in fallback mode instead.
Note: This behavior is not what we want for images once we make them suspense enabled. We will need to have forked behavior here to distinguish between stylesheets which should never commit when not loaded and images which should commit after a small delay