-
Notifications
You must be signed in to change notification settings - Fork 375
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
without .html in link rel="import" and href in web component #971
Comments
This is a particular case of |
Hi sashafirsov. thank you for feedback. But... what do you think of this idea? without .html in link rel="import" and href in web component? |
@codehangen , I like the idea but it has to be extended in order to be useful as connecting external resource with local content. If you along with URL would provide the local component name(s) mapping to declared name(s) in external HTML, that would be even more useful. Similar to import maps or JS import with mapping external export to local import. Now about link which would define the custom element(s). For JS, there is no need to import as there is a script tag for that. If link points to HTML, it would have define CE as Declarative Custom Element or HTML with JS for custom element definitions. If you want to load HTML with JS, you need to count on current resurrection of HTML include proposal. Whether the HTML would have the web component(s) registration or just some JS, is irrelevant to web components themselves. HTML without JS could define CE as Declarative Custom Element. The proposal is not yet shaped. So your proposal has a dependency on this standard to be. Or you had in mind different way of declaring CE? There is a row of alternative proposals of light version of CE : or DCE For both JS use protocol is in baking. |
Hi sashafirsov, so thank you for feedback.
yes, exactly. so I was thinking about this idea.
I was thinking about this idea too. |
I would not count it as a good argument. The |
Hi sashafirsov, so thank you for the feedback.
so... what do you think of this idea? it is possible? |
@codehangen , IMO yes, it is possible. The As stated the extension is not relevant, you could load JS content even if it has .png extension or without extension completely but returned by server with "application/javascript" content type. The proposal need to be accompanied by content type for Declarative Custom Element(DCE) as html( not sure what content type) or html document(application/html) with multiple custom elements definitions. PS. I am same wonderer in the standards as you are and do not have mush background to advise how to pursue further. PPS. The ability to load web component via declarative definition by URI is a requirement for Declarative Web Application stack which I am working on at the moment. The URI could refer as single DCE definition as multiple. It is a straight match to JS es6 module with default export and named ones. The import you proposing has to cover all necessary use cases
|
Hi sashafirsov, again, thanks for the feedback.
but what did you mean by that? |
@codehangen, take the analog for import JS with some object inside ( i.e. custom element with associated tag ). Same with import HTML as custom elements. The tags inside should not pollute the caller namespace. In order to be consumed by caller For import of custom element it would need similar possibility: That way you are assured that whatever Custom Element tag chosen within What about more than one Custom Element and tags are served by It would need the syntax siminal to ESM import { MyComponent as ImportedComponent, AnotherComponent as Imported2} from "some.js"; Of course in HTML syntax. |
Hi everyone.
I would like to know if there would be a possibility to create a link rel="import" href= without .html in web component
before_example.html
after_example.html
why?
there are cdn's that don't allow to have .html files in the web component as cdnjs
The text was updated successfully, but these errors were encountered: