| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hey @jiji-hoon96! Thanks for investing time and effort in helping the project! ❤️ You are right the url.parse() seems deprecated: var url = require('url')
var parse = url.parse
console.log(parse('https://expressjs.com/en/4x/api.html#req.protocol'))(node:4158863) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities. (Use `node --trace-deprecation ...` to show where the warning was created) I was wondering if you explored the option to use the URL constructor directly like: var data = new URL('https://expressjs.com/en/4x/api.html#req.protocol');
console.log(data);
The output is quite similar, but as mentioned here (url.parse supports a few use cases that are not supported with new URL().) not sure about the final impact for us. // url.parse()
Url {
protocol: 'https:',
slashes: true,
auth: null,
host: 'expressjs.com',
port: null,
hostname: 'expressjs.com',
hash: '#req.protocol',
search: null,
query: null,
pathname: '/en/4x/api.html',
path: '/en/4x/api.html',
href: 'https://expressjs.com/en/4x/api.html#req.protocol'
}
//new URL()
URL {
href: 'https://expressjs.com/en/4x/api.html#req.protocol',
origin: 'https://expressjs.com',
protocol: 'https:',
username: '',
password: '',
host: 'expressjs.com',
hostname: 'expressjs.com',
port: '',
pathname: '/en/4x/api.html',
search: '',
searchParams: URLSearchParams {},
hash: '#req.protocol'
}
The regex you proposed in your parser seems to follow a linear complexity, but I prefer to avoid include custom implementations if we can use built-in utils or existing APIs. wdyt @blakeembrey? |
Sorry, something went wrong.
|
Thanks for the suggestion! You're right - using the URL constructor is a better approach than a custom implementation. I'll update the code to use new URL() instead. 👍 |
Sorry, something went wrong.
Sorry, something went wrong.
|
Given the constraints, I believe is the best available option because
However, I'm open to any direction you'd prefer. Should we
Let me know your thoughts! 🙏 |
Sorry, something went wrong.
Proposal: Modernizing parseurl by Embracing Native Node.js APIsHello everyone,
Implementation PreviewI have worked on a draft implementation of this change:
Impact Analysis: Backward Compatibility is Key This update is designed to be fully backward compatible. Because the output retains the expected API structure as a plain object, existing consumers of the package should not require any modifications, ensuring a smooth transition for the entire ecosystem. Critical CI/CD Pipeline FixesIn parallel with the feature update, I've addressed critical maintenance issues in the existing CI/CD workflow (ci.yml) to ensure reliable testing on modern GitHub Actions runners:
CI/CD Fixes Implementation
I'll like to know what you think. |
Sorry, something went wrong.
- Remove legacy Node.js versions (0.8, 0.10, 0.12) and EOL versions - Keep only active LTS versions: 16.x, 18.x, 20.x, 22.x - Replace deprecated ::set-output with $GITHUB_OUTPUT syntax - Upgrade actions/setup-node to v4 (replacing custom nvm script - Upgrade coverallsapp/github-action from @master to @v2 - Remove version-specific dependency overrides no longer needed
|
Thank you for the constructive feedback! I have updated the PR to address the comments and fix the CI failures:
The CI checks are now passing. Ready for review! |
Sorry, something went wrong.
|
Nice 💜, To remove the deprecated url.parse() method, I suggest removing all instances of url.Url or new URL() and converting it to a plain object and this makes it considerably faster since there is no object construction |
Sorry, something went wrong.
|
parseurl+1.3.3.patch i hope it helps |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Node.js v24 has deprecated url.parse(), causing deprecation warnings. This is related to security issues (hostname spoofing) and will be removed in future versions.
This PR replaces the deprecated url.parse() with the WHATWG URL API (new URL()) as recommended by Node.js, avoiding custom regex implementations for better reliability and maintainability.
Changes
Performance
Benchmark results show performance is maintained or improved compared to the original: