[v18.x backport] Backport import attributes syntax to v18 #51118
Labels
feature request
Issues that request new features to be added to Node.js.
v18.x
Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.
What is the problem this feature will solve?
When using import attributes, users have two choices:
import "foo" with { ... }
is the final syntax that will be included in the language, but it's only supported on Node.js 20+import "foo" assert { ... }
is supported in all LTS Node.js versions, but will likely be removed from the proposal one dayNode.js 18 is supported until April 2025, so this situation will not "solve by itself" for one year and a half.
What is the feature you are proposing to solve the problem?
I'd like to backport the
with
syntax to Node.js 18. Specifically, this patch: https://chromium-review.googlesource.com/c/v8/v8/+/4705558 (minus the use-counter changes, since they are only useful in Chrome). I'm willing to open a PR for it, but I would need some pointer on how to backport V8 features.Note that some of the import attribute changes have already been backported to Node.js 18 (#50669). Specifically, the API changes exposed to ESM loaders.
With this extra backport, all maintained LTS versions would have the same degree of support for import attributes.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: