-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Description
What is the problem this feature will solve?
Node.js developers use import ... assert { ... } syntax, that might be removed in a future version.
What is the feature you are proposing to solve the problem?
Months ago, the import attributes proposal changed its keyword from assert to with. The assert keyword is still around because Chrome already shipped it, but we are actively working on removing it in the future.
The future of assert in Node.js was discussed in #46830, and there was wide support for re-flagging the old syntax. However, everybody forgot about it and nothing was done for the Node.js 20 release. Node.js 21 will be released next week, so there is a chance to do it now.
V8 now implements the with syntax, behind the --harmony-import-attributes flag. This syntax is already supported in other server-side environments, such as Deno and Bun.
The only reason with is still flagged in Chrome is because they are waiting for the full semantics to be there in the Chromium side, and whatwg/html#9486 still needs to be implemented. This HTML PR has minimal impact on Node.js (it only has impact when using HTTP imports), and it will be implemented by #50119.
I propose to unflag with in Node.js 21, and either:
- re-flag
assert, or - add a deprecation warning when
assertis used, and re-flag it in 22
What alternatives have you considered?
Wait for the day Chrome will be done migrating, the syntax will be removed in V8 and there will be no action needed on the Node.js side to disable it :P