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

Warn code that uses import assertions #17944

Open
petamoriken opened this issue Feb 25, 2023 · 4 comments
Open

Warn code that uses import assertions #17944

petamoriken opened this issue Feb 25, 2023 · 4 comments
Labels
swc related to swc (bundling/transpiling) upstream Changes in upstream are required to solve these issues

Comments

@petamoriken
Copy link
Contributor

⚠️ 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.

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

@petamoriken
Copy link
Contributor Author

swc issue: swc-project/swc#7179

@andreubotella
Copy link
Contributor

The import assertions proposal was renamed to import attributes and became stage 3 again in March 2023.

This change, however, came with the assert keyword being changed to with, with assert still accepted as "normative optional, deprecated". So once Deno supports the with keyword, the assert syntax should have a lint or warning indeed.

@bartlomieju bartlomieju added upstream Changes in upstream are required to solve these issues swc related to swc (bundling/transpiling) and removed enhancement labels Jul 17, 2023
@nicolo-ribaudo
Copy link

Hey, quick update on this. Node.js is planning to remove support for assert in v22 (which will be released in April) and Chrome in v126 (which will be released in May).

I saw in the Deno 1.42 blog post that you are working on a new major version, so it might be a good time to also discuss removing assert from Deno.

@petamoriken
Copy link
Contributor Author

As we discussed on Discord, we are also removing assert keyword support from Deno in the future.

I am trying to pass the --no-harmony-import-assertions flag to V8 when there is a DENO_FUTURE=1 environment variable. Apparently --harmony-import-assertions is hard-coded in deno_core, so I have to attack it from there.

bartlomieju pushed a commit to denoland/deno_core that referenced this issue Apr 22, 2024
Ref:
denoland/deno#17944 (comment),
denoland/deno#23450

Removed flags enabled by default and added flag Float16Array.
@marvinhagemeister marvinhagemeister changed the title Warn code that uses import assetions Warn code that uses import assertions Apr 24, 2024
bartlomieju pushed a commit that referenced this issue Apr 29, 2024
Ref #17944, swc-project/swc#8893

TypeScript removes the `assert` keywords in the transpile, so this PR
only works for JavaScript files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swc related to swc (bundling/transpiling) upstream Changes in upstream are required to solve these issues
Projects
None yet
Development

No branches or pull requests

5 participants