-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Provide solution to long standing memleak #4853
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
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10kduration
usedJSHeapSize
filter-listduration
usedJSHeapSize
hydrate1kduration
usedJSHeapSize
many-updatesduration
usedJSHeapSize
replace1kduration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-updateduration
usedJSHeapSize
tododuration
usedJSHeapSize
update10th1kduration
usedJSHeapSize
|
|
Size Change: +103 B (+0.22%) Total Size: 47.6 kB
ℹ️ View Unchanged
|
062d750 to
700495a
Compare
2de3d28 to
2c711b4
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
|
|
||
| function removeOriginal(vnode, detachedParent, originalParent) { | ||
| if (vnode && originalParent) { | ||
| if (typeof vnode.type == 'string') { |
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.
For DOM nodes we need to revalidate the props so that we re-attach event-listeners which are deleted by unmount as we do dom._listeners = undefined
compat/src/suspense.js
Outdated
| suspendedVNode._component._parentDom, | ||
| suspendedVNode._component._originalParentDom | ||
| ); | ||
| if (!c._vnode._children) { |
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.
It's now possible in non hydration suspense that we've cleared _children
63b4b37 to
2f5a9b8
Compare
c34bd59 to
2a72320
Compare
| } | ||
|
|
||
| vnode._component = vnode._parent = vnode._dom = UNDEFINED; | ||
| vnode._dom = vnode._component = vnode._parent = NULL; |
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 stopped removing the reference to children because it has perf issues in the micro benchmarks, going to verify this further
228462c to
ee2dc7d
Compare
337944a to
d17b911
Compare
dafa9e0 to
05d8984
Compare
05d8984 to
1aaaa3d
Compare
|
Great job Jovi, thank you |
We can't safely remove
_listenersas that would mean we are risking suspense-hydration breaking 😅 basically during suspense we store the vnodes which means that old and new vnode will always be equal, if we want to remove_listenersas well we'll have to probably stop storing our virtual DOM tree when it's a mount and store the previous variant when it's an update. This would however mean that our mutative approach is a bad thought.EDIT: I solved the
_listenersissueResolves #3668