Import attributes[^1] are a JavaScript feature to allow annotating import declarations, for example `import xxx from "mod" with { type: "json" }'. Chrome originally shipped a previous version of the proposal (in M91) using 'assert' as the keyword. This version has then been updated to use 'with' due to some changes needed while integrating it with HTML for JSON and CSS modules[^2]. [^1]: https://github.com/tc39/proposal-import-attributes/ [^2]: https://github.com/whatwg/html/issues/7233
Other browsers either already implemented or are implementing this feature, so we can expect wide compatibility. Chrome ships an older deprecated version of the proposal, and we need to ship this new version to be compatible with other browsers.
This feature addresses the security concerns raised in https://github.com/WICG/webcomponents/issues/839 Other than that, there are no security concerns related to this feature: https://github.com/tc39/proposal-import-attributes/blob/master/tag-security-and-privacy.md
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
This is an ECMAScript feature, and as such it's mostly tested in Test262: - https://github.com/tc39/test262/tree/main/test/language/module-code/import-attributes - https://github.com/tc39/test262/tree/main/test/language/expressions/dynamic-import/import-attributes There are also WPT tests: - https://github.com/web-platform-tests/wpt/tree/master/html/semantics/scripting-1/the-script-element/import-attributes
No milestones specified
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
NoneWe would like to ship this together with https://groups.google.com/a/chromium.org/g/blink-dev/c/8BbZ_NUVZ5Q/m/HBv8RHNXAAAJ (reflecting the updates to the proposal on the HTML/Fetch side), so that the new syntax already has the final semantics.Also, we are in parallel trying to remove the old 'assert' syntax of the proposal (https://groups.google.com/a/chromium.org/g/blink-dev/c/ZHvzLaJZRvo/m/FgNDBjrtBQAJ).On Tuesday, January 9, 2024 at 7:11:47 PM UTC+1 Nicolò Ribaudo wrote:Contact emails
nrib...@igalia.com, s...@chromium.org
Explainer
None
Specification
https://github.com/tc39/proposal-import-attributes
Summary
Import attributes[^1] are a JavaScript feature to allow annotating import declarations, for example `import xxx from "mod" with { type: "json" }'. Chrome originally shipped a previous version of the proposal (in M91) using 'assert' as the keyword. This version has then been updated to use 'with' due to some changes needed while integrating it with HTML for JSON and CSS modules[^2]. [^1]: https://github.com/tc39/proposal-import-attributes/ [^2]: https://github.com/whatwg/html/issues/7233
Blink component
Blink>JavaScript>Language
TAG review
None
TAG review status
Not applicable
Risks
Interoperability and Compatibility
Other browsers either already implemented or are implementing this feature, so we can expect wide compatibility. Chrome ships an older deprecated version of the proposal, and we need to ship this new version to be compatible with other browsers.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/3eebfc80-19d1-4fd5-a638-fb0ec394574en%40chromium.org.
> Like other JS language changes, I'm guessing we expect developers to use UA sniffing to know where it's safe to ship this syntax?
Yes -- given that this is about new syntax it's difficult to perform runtime feature detection: you would have to use a dynamic imports with data URLs, but that's async and doesn't play well with CSP.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOmohSJoR8Akr5RKCBVPj%2BKC5w0v1E7QQNM62Tdh9v8q9BSRYw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYdgr%3Dim%3DTS0nVFR0Roht9n0jbT1jGMKO0M7X2R0ees-%2Bw%40mail.gmail.com.