-
Notifications
You must be signed in to change notification settings - Fork 10
What if we used an attribute instead of a shadow-root element? #18
Comments
Interested in this syntax, so if this attribute was set on an element, it would expect a After the insertion of the Shadow Root, would it then remove the Then, after the Shadow Root is attached, you'd update the Shadow DOM via through it's imperative API? I'm just trying to get my head around this, not only from this lib's perspective, but also as something to potentially influence spec in future. |
Yes. I think we need to have an answer for this, but we don't need to implement it for a first iteration.
This is the problem I'm thinking about. I have no idea how to get around this yet, unfortunately. |
So I was mucking around with a demo of this. Syntax feels really nice - it uses the The rehydration script isn't very specific to the attribute syntax proposed here, it's more to deal with the There's also a few quirks which make it feel a bit clunky e.g. the way I've done default inside the placeholder nodes feels pretty unintuitive when writing it out, but not sure on a better syntax...? Plus also the need to write out |
This sounds awesome! I wouldn't worry too much about ergonomics or perf at this point. Having something that covers the spec means we can iterate on the niceness.
Is this pointing out the fact that the spec has opted for verbosity over a possibly more ergonomic approach, or does this have to do something with the algorithm here? |
More to do with the algorithm I believe i.e. it would be nice to be able to just write: <h3><span slot="name">John Doe</span></h3> and when splitting in light + shadow you can infer that the existence and position of |
@treshugart what're your thoughts on this? I feel like this is a better position than what we've got now, do you want me to chuck it into a PR? Also, thoughts on using |
Agree. Go for it!
This is a tough one. If we think that by having a composed shadow root that it should always be If we go with |
Nice! I'll put one together. IMO |
FYI haven't forgotten about this, just haven't had a change to make a PR. Should have some time early next week though |
So given the recent discussions and what we've lightly proposed in whatwg/dom#510 (comment), I think However, I want to implement that proposal in full. Meaning, I want For the dom encapsulation aspect, I think we might be able to do similar to what we're doing now because it's currently only rehydrating if I think what I'm getting at (still fleshing out) is that we add another mode (CSS only) via |
@treshugart given it looks like Declarative Shadow DOM is looking like I think the |
I reckon go with a pf for the standards approach. As much as it sucks, alignment with that is better than divergence without a native approach. We'll know more after TPAC. I know someone is planning on bringing up our proposal (https://gist.github.com/treshugart/dafb15f613bb7664d451f582da512f63) at TPAC. Not sure if it will have much effect, though. 🤞 |
I'm going to close this now in favour of the current node approach. |
This would replace #17.
Would rehydrate to:
To make it compatible with the current imperative API:
open
but that's not really spec compliant. Thanks Apple.The text was updated successfully, but these errors were encountered: