Repository navigation
punycode: remove module detection - #5868
benjamingr wants to merge 1 commit into
Conversation
The current punycode code is copy-pasted from a package that is meant to be used both in browsers and node. This commit removes the module detection from punycode and assumes node. If this gets received well, I intend to do more basic work to make the module more maintainable. Refs: nodejs#5865 PR-URL: Reviewed-By: Reviewed-By:
|
Note: the diff looks huge, so I'll summarize it - the code was wrapped in an IIFE and finished with module detection. Now it's no longer wrapped in an extra Future changes I intend to do if this gets received well:
After that's done, I'll look into performance, the current module is very well documented and it's not bad code at all - but it's not very optimized in terms of performance for v8. |
|
I think the reason it was copied verbatim is so that there's no maintenance burden when new versions are merged. |
|
What @mscdex said. This PR makes maintenance more difficult, not easier. |
|
@mscdex the last time a version has been merged has been in 2014 from what I can tell. Is it still actively maintained? ping @mathiasbynens Maybe we should update to 1.4 then. |
|
@bnoordhuis wouldn't it be better to use something like https://github.com/bnoordhuis/punycode in terms of performance? The JS implementation uses things that are not very performance friendly from what I saw. |
|
We moved to punycode.js years ago because my library isn't 100% spec compliant. :-) |
|
Oh, I understand, I'll close this then and open a new PR based on the spec compliant library. Thanks. |
|
Looks like it hasn't really been updated (looking at the code) between 1.3.2 and 1.4.1. |
|
I know that this is closed... but for reference Similar thread, project decided not to remove code |
Please provide affected core subsystem(s) (like buffer, cluster, crypto, etc)
punycode, url
Description of change
The current punycode code is copy-pasted from a package that is meant to be used both in browsers and node. This commit removes the module detection from punycode and assumes node.
If this gets received well, I intend to do more basic work to make the module more maintainable.
As discussed in #5865
Labeled as URL since it uses it internally.