-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
punycode: runtime deprecation #35092
Conversation
Might we want to leave it as a doc deprecation indefinitely? |
Here are a few arguments why we might want to take it out of core eventually:
|
Caution here. CITGM can alert if there may be a problem (e.g. a module fails), but a passing* CITGM run does not mean there is no effect in the ecosystem, merely that there was no observable effect to the modules that are tested in CITGM. (* it's rare but has happened in the past) |
@nodejs/tsc |
TSC should probably decide to close this or move forward with it or else it will stall. Adding |
This does not appear to be correct:
Using an dataset from last year, top 3 punicode users are:
I don't this the ecosystem is ready for this yet. Perhaps we could open issues first. Or make this work with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is likely too disruptive atm.
Perhaps this should be changed to support --pending-deprecation
first, and then we could file issues/prs to top npm modules, pointing at that --pending-deprecation
?
779b158
to
0ae2274
Compare
0ae2274
to
877d5a9
Compare
@@ -1,5 +1,15 @@ | |||
'use strict'; | |||
|
|||
const { getOptionValue } = require('internal/options'); | |||
if (getOptionValue('--pending-deprecation')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (getOptionValue('--pending-deprecation')){ | |
if (getOptionValue('--pending-deprecation')) { |
Linter doesn't process this file as it's in .eslintignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good in principle, but breaks when Node.js is configured with --without-intl
flag:
$ ./node --pending-deprecation --trace-deprecation -e 'require("dns")'
(node:858797) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
at punycode.js:5:10
at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:276:7)
at nativeModuleRequire (internal/bootstrap/loaders.js:305:14)
at internal/idna.js:7:34
at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:276:7)
at nativeModuleRequire (internal/bootstrap/loaders.js:305:14)
at url.js:30:21
at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:276:7)
at nativeModuleRequire (internal/bootstrap/loaders.js:305:14)
at internal/modules/cjs/helpers.js:19:17
To fix:
- Move the original
lib/punycode.js
tolib/internal/punycode.js
- Fix
require('punycode')
torequire('internal/punycode')
inlib/internal/idna.js
. - Introduce a wrapper in
lib/punycode.js
that does the pending deprecation logic and reexportsrequire('internal/punycode')
, likelib/sys.js
does withrequire('util')
(but with--pending-deprecation
). - Fix
lib/punycode.js
tolib/internal/punycode.js
in.eslintignore
Should be good after that if I didn't miss any steps.
Given the -1's (which I agree with), this is not something we're likely to do right now. Closing |
punycode
is doc deprecated since v7 and the npm package is downloaded 40M per week, I think it's time to move its deprecation forward.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes