-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix bailouts breaking select value setting #4738
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
base: main
Are you sure you want to change the base?
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: +255 B (+0.32%) Total Size: 78.8 kB
ℹ️ View Unchanged
|
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/diff/index.js:590
- [nitpick] Consider using strict equality (===) when comparing 'nodeType' to 'select' to prevent potential type coercion issues.
if (nodeType == 'select') {
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.
LGTM, seems like a reasonable fix, though the defer
is unfortunate.
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.
Reasonable fix but pretty rough...
I'm almost wondering if we can suggest that be handled in user land instead. It's not a super niche scenario but it should be pretty easy to handle in app code
419423e
to
9cba734
Compare
Resolves #4737
The problem as seen in the test and reproduction is that we are doing this diff in two runs, the first runbeing the one where we change the select value, we descend one level due to a bail (memo) and we bubble back up to the
setProperty
call. ThissetProperty
call relies on theselected
option being mounted, which is not the case this will happen in the second run.To counteract this edge case which is increasingly likely to happen with the bail we implement in signals we defer the property setting to happen post-diff.