Coder Social home page Coder Social logo

Comments (6)

paf31 avatar paf31 commented on July 22, 2024

I tried to get this working, but it's very difficult to see what's going on inside virtual-dom, and I haven't been able to figure it out yet.

I'm trying to follow this, but the diff doesn't seem to be working. It doesn't seem to recognize that two widgets are of the same type, and keeps trying to initialize the new version rather than update it. Maybe the id field is the key, but I'm not sure.

https://gist.github.com/Raynos/1bff2123314d1046fb07

If anyone who is familiar with virtual-dom can help, I'd really appreciate it. @garyb any ideas?

I'll try to wrap this up tomorrow.

from purescript-halogen.

natefaubion avatar natefaubion commented on July 22, 2024

I think I saw it here https://github.com/Matt-Esch/virtual-dom/blob/master/vdom/update-widget.js

from purescript-halogen.

garyb avatar garyb commented on July 22, 2024

I think our widget/widgetImp needs to accept a name parameter (or generate one internally) that is set when instantiating a Widget, and then yes, they will be compared by id rather than init-function equality. So basically, for diffing, name+id is used, otherwise init.

The use of key may also help, but I'm not sure how that fits in with widgets.

from purescript-halogen.

jdegoes avatar jdegoes commented on July 22, 2024

Definitely a priority for us given our dependency on ace, echarts, etc.

from purescript-halogen.

paf31 avatar paf31 commented on July 22, 2024

I've updated the widget function:

  • It now takes a name and an id
  • It now returns a strongly-typed Widget
  • It now has access to the driver function in the Renderer.

from purescript-halogen.

garyb avatar garyb commented on July 22, 2024

👍

from purescript-halogen.

Related Issues (20)

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.