Code Monkey home page Code Monkey logo

Comments (7)

frabbit avatar frabbit commented on August 25, 2024

the click listener is executed everytime i click on the button (the label is correctly updated)

from doom.

frabbit avatar frabbit commented on August 25, 2024

it works correctly if i set it to a different listener, maybe that's the reason why this error wasn't revealed.

from doom.

fponticelli avatar fponticelli commented on August 25, 2024

That's right, the patching mechanism will not remove attributes or events that are not explicitly indicated. You can pass to the left case "click" => null (or an empty handler) and it should work.

from doom.

frabbit avatar frabbit commented on August 25, 2024

hmm, is there any reason why you don't remove them? Don't you compare the vdom and generate remove patches? I'm not sure, but i can imagine that this behaviour leads to nasty bugs.

from doom.

fponticelli avatar fponticelli commented on August 25, 2024

The reason is that the real doms has quite literally hundreds of attributes and properties and the VDOM knows about the things that exist but not the things that were existing in the last update. So to be clear I do not compare the old VDOM with the new one. I compare the VDOM with the actual DOM. I tried VDOM to VDOM before and the surprises were even worse. The hidden requirement is that if you have symmetrical elements with the same name they should also bring the same collection of attributes. I wish there was a more formal way to enforce that.

from doom.

frabbit avatar frabbit commented on August 25, 2024

what kind of issues did you run in when comparing VDOM with VDOM?

from doom.

fponticelli avatar fponticelli commented on August 25, 2024

The main problem was with components that changed their own attributes and HTML internally (bootstrap components and so on). In that case the old VDOM didn't look at all like the current DOM. There might be a sweet spot where patches to VDOM and patches to DOM can live in harmony.

from doom.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.