Skip to content

Conversation

@kou029w
Copy link
Contributor

@kou029w kou029w commented Nov 4, 2025

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

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

Copilot AI review requested due to automatic review settings November 4, 2025 02:35
@meta-cla
Copy link

meta-cla bot commented Nov 4, 2025

Hi @kou029w!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

Copy link

Copilot AI left a 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 url module 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.

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Nov 4, 2025
@meta-cla
Copy link

meta-cla bot commented Nov 4, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@kou029w kou029w force-pushed the main branch 5 times, most recently from 8f96d3f to 6330cb3 Compare November 17, 2025 14:37
## 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)).
@netlify
Copy link

netlify bot commented Nov 17, 2025

[V2]

Name Link
🔨 Latest commit e0d4c06
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/691f719ffd9b780008b06889
😎 Deploy Preview https://deploy-preview-11530--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kou029w kou029w requested a review from Copilot November 19, 2025 02:31
Copilot finished reviewing on behalf of kou029w November 19, 2025 02:33
Copy link

Copilot AI left a 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.

Copy link
Collaborator

@slorber slorber left a 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:

slorber

This comment was marked as duplicate.

@slorber slorber changed the title chore: fix url.parse deprecation warning on Node 24+ fix(mdx-loader): fix url.parse deprecation warning on Node 24+ Nov 20, 2025
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Nov 20, 2025
@slorber slorber merged commit bbec801 into facebook:main Nov 20, 2025
47 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants