Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Node.js v24 introduced DEP0169, a deprecation warning for url.parse():
(node:1234) [DEP0169] DeprecationWarning:
url.parse()behavior is not standardizedand prone to errors that have security implications. Use the WHATWG URL API instead.
This library called url.parse() in two places, causing the warning to be emitted to stderr whenever the library was used. Downstream projects that assert on clean stderr (e.g. in tests) were broken as a
result.
Solution
Replace both url.parse() calls with the WHATWG URL API (new URL()):
URLs).
One subtlety: for non-special scheme URLs without // (e.g. github:user/repo, foo:bar), the WHATWG URL API produces an "opaque path" with an empty host, whereas the legacy url.parse() treated the first path
segment as the host. The new parseUrl() replicates this behaviour explicitly — if there is no slash after the scheme (e.g. foo:bar), the token is treated as a hostname and path/pathname are set to null,
causing parse() to return null as before.
The url module import is removed entirely.
Testing
All 193 existing tests pass. The existing process.on('warning', ...) handler in the test suite now reliably catches any future regressions.
(Claude helped me write this PR.)