Skip to content

Update to match snabbdom 3.5.0 #29

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

armanbilge
Copy link
Collaborator

Not really sure what I'm doing, so please review carefully :)

Comment on lines +408 to +411
if (vnode.text.isEmpty || vnode.text != oldVnode.text)
vnode.data.hook
.flatMap(_.update)
.foreach(hook => hook(oldVnode, vnode))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT in our case this becomes an optimization actually, since we were running these update hooks for text nodes already.

Comment on lines 1359 to +1360
assertEquals(result1.length, 1)
assertEquals(result2.length, 1)
assertEquals(result2.length, 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is the optimization kicking-in, I believe. It only affects the text node, since the text is unchanged in this instance.

@armanbilge armanbilge closed this May 29, 2022
@armanbilge armanbilge reopened this May 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 29, 2022

Codecov Report

Merging #29 (c80fa90) into main (21499a5) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   86.16%   86.18%   +0.02%     
==========================================
  Files          19       19              
  Lines         542      543       +1     
  Branches       60       53       -7     
==========================================
+ Hits          467      468       +1     
  Misses         75       75              
Impacted Files Coverage Δ
snabbdom/src/main/scala/snabbdom/init.scala 95.31% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21499a5...c80fa90. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants