Skip to content
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

Correct the import assertions and attributes compat table #22821

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

captainbrosset
Copy link
Contributor

@captainbrosset captainbrosset commented Apr 12, 2024

Summary

The compat data for import assertions and attributes is out of date. This PR, hopefully, corrects it.

Some background info:

  • import ... from ... assert ... is now deprecated, but still implemented in Chromium (aka import assertions).
  • import ... from ... with ... is the new way of doing this (aka import attributes).
  • Both syntax can be used with {type: json} or {type: css}. The latter is missing from BCD altogether.
  • Safari 17.2 added support for import attributes in 17.2, but only for {type: json}. https://developer.apple.com/documentation/safari-release-notes/safari-17_2-release-notes#JavaScript
  • Chromium supports import attributes for both types.

Test results and supporting details

I tested with a local HTML file on Chrome, Edge, Firefox, and Safari. And checked chromestatus.com, and the Safari release notes linked above.

@github-actions github-actions bot added the data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label Apr 12, 2024
Copy link

@dandclark dandclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this! Just one minor correction.

javascript/statements.json Outdated Show resolved Hide resolved
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants