You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define a new HTML content attribute, export or exportname or namedexport (and defaultexport?) or something similar that allows elements to be exported without any inline scripts.
<!-- module.html --><divnamedexport="content">
Warning - this might hurt.
</div>
We've definitely had discussions about this possibility, since it seems very natural to enable import/export declaratively. One thing we are losing with HTML Modules, which was available via HTML Imports is the declarative import via link[rel=import]. It's not a huge loss, since static module imports can be readily identified in top-level script texts almost as easily. Our approach was "wait and see", as declarative support can be added later with no backward compatibility issues.
Do you have thoughts on how import/export might work with template? If you think about template as able to import an external html module, I think things start to get interesting...
This would be nice if it works without scripting enabled too as we could have a nice fallback that is downloaded only if scripting isn't enabled rather than shipping it to everyone:
This is definitely an interesting issue. However there's also some overlap I feel with the declarative custom elements strawman. Given that, it might be advantageous to defer this until after HTML modules have landed. Otherwise I feel there is risk that the whole thing becomes blocked. From what I can tell I don't feel this proposal would be affected by any of the choices already made in HTML modules (meaning it could be added later).
Reacted by Domenic Denicola, Travis Leithead and Luca Colonnello
Activity
travisleithead commentedon Jan 17, 2019
We've definitely had discussions about this possibility, since it seems very natural to enable import/export declaratively. One thing we are losing with HTML Modules, which was available via HTML Imports is the declarative import via
link[rel=import]. It's not a huge loss, since static module imports can be readily identified in top-level script texts almost as easily. Our approach was "wait and see", as declarative support can be added later with no backward compatibility issues.Do you have thoughts on how import/export might work with
template? If you think about template as able to import an external html module, I think things start to get interesting...kenchris commentedon Jan 22, 2019
Instead of using
we probably want something similar to named slots
kenchris commentedon Jan 22, 2019
Travis Leithead (@travisleithead) maybe something like:
Jamesernator commentedon Jan 25, 2019
This would be nice if it works without scripting enabled too as we could have a nice fallback that is downloaded only if scripting isn't enabled rather than shipping it to everyone:
matthewp commentedon Mar 6, 2019
This is definitely an interesting issue. However there's also some overlap I feel with the declarative custom elements strawman. Given that, it might be advantageous to defer this until after HTML modules have landed. Otherwise I feel there is risk that the whole thing becomes blocked. From what I can tell I don't feel this proposal would be affected by any of the choices already made in HTML modules (meaning it could be added later).
domenic commentedon Mar 6, 2019
I tend to agree this seems additive, and it's worth getting the foundations down first.
travisleithead commentedon Jan 8, 2020
Closing this issue and opening a linking issue in the webcomponents repo. (WICG/webcomponents#863)