Code Monkey home page Code Monkey logo

Comments (9)

cferdinandi avatar cferdinandi commented on June 2, 2024

@vvvkor can you say a bit more about this and how it would differ from [reef-ignore]?

from reef.

vvvkor avatar vvvkor commented on June 2, 2024

Sorry for being unclear. Maybe I have missed something.
As far as I can see, contents of the node with [reef-ignore] will not be reactive, no updates on render.
I thought that it would be good for nodes with native interactivity to have an option to render updates of inner contents, and still keep the attributes of the node itself to preserve its open/closed state.
What I suggest is to skip diffing of attributes but continue to diff contents of nodes marked with [reef-keep] or something like that.

from reef.

cferdinandi avatar cferdinandi commented on June 2, 2024

Interesting! Let me think on this a bit. I'd be curious to see if it works as expected with things like the dialog element, DOM libraries, etc.

My gut tells me that after those are rendered, you generally want some other script to handle them in their entirety, but I'm open to being wrong.

from reef.

vvvkor avatar vvvkor commented on June 2, 2024

Seems to work correctly in major browsers with details and dialog.
Demo
More testing is required, of course.

Whether you want to control them with some other script - probably depends on project requirements. But it may be convenient to be able to work reactively with the same data source within interactive elements. For example, to edit some item in modal dialog. Looks like Reef with this little tweak can handle it without additional scripts.

from reef.

cferdinandi avatar cferdinandi commented on June 2, 2024

If you want to dynamically render the contents of a some nested content, you can technically create a new component() for that element or manually run render() as needed (I've done this on a project or two).

While I do see the value in what you're suggesting, it feels like an edge case that can be readily solved with the existing tools and that adds more complexity and "places for things to go wrong" in the code base.

I'm leaning towards not adding support for it.

from reef.

vvvkor avatar vvvkor commented on June 2, 2024

Understood. Anyway, thank you for consideration.

from reef.

cferdinandi avatar cferdinandi commented on June 2, 2024

@vvvkor As always, though, I'm open to being persuaded otherwise! I'm just trying to weigh a few factors before adding things.

from reef.

vvvkor avatar vvvkor commented on June 2, 2024

Reef's ideology is to be small and simple. And this is what I like about it. Pleasure to dig in.
So, I'm not going to insist. You are damn right to be careful before adding features for edge cases.

from reef.

cferdinandi avatar cferdinandi commented on June 2, 2024

Closing based on our conversation

from reef.

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.