Skip to content

Import Attributes #733

Closed
Closed

Description

@thescientist13

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

Activity

  1. thescientist13 commented on Oct 8, 2024

    @thescientist13
    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 👍

  2. wpt-interop commented on Feb 13, 2025

    @wpt-interop
    Collaborator

    Thank you for proposing Import Attributes for inclusion in Interop 2025.

    We are pleased to let you know that this proposal was accepted as part of the Modules focus area. You can follow the progress of this focus area on the Interop 2025 dashboard.

    For an overview of our process, see proposal selection. Thank you for contributing to Interop 2025!

    Posted on behalf of the Interop team.

  3. added
    accepted
    on Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfocus-area-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions