Contact emails...@chromium.org, nriba...@igalia.com

ExplainerNone

Specificationhttps://tc39.es/proposal-import-attributes

Summary

TC39 has consensus for trying to deprecate and remove the `assert` keyword
in favor of the new `with` keyword in import attribute syntax. That is,
`import m from 'foo' assert { type: 'json' }` will now throw a SyntaxError,
and developers must change to `import m from 'foo' with { type: 'json' }`.
https://github.com/tc39/proposal-import-attributes/issues/135


Blink componentBlink>JavaScript>Language
<https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EJavaScript%3ELanguage>

Motivation

The import assertions proposal (now called "import attributes") [1] in TC39
shipped in M91 with the `import mod from 'foo' assert { type: 'json' }`
syntax. The original semantics was that additional information following
the `assert` keyword cannot cause the module to be reinterpreted or change
the semantics of the module in any way, i.e., a pure assertion. Following
an HTML integration issue with CSP [2] that required changing Accept
headers depending on the requested module type, TC39 reached consensus that
the "pure assertion" semantics are to be relaxed to allow reinterpretation,
and that the `assert` keyword be changed to `with` to reflect the new
semantics. [1] https://github.com/tc39/proposal-import-attributes/ [2]
https://github.com/whatwg/html/issues/7233


Initial public proposalNone

TAG reviewNone

TAG review statusNot applicable

Risks


Interoperability and Compatibility

There is no interoperability risk because Safari and Firefox never shipped
the `assert` syntax. There is compatibility risk within Chrome as we
shipped in M91.


*Gecko*: N/A

*WebKit*: N/A

*Web developers*: No signals

*Other signals*:

Ergonomics

None.


Activation

None.


Security

None.


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that
it has potentially high risk for Android WebView-based applications?

None


Debuggability

None.


Is this feature fully tested by web-platform-tests
<https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>
?In test262

Flag name on chrome://flags--harmony-import-assertions

Finch feature nameNone

Non-finch justification

Use counter metric shows current usage at 0.0002%
https://chromestatus.com/metrics/feature/timeline/popularity/4528
Additionally, analysis shows that sites that do use it have fallbacks:
https://github.com/tc39/proposal-import-attributes/issues/135#issuecomment-1625217926
This data suggests that a finch trial is not needed, and a clean removal is
possible.


Requires code in //chrome?False

Estimated milestones

No milestones specified


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/4689167795879936

This intent message was generated by Chrome Platform Status
<https://chromestatus.com/>.

-- 
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+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN-e9e_cMbiPO2AhV%3D%3DP_r%3Dov%2BKvxyXqkyosej9a%3DuJO7zt5_Q%40mail.gmail.com.

Reply via email to