-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 type check should take environment into account #7047
Comments
Yeah, this is my bad for suggesting the IDL exposure-based check currently in https://html.spec.whatwg.org/#creating-a-css-module-script . I didn't realize that would result in redundant fetches. (Which you can write WPTs about by using the server; see e.g. web-platform-tests/wpt#30259 for a similar scenario.) Probably we should keep the exposure check as the method of determining whether it's supported? But just move it to somewhere early in the pipeline... I think "fetch a single module script" would work. |
I don't see how exposure would work for |
Sure, that would probably help more for such future scenarios. Although I'd suggest the algorithm take an environment settings object and a module type. |
Seems to me like we can check for this at the same spots where we already check (before the fetch) that the asserted type is |
Currently the check that disallows creation of CSS module scripts in worker contexts only happens after the fetch for that import is performed. This change moves the check to where we check that the assertion type is a valid value. By doing so, failing that check prevents the fetch. Closes #7047.
Currently the check that disallows creation of CSS module scripts in worker contexts only happens after the fetch for that import is performed. This change moves the check to where we check that the assertion type is a valid value. By doing so, failing that check prevents the fetch. Closes whatwg#7047.
We shouldn't claim to support "css" in workers here. That results in redundant fetches and is also inconsistent with the feature proposed in #7017.
(It also doesn't match the discussion in tc39/proposal-import-attributes#111 I think.)
cc @dandclark
The text was updated successfully, but these errors were encountered: