Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back HTML Imports using link #18

Open
vricop opened this issue Oct 21, 2022 · 0 comments
Open

Bring back HTML Imports using link #18

vricop opened this issue Oct 21, 2022 · 0 comments

Comments

@vricop
Copy link

vricop commented Oct 21, 2022

Declarative Shadow Dom looks like a great idea but I'm missing something that is mentioned nowhere. This new feature seems useless to me unless we bring back html imports. Does anyone though about this? One cool think about libraries like react is the possibility to create components in separate files and importing/consuming them on demand.

Without <link rel="import" href="/path/to/imports/stuff.html"> we have to define all our templates in the same html file where we define our web component with JS.

The idea is cool but I don't get it, what's the gain if we cannot define html files and import them in js or html?

Html imports were deprecated: https://web.dev/imports/. If I'm not mistaken this was because there was no way to define components declaratively. Declarative Shadow Dom seems to fix this, isn't it?

This is vital for SSR, without this Web Components won't probably take off.

I think html imports make sense. It's even one of the points stated in this article: https://web.dev/imports/#why-imports

"but you're saying I need JS to load HTML? That doesn't seem right."

See the irony? The web's most basic content, HTML, requires the greatest amount of effort to work with. Fortunately, Web Components are here to get us back on track

@vricop vricop changed the title Import templates using link Bring back HTML Imports using link Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant