Skip to content

punycode: deprecate punycode module

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

punycode

Description of change

Currently, the punycode module is used in exactly one spot within core (the url parser). With the recent switch to using the much faster ICU based punycode implementation by default, the punycode module is now only used when node happens to be built without ICU. This change moves the punycode module to internal/punycode and hard deprecates require('punycode').

When the new WHATWG URL implementation lands, users will have access to the URL.domainToUnicode() and URL.domainToASCII statics that are defined as part of the standard interface.

The next step (in the next major) is to remove require('punycode') entirely and make it so that internal/punycode.js is only included if the Node.js binary is built without ICU.

Why? - (a) we do not maintain or support the punycode module, (b) it's 10x slower than the ICU based implementation, (c) we use it exactly once currently, (d) there are userland options, (e) deprecating and eventually removing reduces overall core API surface area.

Merge request reports

Loading