node
node copied to clipboard
deps: add deprecation warning for import assertion syntax
Not sure what the semverness of this would be, hopefully we can backport it to v18.x if https://github.com/nodejs/node/pull/51136 can land there. Here's what the warning looks like:
$ ./node --input-type=module -e 'import "./test/fixtures/empty.js" assert {}'
(node:94657) V8: file://…/[eval1]:1 'assert' is deprecated in import statements and support will be removed in 12.6; use 'with' instead
(Use `node --trace-warnings ...` to show where the warning was created)
$ ./node --input-type=module -e 'import "./test/fixtures/empty.js" with {}'
$ ./node -e 'import("./test/fixtures/empty.js", { assert:{} })'
(node:94696) V8: [eval]:1 'assert' is deprecated in import statements and support will be removed in 12.6; use 'with' instead
(Use `node --trace-warnings ...` to show where the warning was created)
$ ./node -e 'import("./test/fixtures/empty.js", { with:{} })'
Should we mutate the V8 warning to say "in a future version" instead of "in 12.6"?
Refs: https://github.com/nodejs/node/issues/51622
Review requested:
- [ ] @nodejs/gyp
- [ ] @nodejs/security-wg
- [ ] @nodejs/v8-update
Should we mutate the V8 warning to say "in a future version" instead of "in 12.6"?
I think "in a future version" or "12.6 of V8" would be better to use if its ok to float a patch for this or maybe a upstream v8 patch to say "12.6 of V8"
/cc @nodejs/v8