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

Import Attributes #733

Open
thescientist13 opened this issue Sep 19, 2024 · 2 comments
Open

Import Attributes #733

thescientist13 opened this issue Sep 19, 2024 · 2 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@thescientist13
Copy link

thescientist13 commented Sep 19, 2024

Description

Taken from #436

Import attributes are a way to import JSON and CSS modules in JavaScript. (and potentially more in the future)

import data from './my-data.json' with { type: 'json' };
import sheet from './my-styles.css' with { type: 'css' };

They would help enable cross-related Interop requests at a foundational level and would provide a full suite of capabilities in one go if prioritized for Interop 2025 all together 🤩

Specification

TC39

Additional Signals

Chrome has already moved from the previous assert syntax to the with syntax, and both JSON and CSS modules are supported in Chrome as well.

All browsers are already supportive of CSS and JSON modules.

This has been highly requested in prior interops

@gsnedders
Copy link
Member

https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/import-attributes?label=master&label=experimental&aligned for the very basic level

@thescientist13
Copy link
Author

Yay, TC39 just moved Import Attributes and JSON Modules to Stage 4!

Congrats to @NicoloRibaudo on advancing both Import Attributes & JSON Modules to Stage 4 at @TC39 today 🎉

It introduces the with keyword for imports. Chrome successfully unshipped the assert keyword 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
Status: No status
Development

No branches or pull requests

2 participants