node icon indicating copy to clipboard operation
node copied to clipboard

deps: add deprecation warning for import assertion syntax

Open aduh95 opened this issue 1 year ago • 2 comments

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

aduh95 avatar Feb 01 '24 10:02 aduh95

Review requested:

  • [ ] @nodejs/gyp
  • [ ] @nodejs/security-wg
  • [ ] @nodejs/v8-update

nodejs-github-bot avatar Feb 01 '24 10:02 nodejs-github-bot

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"

debadree25 avatar Feb 08 '24 17:02 debadree25

/cc @nodejs/v8

aduh95 avatar Mar 15 '24 16:03 aduh95