-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(hydration): Suspender returns Fragment with multiple DOM-nodes #4438
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10k
duration
usedJSHeapSize
filter-list
duration
usedJSHeapSize
hydrate1k
duration
usedJSHeapSize
many-updates
duration
usedJSHeapSize
replace1k
duration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-update
duration
usedJSHeapSize
todo
duration
usedJSHeapSize
update10th1k
duration
usedJSHeapSize
|
Size Change: +91 B (+0.15%) Total Size: 62 kB
ℹ️ View Unchanged
|
b917e40
to
42db9fa
Compare
42db9fa
to
9e7473e
Compare
@@ -277,6 +277,7 @@ export function diff( | |||
newVNode._flags |= isHydrating | |||
? MODE_HYDRATE | MODE_SUSPENDED | |||
: MODE_HYDRATE; | |||
newVNode._excess = [...excessDomChildren]; |
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.
An alternative to copying here would be to mark certain nodes i.e. we mark it with the oldVNode signature and then when we resume hydration in the initial src/diff/index.js
check we unlock it by checking. Or we start marking the DOM-node as consumed so we rely less on these null entries
This is an issue that presents itself when a lazy boundary returns a Fragment-like which results in an issue with our current
excessDomChildren
restoration. At this point in time we just takeoldDom
which amounts to us restoring The first of said Fragment-like wrapper. The current solution is a bit of a "quick one" to highlight a solution to the problem.The current solution however would introduce an issue when we have
This might however be acceptable, because React fails here as well