Skip to content

JSON Module Scripts #596

Closed
Closed

Description

@dandclark

Description

JSON modules (with import attributes) are a way to import JSON in JavaScript.

Note: Per discussion of the interop team this proposal is split off from #436 to be considered independently of CSS module scripts in proposal selection.
cc @o-t-w.

Specification

https://github.com/tc39/proposal-import-attributes
https://github.com/tc39/proposal-json-modules

Open Issues

whatwg/html#7233
There is an open PR that would close this issue.

Tests

https://wpt.fyi/results/html/semantics/scripting-1/the-script-element?label=master&label=experimental&aligned&q=%28import-attributes%20or%20json%29%20and%20not%20assertions

Current Implementations

  • Blink
  • Gecko
  • WebKit

Standards Positions

Safari Technology Preview supports import attributes and JSON modules.

Chrome Canary is currently updating the import attribute syntax from import assertions.

Browser bug reports

Gecko bug for import attributes.

Developer discussions

This Tweet has almost 900 likes https://x.com/mattpocockuk/status/1694679999117246640?s=20

Polls & Surveys

No response

Existing Usage

No response

Workarounds

No response

Accessibility Impact

No impact.

Privacy Impact

No impact.

Other

No response

Activity

  1. jensimmons commented on Nov 1, 2023

    @jensimmons
    Contributor

    JSON module assertions is not standard, and should not be included in this proposal.

    Seems their tests will be marked optional. They should not be included in Interop 2024.
    web-platform-tests/wpt#42875

  2. dandclark commented on Nov 1, 2023

    @dandclark
    ContributorAuthor

    Looks to me like the test link https://wpt.fyi/results/html/semantics/scripting-1/the-script-element?label=master&label=experimental&aligned&q=%28import-attributes%20or%20json%29%20and%20not%20assertions in the proposal is already excluding those and including only the versions with the new with keyword, but we should double-check after the changes proposed in web-platform-tests/wpt#42875 land to make sure the right set of tests is still included.

  3. gsnedders commented on Nov 1, 2023

    @gsnedders
    Member

    FYI:

    % rg 'assert[^_]' html/semantics/scripting-1/the-script-element/import-attributes html/semantics/scripting-1/the-script-element/json-module
    html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.js
    16:        import("./export-hello.js", { assert: { type: "notARealType"} } ),
    

    (There's other matches that aren't relevant.)

  4. nairnandu commented on Feb 1, 2024

    @nairnandu
    Contributor

    Thank you for proposing JSON Module Scripts for inclusion in Interop 2024.

    We wanted to let you know that this proposal was not selected to be part of Interop 2024. This is because we got many more proposals than we could include in this year's project. Note that individual vendors may nevertheless choose to advance work in this area during the forthcoming year. We would welcome this proposal being resubmitted again next year, if necessary.

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

    Posted on behalf of the Interop team.

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

    focus-area-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions