-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core: update robots-parser, extension: use browser-specific impl of url library #4875
Conversation
lighthouse-extension/gulpfile.js
Outdated
@@ -100,6 +100,8 @@ gulp.task('chromeManifest', () => { | |||
function applyBrowserifyTransforms(bundle) { | |||
// Fix an issue with imported speedline code that doesn't brfs well. | |||
return bundle.transform('./fs-transform', {global: true}) | |||
// Replace url module with url-shim | |||
.transform('./url-transform', {global: true}) |
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.
is it not possible to get the bundle.require
style working like we do for audits/gatherers? I don't know if it's possible really just curious :)
@patrickhulce oh my, things got interesting. Your question got me to dig deeper into browserify docs and it turns out that "browserify provides many browser-specific implementations of node core libraries" and that list includes… url module. So why it didn't work for us? lighthouse/lighthouse-extension/gulpfile.js Line 124 in f7efaa5
🙀Turns out that removing that one line is THE fix that we should have applied in the first place. Oh well, at least I learned about patch-package and browserify transforms 👨🎓 |
😱 nice sleuthing though! does this mean we can nuke the patch in this PR? I don't see it removed |
@patrickhulce good catch, removed 🗑 |
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.
cool beans this worked for me locally 👍 too bad you had that wild 🐦 chase @kdzwinel! appreciate the cleanup
browserify transform added to replacerequire('url')
withrequire('path/to/url-shim')
require('url')
with a browser-specific implementationCloses #4825