-
Notifications
You must be signed in to change notification settings - Fork 27
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
Module Import Headers #61
Comments
This is a good topic to discuss, and we're discussing it in some other issues here, such as #24, e.g., #24 (comment). Ultimately, ECMA-262 isn't going to say which headers are sent to the server--this is up to host environments, like HTML. I'm proposing that we come to a good conclusion on how some of those environments would work before Stage 3, but ultimately, that we will leave it up to them to make these calls. What do you think? |
I'm generally of the same mind about which headers should be sent, and that it should be up to the implementers since in the simplest form (just adding a "import" header item) it isn't something that would show up in the language proper. But I think if a client is expecting a module it would be good manners to let the server know lol. What I would propose is that in Section 15.2.2 we add an optional "with" clause: import ImportClause FromClause [WithClause]; This would provide a standardized hook for implementers, and a node for additional specification. I'm new to the ECMA-262 language specification world and took a look at the specification. To me it reads much like an abstract design. Is there a corresponding "requirements" document? By that I mean something in a form similar to "The language shall...", The language may...". That would be a place to put "recommendations" on what to do with the WithClause. |
The standardized hook for implementers to provide their header is called HostResolveImportedModule . It's where the fetching happens, and the module attributes are passed to it. |
To help reach a decision we opened a discussion against the HTML spec whatwg/html#5640. |
This is done |
I have a related item on the WICG Discourse.
https://discourse.wicg.io/t/proposal-module-import-headers/4467/1
I'm proposing adding headers to the request when the request is for a module. This helps when building handlers on the request pipeline on the server. Though not directly related, this seems to be a case whose implementation could benfit from headers specific to modules.
The text was updated successfully, but these errors were encountered: