Skip to content
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: fix jsdoc references #45524

Closed
wants to merge 1 commit into from
Closed

punycode: fix jsdoc references #45524

wants to merge 1 commit into from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Nov 19, 2022

No description provided.

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 19, 2022
@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 19, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 19, 2022
@nodejs-github-bot
Copy link
Collaborator

@mscdex
Copy link
Contributor

mscdex commented Nov 19, 2022

This file is actually a (deprecated) 3rd party dependency originating from here, so changes should be made there instead.

@Trott
Copy link
Member

Trott commented Nov 19, 2022

This file is actually a (deprecated) 3rd party dependency originating from here, so changes should be made there instead.

We have definitely changed it, though:

  1. Adding a deprecation warning: https://github.com/nodejs/node/pull/38444/files
  2. Using strict equality checks: https://github.com/nodejs/node/pull/30898/files

The most recent version (which we are using with those two modifications above) is 2.1.1, released more than 4 years ago. I think we decided at some point that we would maintain our own fork here, but maybe I'm mistaken about that.

@anonrig
Copy link
Member Author

anonrig commented Nov 19, 2022

This file is actually a (deprecated) 3rd party dependency originating from here, so changes should be made there instead.

The referenced repository is not maintained anymore.

  • Last commit October 23, 2020
  • Last NPM release 4 years ago.

@mscdex
Copy link
Contributor

mscdex commented Nov 19, 2022

Perhaps we could convince @mathiasbynens to upstream our existing changes (sans node-specific stuff like the deprecation warning) + these doc fixes?

@mathiasbynens
Copy link
Contributor

Perhaps we could convince @mathiasbynens to upstream our existing changes (sans node-specific stuff like the deprecation warning) + these doc fixes?

You totally could. Please send a PR :)

@anonrig
Copy link
Member Author

anonrig commented Nov 21, 2022

If we are going to upstream the changes, should we add punycode as a dependency?

@Trott
Copy link
Member

Trott commented Nov 21, 2022

If we are going to upstream the changes, should we add punycode as a dependency?

It's already in the LICENSE file. Do you mean, though, that it should be moved to the deps directory? Semantically, that makes some sense, but I wonder if that would introduce more practical friction than benefit. (I'm not sure, but my guess is "yes".)

@anonrig
Copy link
Member Author

anonrig commented Nov 21, 2022

It's already in the LICENSE file. Do you mean, though, that it should be moved to the deps directory? Semantically, that makes some sense, but I wonder if that would introduce more practical friction than benefit. (I'm not sure, but my guess is "yes".)

So, I opened a pull request for these changes and it got merged. What is the next step for that change to get into the node.js core? If it was deps it would be a github ci workflow, that automatically does this. But since this isn't a deps (semantically speaking), I'm in the unknown territories.

@Trott
Copy link
Member

Trott commented Nov 22, 2022

So, I opened a pull request for these changes and it got merged. What is the next step for that change to get into the node.js core?

I would recommend this approach:

@anonrig
Copy link
Member Author

anonrig commented Nov 22, 2022

I opened another pull request for upstreaming our internal changes. @mathiasbynens I appreciate if you can take a look at it (mathiasbynens/punycode.js#121)

@silverwind
Copy link
Contributor

silverwind commented Dec 15, 2022

I think it's time to remove the core punycode module as it's been deprecated since 7.0.0 and its existance is a source of confusion because afaik it's undefined behaviour whether import 'punycode' will get you the core module or the npm module.

Edit: It appears there is a non-ambigous module on npm, so that avoids the undefined behaviour.

@anonrig
Copy link
Member Author

anonrig commented Jan 1, 2023

The original author is unresponsive to my upstream changes pull request. I recommend continuing this pull request. @Trott What are your thoughts on this?

I think it's time to remove the core punycode module as it's been deprecated since 7.0.0

@silverwind I agree with you. What are the steps needed to remove this module from Node, without breaking any existing apps?

@Trott
Copy link
Member

Trott commented Jan 4, 2023

The original author is unresponsive to my upstream changes pull request. I recommend continuing this pull request. @Trott What are your thoughts on this?

It looks like the PR has been landed upstream.

@silverwind
Copy link
Contributor

What are the steps needed to remove this module from Node, without breaking any existing apps?

I'd say next step is probably runtime deprecation, e.g. output a process warning when the module is used.

@targos
Copy link
Member

targos commented Mar 19, 2023

If you enable pending deprecation warnings, you'll see that the ecosystem impact will be huge.
For example whatwg-url depends on the module

@silverwind
Copy link
Contributor

silverwind commented Mar 19, 2023

Internal use should probably not output a warning, only external one. Or even better, refactor the internal use away from the module.

@targos
Copy link
Member

targos commented Mar 19, 2023

I'm not talking about internal use. The whatwg-url npm module depends on tr46, which until recently required our punycode module. This changed in jsdom/tr46@fef6e95 (semver-major).
When I work with NODE_PENDING_DEPRECATION=1, I see the warning all the time because of it.

@silverwind
Copy link
Contributor

silverwind commented Mar 19, 2023

I see, so that is because of same-name internal module and npm module, and I think this ambiguity is the reason why we now have such a hard time deprecating it without major impact.

I suggested in mathiasbynens/punycode.js#122 that the authors should recommend the unambiguous punycode.js npm name as the hack with the slash no longer works in ESM. So I guess this is the first step and then node's deprecation warning should point to the punycode.js module as well.

@silverwind
Copy link
Contributor

Also, I recommend opening a new issue for this topic and stop abusing this PR 😉

@anonrig
Copy link
Member Author

anonrig commented Apr 3, 2023

I'm closing this issue in favor of deprecation and the follow up pull requests done.

@anonrig anonrig closed this Apr 3, 2023
@anonrig anonrig deleted the punycode branch April 3, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants