Skip to content

Avoid using deprecated parts of the 'url' module.#8

Merged
samclarke merged 1 commit into
samclarke:masterfrom
kdzwinel:url-module-update
Mar 21, 2018
Merged

Avoid using deprecated parts of the 'url' module.#8
samclarke merged 1 commit into
samclarke:masterfrom
kdzwinel:url-module-update

Conversation

@kdzwinel

@kdzwinel kdzwinel commented Mar 20, 2018

Copy link
Copy Markdown
Contributor

Hi! 👋

Thank you so much for a wonderful project! We are using it in GoogleChrome/lighthouse in one of the SEO audits.

This PR

Short story: robots-parser uses some 'url' module APIs that are deprecated since Node v6, lets update them!

Long story: Lighthouse runs in both node and browser environments. In the browser we use the native URL object to polyfill require('url'). Unfortunately, robots-parser was using APIs that are not compatible with the browser's URL object (namely parse and path). Thankfully, these APIs are also deprecated in Node, so it does make sense to update them.

⚠️ that's a breaking change because by using new URL() we are dropping support for Node v4 here (which is in the maintenance mode till April 2018).

@samclarke

Copy link
Copy Markdown
Owner

Thanks for the pull request! Looks great 👍Merged.

@samclarke

Copy link
Copy Markdown
Owner

Just so you know I've released version 2 with this update. Thanks again for the PR!

@kdzwinel kdzwinel deleted the url-module-update branch March 21, 2018 19:25
@kdzwinel

Copy link
Copy Markdown
Contributor Author

Oh wow, didn't expect you to merge it so fast. Thank you Sam! 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants