Skip to content

Conversation

@mskelton
Copy link
Contributor

This adds support for import assertions which are at stage 3 and experimental in Node. Reading some other issues, I'm not sure this is desired at this stage, but I thought I would throw it out there to at least get thoughts on adding it.

Checklist:

  • All tests pass in CI.
  • The script/parse-examples passes without issues.
  • There are sufficient tests for the new fix/feature.
  • Grammar rules have not been renamed unless absolutely necessary.
  • The conflicts section hasn't grown too much.
  • The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).

@mskelton mskelton marked this pull request as ready for review January 26, 2023 04:34
@mjambon
Copy link
Contributor

mjambon commented Mar 15, 2023

Hi. Sorry for the slow reaction time. I see that the proposal has been demoted from stage 3 to stage 2:

⚠️ This proposal has been demoted from Stage 3 to Stage 2 in January 2023 due to whatwg/html#7233. TC39 is working on a solution, which will require relaxing the "assert only" semantics and potentially changing the syntax. Import assertions have already been shipped in some implementations, consider the current instability when using them.

I suggest we pause until we're more confident that the syntax will stick unless you can make a strong case for it.

@mskelton
Copy link
Contributor Author

@mjambon Yeah, I'm fine to close this with the change to stage 2.

@mskelton mskelton closed this Mar 16, 2023
@mskelton mskelton deleted the import-assertions branch March 16, 2023 00:56
@bennypowers
Copy link

We're back to stage 3 with a new keyword and the feature is called "import attributes" now, instead of "import assertions"

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

Before:

import manifest from './package.json' assert { type: 'json' };

After

import manifest from './package.json' with { type: 'json' };

@mskelton
Copy link
Contributor Author

@bennypowers Yep, I opened #277 to support import attributes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants