-
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
Access attributes by import.meta? #58
Comments
B could be imported many times with different metadata, and it’s only evaluated once, the first time. it wouldn’t make much sense to me for it to have access only to the metadata provided by the first importer. |
I think this would depend on the caching model.
If there was an attribute such as "meta" that was part of the key for the
cache this could effectively make different instances
…On Wed, May 20, 2020, 12:25 PM Jordan Harband ***@***.***> wrote:
B could be imported many times with different metadata, and it’s only
evaluated once, the first time. it wouldn’t make much sense to me for it to
have access only to the metadata provided by the first importer.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZYV7XKQOT6FS53UEHH53RSP77ZANCNFSM4NF7ELBA>
.
|
Sure, but then the importer is forcing the module to be re-evaluated again in a way the author may not have intended. For example, if my web server rejects any query strings and only allows a single URL, then you can’t invalidate that cache and evaluate it twice on the same page (afaik). Giving the importer runtime cache control seems concerning; are there any other examples in the web platform where this is the case? In node it can be done, but anyone would assume they’re risking voiding their warranty by doing that - i don’t think the same would apply if it was first class syntax. |
My inclination right now is to leave both things--the interpretation of unknown attributes, and the set of I agree with others here that this is only acceptable if these unknown attributes are considered part of the cache key; this shouldn't be a contest about who imports first. The current draft spec text does permit hosts to use module attributes as part of the cache key (though not
@xtuc has previously suggested that we expose this kind of thing through |
The proposal allow hosts to expose attributes on |
A.js
B.js
The text was updated successfully, but these errors were encountered: