Skip to content
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

use global URL instead of node url module #325

Merged
merged 1 commit into from
Jan 7, 2022
Merged

Conversation

brendankenny
Copy link
Collaborator

Node 10 added a global URL. The alias under require('url').URL is completely equivalent, except for some reason all the Node URL polyfills don't seem to bother to add URL to the 'url' module and so it doesn't work automatically when bundled (using the default browserify and rollup polyfills, at least).

This has always worked anyways in Lighthouse because the library robots-parser gets URL the same way and so it's had to be manually patched, but the way we did it was kind of a hack. We have to change how we patch it in Lighthouse so I was trying to remember why we did it this hacky way (goes back to GoogleChrome/lighthouse#5293) and realized pubads also needed it.

This PR isn't pressing because we still need to get it changed in robots-parser and it's still a pretty trivial workaround in the meantime, but since URL has been a global for so long, it seems as good a time as any to start backing out the need for a polyfill or patch.

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