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

core: update robots-parser, extension: use browser-specific impl of url library #4875

Merged
merged 4 commits into from
Mar 28, 2018

Conversation

kdzwinel
Copy link
Collaborator

@kdzwinel kdzwinel commented Mar 26, 2018

  • patch-package removed
  • robots-parser updated from 1.0.2 to 2.0.1
  • browserify transform added to replace require('url') with require('path/to/url-shim')
  • allow browserify to do its default thing and replace require('url') with a browser-specific implementation

Closes #4825

@@ -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})
Copy link
Collaborator

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 :)

@kdzwinel
Copy link
Collaborator Author

@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?

🙀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 👨‍🎓

@kdzwinel kdzwinel changed the title core: update robots-parser, replace url with url-shim when building extension core: update robots-parser, use browser-specific impl of url library when building extension Mar 27, 2018
@kdzwinel kdzwinel changed the title core: update robots-parser, use browser-specific impl of url library when building extension core: update robots-parser, extension: use browser-specific impl of url library Mar 27, 2018
@patrickhulce
Copy link
Collaborator

Turns out that removing that one line is THE fix that we should have applied in the first place.

😱 nice sleuthing though! does this mean we can nuke the patch in this PR? I don't see it removed

@kdzwinel
Copy link
Collaborator Author

@patrickhulce good catch, removed 🗑

Copy link
Collaborator

@patrickhulce patrickhulce left a 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

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.

None yet

4 participants