Comments (9)
@vvvkor can you say a bit more about this and how it would differ from [reef-ignore]
?
from reef.
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.
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.
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.
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.
Understood. Anyway, thank you for consideration.
from reef.
@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.
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.
Closing based on our conversation
from reef.
Related Issues (20)
- support disabled and readonly attributes with @ syntax? HOT 5
- jsdoc issue HOT 2
- Listeners remove html attributes HOT 4
- Event functions with parameters HOT 3
- Rename store(), setters() to align with industry norms (breaking change) HOT 1
- Add a way to ignore certain elements when diffing the DOM HOT 1
- How to read a signal's data built via a store? HOT 5
- Add getter methods to store() object
- tbody element not supported as a component root HOT 3
- onclick attribute removed by reef HOT 3
- Reef types HOT 2
- to do demo bug
- Component composition HOT 2
- Second event handler not correctly registered HOT 6
- 13.0.3 has broken attributes on html HOT 2
- Is the store function doesn't work with component? HOT 1
- Valid HTML5 custom elements render once but do not update HOT 1
- Misunderstanding or bug? HOT 1
- Web Component rendering issues with signal and/or component HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reef.