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
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# scala-js-snabbdom

A Scala.js port of [Snabbdom](https://github.com/snabbdom/snabbdom) (version 3.4.0).
A Scala.js port of [Snabbdom](https://github.com/snabbdom/snabbdom) (version 3.5.0).
8 changes: 5 additions & 3 deletions snabbdom/src/main/scala/snabbdom/init.scala
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,11 @@ object init {
if (oldVnode != vnode) {

cbs.update.foreach(hook => hook(oldVnode, vnode))
vnode.data.hook
.flatMap(_.update)
.foreach(hook => hook(oldVnode, vnode))

if (vnode.text.isEmpty || vnode.text != oldVnode.text)
vnode.data.hook
.flatMap(_.update)
.foreach(hook => hook(oldVnode, vnode))
Comment on lines +400 to +403
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.


vnode.text match {
case None =>
Expand Down