[DevTools] Handle dehydrated Suspense boundaries#34196
[DevTools] Handle dehydrated Suspense boundaries#34196eps1lon merged 2 commits intofacebook:mainfrom
Conversation
80efaa4 to
3a14dff
Compare
|
Comparing: 431bb0b...223a52c Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
| return !rootState.isDehydrated; | ||
| case SuspenseComponent: | ||
| const suspenseState = fiber.memoizedState; | ||
| return suspenseState === null || suspenseState.dehydrated === null; |
There was a problem hiding this comment.
I think maybe you should do == null to cover the case for code before we added the dehydrated property, other suspended in older React versions will be treated as dehydrated.
There was a problem hiding this comment.
I thought checking for OffscreenComponent earlier ensures this is only checked for modern Suspense? Or is the dehydrated in #16346 not always set for modern Suspense?
There was a problem hiding this comment.
Basically, this is only handling dehydrated boundaries for modern Suspense. I haven't checked yet how dehydrated Suspense is handled in legacy Suspense.
c3971d5 to
a2e851e
Compare
a2e851e to
223a52c
Compare
|
|
||
| const nextProps = workInProgress.pendingProps; | ||
| const prevState = workInProgress.memoizedState; | ||
| const prevState: RootState = workInProgress.memoizedState; |
There was a problem hiding this comment.
Drive-by when I looked through existing usages of memoized state of HostRoot. memoizedState is any by default so this just increases Flow coverage.
The Fibers of dehydrated Suspense boundaries have no child Offscreen Fiber (yet).
We now handle newly hydrated boundaries in the mount and update path.
This doesn't handle Activity yet which also doesn't have children when dehydrated yet.
Stacked on #34199