Skip to content

[Feature]: Support tc39 "import attributes" #15000

Open
@josundt

Description

@josundt

🚀 Feature Proposal

I've seen from previous issues that Jest support for import assertions was already added when the proposal was at tc39 stage 3, but that this was reverted/removed again in Feb 2023 as the proposal had been demoted back to stage 2.

Right after this, in March 2023 (more than 1 year back); the proposal went back to stage 3 with a few design changes (keyword assert changed to with), and the of the name of the proposed feature has changed from "import assertions" to "import attributes".

Old proposal
New proposal

Import attributes are now supported in:

  • TypeScript (since v5.3).
  • Bundlers (Tested: WebPack - requires some configuration).
  • Certain browsers (latest) natively (Tested: chromium).
  • NodeJS LTS natively (experimental) (Tested 20.11.1).

Our developer team could have written future-proof ECMAScript code, utilizing this upcoming feature - we currently only need it to work with TypeScript and WebPack; but unfortunately it breaks the Jest tests.

When will you add support for import attributes?
Jest is currently our only obstacle...

Motivation

Jest should support the complete ECMAScript module import specs

Example

No response

Pitch

Jest should support the complete ECMAScript module import specs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions