Skip to content

Remove env detection code in lib/punycode.js #4848

Closed

Description

@stevemao

I realize some modules like readable-stream is maintained internally but punycode is maintained externally. Should we maintain them internally only? Reasons are:

  1. Consistency.
  2. https://github.com/nodejs/node/blob/master/lib/punycode.js#L5-L16 exports the module depends on the environment which is not needed here in node.

Activity

  1. added
    questionIssues asking questions about Node.js.
    on Jan 25, 2016
  2. rvagg commented on Jan 25, 2016

    @rvagg
    Member

    What are you actually suggesting here @stevemao? I'm not sure what the question is that is needing an answer. Is this specifically about punycode or are there other files in scope? Are you suggesting maintaining a fork of punycode and not accepting upstream updates?
    If this is only about punycode then I'd say I don't see a compelling argument for detaching from upstream. The expertise required for implementing and maintaining this module is pretty specialist and I for one am happy to lean on the punycode project to deal with that. Perhaps you could outline more about why you think this is so compelling?

  3. stevemao commented on Jan 25, 2016

    @stevemao
    ContributorAuthor

    OK, I changed my mind @rvagg :) I only think that the environment detection code should be removed and just keep module.exports. We don't need amd and global (window) support here in the core.

    We should of course accept upstream updates, etc..

  4. changed the title [-]Maintenance of lib[/-] [+]Remove module detection code in lib/punycode.js[/+] on Jan 25, 2016
  5. changed the title [-]Remove module detection code in lib/punycode.js[/-] [+]Remove env detection code in lib/punycode.js[/+] on Jan 25, 2016
  6. Fishrock123 commented on Jan 25, 2016

    @Fishrock123
    Contributor

    Isn't punycode meant to work in the browser? We just copy it verbatim, so it won't make a difference?

  7. stevemao commented on Jan 25, 2016

    @stevemao
    ContributorAuthor

    Correct, just to make it a bit smaller @Fishrock123 . No other code in the /lib folder has those detection. Even though it's copied from other source, The code could be modified to suit node core better.

  8. Fishrock123 commented on Jan 25, 2016

    @Fishrock123
    Contributor

    I'm not sure it would be worth it still, might as well just keep it so you can copy from the upstream.

  9. ChALkeR commented on Jan 25, 2016

    @ChALkeR
    Member

    I think that there are two viable solutions here:

    1. Add a floating patch that removes the unneeded env detection.
    2. Just leave it as it is.

    I doubt that maintaining an interfnal fork will do any good.

  10. ChALkeR commented on Jan 25, 2016

    @ChALkeR
    Member

    Btw, v1.4.0 is out, it might be time to update: https://github.com/bestiejs/punycode.js/releases
    Edit: the changes look comment-only.

  11. cjihrig commented on Jan 25, 2016

    @cjihrig
    Contributor

    Here is the diff for v1.4.0 - cjihrig@e55844b

  12. Fishrock123 commented on Jan 25, 2016

    @Fishrock123
    Contributor

    Is it possible we updated from upstream before the release?

  13. cjihrig commented on Jan 25, 2016

    @cjihrig
    Contributor

    It looks that way. Do you see any value with brining it up to date with 1.4.0, even though it would just be comment changes?

  14. ChALkeR commented on Jan 25, 2016

    @ChALkeR
    Member

    @Fishrock123 There are no actual changes between those two versions, except for this pull: mathiasbynens/punycode.js#32, which is the mirror of #1246.

    Diff: mathiasbynens/punycode.js@v1.3.2...v1.4.0#diff-c50a9dbe44909e8f5b09f11d33fe6f1c.

    That's why I said above that the changes are comment-only.

  15. stevemao commented on Jan 26, 2016

    @stevemao
    ContributorAuthor

    Can we change the label? This is not a question but a minor change request :)

  16. stevemao commented on Jan 30, 2016

    @stevemao
    ContributorAuthor

    created PR #4969

  17. evanlucas commented on Feb 9, 2016

    @evanlucas
    Contributor

    As stated in the PR, this is an upstream module that we use. Making this change will make updating it more difficult. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions