Dependency on deprecated Node "punycode" module
See original GitHub issueThe project calls require('punycode')
, using the Node punycode module which has been deprecated since v7 (2016). The Node docs now recommend using punycode.js in place of it.
This also means that when this library is used in a project using webpack, webpack must be manually configured to load punycode.js as a replacement for the punycode module because webpack since v5 (2020) no longer defaults to including shims for Node APIs like punycode.
It would be helpful if this library switched to using punycode.js instead of the Node punycode module.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Punycode | Node.js v19.3.0 Documentation
The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be...
Read more >DeprecationWarning: The punycode module is deprecated #29
I see two workarounds: Forking node-fetch . That might cause compatibility problems if both sync-fetch and non-forked node-fetch are used and ...
Read more >punycode is deprecated in npm - what should I replace it with?
The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be...
Read more >punycode - npm
A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.
Read more >punycode
The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe that part of the readme about browser support is just referring to that they started using ES2015isms like
const
and discontinued their UMD build which could work in pre-ES2015 browsers without a bundler. We’re using Punycode.js in browsers fine through Webpack right now, and Punycode.js’s ESM build even works directly as-is in browsers. (I think Punycode.js’s readme is misleadingly worded and I’ve sent a PR to fix that: https://github.com/mathiasbynens/punycode.js/pull/118.)This library psl is already in CommonJS format and requires a bundler to be used within a browser, so adding a dependency on Punycode.js v2 would not cause a regression for people targeting (ES2015-supporting non-ancient) browsers specifically. But it would cause an issue for people not transpiling their code like with Babel and targeting ancient runtimes that don’t support ES6 features like
const
such as Rhino. It might be good for psl to do a major version update if it adds a dependency on Punycode.js v2 then.Nice one @wegry 💪