I was going through the shadow parts spec, and it seems to me like a better alternative to complex part-forwarding micro-syntaxes (albeit maybe a bit more simplistic?) could be just to allow multiple ::part() selectors.
So you would do ::part(filepicker)::part(button) rather than ::part(filepicker-button) or what not. Whether (or which) parts or a sub-component are exposed could still be controlled the same way exportparts works.
Seems to me the model would be much more consistent. Also, this is much easier (seems to me, at least, while I've been poking at this) implementation-wise, since you don't need to concatenate part names around to figure out if a part matches from a given tree. Stuff would just work.
Has this approach been considered?
// cc @fergald @rniwa @tabatkins
I was going through the shadow parts spec, and it seems to me like a better alternative to complex part-forwarding micro-syntaxes (albeit maybe a bit more simplistic?) could be just to allow multiple
::part()selectors.So you would do
::part(filepicker)::part(button)rather than::part(filepicker-button)or what not. Whether (or which) parts or a sub-component are exposed could still be controlled the same wayexportpartsworks.Seems to me the model would be much more consistent. Also, this is much easier (seems to me, at least, while I've been poking at this) implementation-wise, since you don't need to concatenate part names around to figure out if a part matches from a given tree. Stuff would just work.
Has this approach been considered?
// cc @fergald @rniwa @tabatkins