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: gather source maps #9101

Merged
merged 90 commits into from Jul 25, 2019

Conversation

@connorjclark
Copy link
Collaborator

commented Jun 1, 2019

#9097

Gather source maps.

Nothing done with them yet.

@googlebot googlebot added the cla: yes label Jun 1, 2019

@connorjclark

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 1, 2019

WIP b/c no tests, and:

I want to put source maps in a new artifact, because gathering them is a lot of network requests and parsing that should only be done if an audit explicitly needs it - which, right now, does not exist.

It could be in a new gatherer, but I'd like to use the Debugger.onScriptParsed to collect the sourceMapURL (instead of parsing it ourselves). So we can add sourceMapURL to ScriptElements, and make a computed artifact, cool. But we don't have the driver in computed artifacts (afaict), so can't make fetch requests in the page to collect the source maps.

Is there a nice way to pass the driver to a computed artifact? Or is it better to forgo Debugger.onScriptParsed and just parse for sourceMapURL?

@patrickhulce

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2019

Is there a nice way to pass the driver to a computed artifact?

Sadly, no. Computed artifacts are firmly in audit phase territory and there's no way to have dependencies between artifacts unless one is a BaseArtifact

Or is it better to forgo Debugger.onScriptParsed and just parse for sourceMapURL?

I'm not sure I understand the decision here, since it sounds like if you needed a separate gatherer either way you could have the separate one listen on Debugger.onScriptParsed for now? At some point in the future it might make sense to merge these two if the set of audits that need them overlap significantly enough.

@connorjclark

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 1, 2019

I'm not sure I understand the decision here, since it sounds like if you needed a separate gatherer either way you could have the separate one listen on Debugger.onScriptParsed for now?

Failed to realize it's not required to do that in the script-elements. yeah separate gatherer makes 100% sense now.

@connorjclark connorjclark marked this pull request as ready for review Jun 1, 2019

@connorjclark connorjclark referenced this pull request Jun 1, 2019
1 of 10 tasks complete
const a = 1;
// Use this obnoxious URL because using a non-existent url from localhost will return a
// bunch of HTML, which will be parsed, and no fetch error occurs.
//# sourceMappingURL=http://www.this-will-not-exist-blah-go-rockets.com/some-map.js.map

This comment has been minimized.

Copy link
@connorjclark

connorjclark Jun 1, 2019

Author Collaborator

i guess i could do http://localhost:1234 ...

This comment has been minimized.

Copy link
@patrickhulce

patrickhulce Jun 3, 2019

Collaborator

go-rockets

😱

haha 😉 to your actual point though, :1234 is the default for parcel which I tend to have running so that might cause something unexpected too ;) haha

how about an entirely invalid URL? or is that then testing something different you're not concerned about?

This comment has been minimized.

Copy link
@connorjclark

connorjclark Jun 3, 2019

Author Collaborator

i suppose anything that results in a fetch error will work, including a malformed URL.

This comment has been minimized.

Copy link
@connorjclark

connorjclark Jun 3, 2019

Author Collaborator

go-rockets

Did that just to get a rise out of you ;)

@connorjclark connorjclark changed the title Gather source maps core: gather source maps Jun 1, 2019

@codecov

This comment has been minimized.

Copy link

commented Jun 1, 2019

Codecov Report

Merging #9101 into master will decrease coverage by 0.01%.
The diff coverage is 94.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9101      +/-   ##
==========================================
- Coverage   91.44%   91.43%   -0.02%     
==========================================
  Files         291      292       +1     
  Lines        9929     9981      +52     
==========================================
+ Hits         9080     9126      +46     
- Misses        849      855       +6
Flag Coverage Δ
#smoke 84.43% <94.87%> (-0.33%) ⬇️
#unit 89.24% <15.38%> (-0.29%) ⬇️
Impacted Files Coverage Δ
lighthouse-core/config/default-config.js 87.5% <ø> (ø) ⬆️
lighthouse-core/gather/gatherers/source-maps.js 94.87% <94.87%> (ø)
lighthouse-core/audits/user-timings.js 96% <0%> (-4%) ⬇️
...house-core/computed/metrics/lantern-speed-index.js 97.14% <0%> (-2.86%) ⬇️
lighthouse-core/gather/gather-runner.js 99.05% <0%> (-0.95%) ⬇️
lighthouse-core/lib/manifest-parser.js 90.55% <0%> (+1.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0eacf06...5da78cf. Read the comment docs.

@googlebot googlebot added cla: no and removed cla: yes labels Jul 25, 2019

@connorjclark connorjclark added cla: yes and removed cla: no labels Jul 25, 2019

@googlebot

This comment has been minimized.

Copy link

commented Jul 25, 2019

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@googlebot

This comment has been minimized.

Copy link

commented Jul 25, 2019

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Jul 25, 2019

@connorjclark connorjclark added cla: yes and removed cla: no labels Jul 25, 2019

@connorjclark

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 25, 2019

it seems half of these comments could be @googlebot 👎

@googlebot

This comment has been minimized.

Copy link

commented Jul 25, 2019

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Jul 25, 2019

@googlebot

This comment has been minimized.

Copy link

commented Jul 25, 2019

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@connorjclark

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 25, 2019

@brendankenny @exterkamp ya'll wanna add your personal emails to the CLA thing? click the Googler link above

@brendankenny
Copy link
Member

left a comment

🗺 🚜
LGTM!

@brendankenny brendankenny added cla: yes and removed cla: no labels Jul 25, 2019

@brendankenny brendankenny merged commit 9cbfa47 into master Jul 25, 2019

7 of 8 checks passed

cla/google Need a CLA for one or more commit authors
bundlesize Total bundle size is 1.92MB/2.07MB (-null)
Details
codecov/patch 97.29% of diff hit (target 91.68%)
Details
codecov/project 91.69% (+0.01%) compared to 21d00ac
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
now Deployment has completed
Details
pr title lint PR title is good to go, boss
Details

@brendankenny brendankenny deleted the gather-source-maps branch Jul 25, 2019

@googlebot

This comment has been minimized.

Copy link

commented Jul 25, 2019

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.