Repository navigation
Import Attribute proposal syntax support has landed in V8 #50134
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Oct 11, 2023 I don't think there's anything that can be done regarding deprecation from Node.js side, the syntax of JS is dictated by the ECMAScript spec, which is not under Node.js control (TC39 is the editor of the spec). FWIW the
assertkeyword has never been part of the spec, it's only a stage-3 proposal.When it comes to enabling
withrather thanassert, than sounds really good to me, would you like to open a PR?I don't think there's anything that can be done regarding deprecation from Node.js side, the syntax of JS is dictated by the ECMAScript spec, which is not under Node.js control (TC39 is the editor of the spec).
I'm not sure what you mean by this given that the TC39 proposal marks
assertas deprecated, but thanks for opening the PR!I think the confusion comes from the fact that Node.js has a deprecation cycle process that wouldn't make sense in this case, and you are using the word "deprecate" to mean something else. Not very important, I'll rename the issue to avoid the confusion.
Reacted by Nicolò Ribaudo- changed the title
[-]Please deprecate the `assert` syntax[/-][+]Import Attribute proposal syntax support has landed in V8[/+]on Oct 12, 2023 - added a commit that references this issue
on Oct 14, 2023 8 remaining items
- added a commit that references this issue
on Nov 11, 2023 - added a commit that references this issue
on Nov 23, 2023 - added a commit that references this issue
on Dec 12, 2023 - added 7 commits that reference this issue
on Mar 18, 2024 - added a commit that references this issue
on Mar 28, 2024 - added 2 commits that reference this issue
on Apr 25, 2024
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
asserttowith. Theassertkeyword is still around because Chrome already shipped it, but we are actively working on removing it in the future.The future of
assertin 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
withsyntax, behind the--harmony-import-attributesflag. This syntax is already supported in other server-side environments, such as Deno and Bun.The only reason
withis 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
within Node.js 21, and either:assert, orassertis used, and re-flag it in 22What 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