-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
fix(mdx-loader): fix url.parse deprecation warning on Node 24+ #11530
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
Conversation
|
Hi @kou029w! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes URL parsing by replacing the deprecated Node.js url.parse() method with the parseURLOrPath() utility function from @docusaurus/utils. This change aligns with best practices and removes dependency on the legacy url module.
- Removed unused
urlmodule imports from two transformer files - Updated URL parsing calls to use the existing
parseURLOrPath()utility
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts | Replaced deprecated url.parse() with parseURLOrPath() and removed unused import |
| packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts | Replaced deprecated url.parse() with parseURLOrPath() and removed unused import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts
Outdated
Show resolved
Hide resolved
packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts
Outdated
Show resolved
Hide resolved
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
8f96d3f to
6330cb3
Compare
## Motivation Fixes the url.parse deprecation warning that appears when running on Node 24 or later (see [DEP0169](https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0169)).
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks 👍
Just refactored a bit but seems like a nice solution to this deprecation
For some reason I couldn't reproduce the deprecation locally though, despite trying various Node cli flags 🤷♂️ but nevermind
Useful references:
Pre-flight checklist
Motivation
Fixes the url.parse deprecation warning that appears when running on Node 24 or later (see DEP0169).
Test Plan
Test links
Deploy preview: https://deploy-preview-11530--docusaurus-2.netlify.app/
Related issues/PRs