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
import: URL support #2002
Comments
This would help my team immensely. cc @usergenic |
@justinfagnani note that the issue here on the spec is still unresolved at WICG/import-maps#149. The concern remains implementing something that won't necessarily be in the spec. |
I think there are different options to implementing this, each with their own level of spec compliance.
|
Personally, I lean towards Option 1 since I think that that covers majority use case and does not have significant performance implications. I think that shooting for full spec compliance with a Mutation Observer on everything (Option 2) would introduce too much performance overhead for system.js to be a responsible choice in production systems. |
Option 1 would suit our needs as well. It would be great if we could think of an API that other code can use to resolve resources that are dynamically created, and have it not be specifically tied to SystemJS. |
Note that the other way to tackle these use cases is to simply implement a Ideally we should implement this as an extra for experimentation since we don't yet have a spec for this (although many are in agreement that it should exist). Node.js might actually even be able to be a first-mover on Code can then assume - const stylesheetURL = import.meta.resolve('./asset.css'); The biggest question right now around |
That sounds useful, but we'd still want |
@justinfagnani to understand the use case, are you referring to supporting eg - <link rel="stylesheet" href="import:systemjs"></link> where those templates are server rendered? In the case of client rendering I think a For server rendering, I can understand the use case though if that is what you are after. |
In conversations with Guy, we have been leaning towards the following format for this: <script type="systemjs-module" src="import:name-of-module"></script> The |
It would be nice (for Vue/Angular templates) to include support of html-files (to do this without bundlers I had to use gulp-html-to-js), |
An initial implementation of |
@joeldenning Ok |
Whether SystemJS would support internal
import:
URLs is still uncertain, but if it does, it would likely be aif (url.startsWith('import:')) url = url.slice(7);
sort of approach.The spec issue tracking this is WICG/import-maps#149.
The text was updated successfully, but these errors were encountered: