Skip to content

core: unused-javascript-summary computed artifact#10387

Merged
connorjclark merged 63 commits into
masterfrom
unused-js-computed
Apr 23, 2020
Merged

core: unused-javascript-summary computed artifact#10387
connorjclark merged 63 commits into
masterfrom
unused-js-computed

Conversation

@connorjclark

@connorjclark connorjclark commented Feb 27, 2020

Copy link
Copy Markdown
Collaborator

Needed for #10312 - UnusedJavascript audit and bundle visualization data audit will both need the data from this computed artifact.

Mostly involved moving most of unused-javascript to a computed artifact. No filtering or "transfer size"ing is done in the computed artifact.

connorjclark and others added 30 commits December 9, 2019 15:17
commit ecb6260
Author: Connor Clark <cjamcl@google.com>
Date:   Wed Dec 11 15:17:52 2019 -0800

    no index

commit 52796db
Author: Connor Clark <cjamcl@google.com>
Date:   Wed Dec 11 15:17:02 2019 -0800

    no unshift

commit 943e19c
Author: Connor Clark <cjamcl@google.com>
Date:   Wed Dec 11 15:14:21 2019 -0800

    deletionBraceCount

commit caa269b
Author: Connor Clark <cjamcl@google.com>
Date:   Wed Dec 11 15:13:25 2019 -0800

    comments

commit e6fde71
Author: Connor Clark <cjamcl@google.com>
Date:   Wed Dec 11 15:02:50 2019 -0800

    semver

commit 6480198
Author: Connor Clark <cjamcl@google.com>
Date:   Tue Dec 10 21:18:36 2019 -0800

    update frontend

commit 5d17268
Author: Connor Clark <cjamcl@google.com>
Date:   Tue Dec 10 21:07:44 2019 -0800

    rm some ts ignores

commit 7129ef9
Author: Connor Clark <cjamcl@google.com>
Date:   Tue Dec 10 21:04:09 2019 -0800

    trim unneeded code

commit 0b655b6
Author: Connor Clark <cjamcl@google.com>
Date:   Tue Dec 10 20:46:11 2019 -0800

    better cdt lib gen

commit 3333c4f
Author: Connor Clark <cjamcl@google.com>
Date:   Tue Dec 10 20:19:20 2019 -0800

    add sections to source map type

commit 73eca7b
Author: Connor Clark <cjamcl@google.com>
Date:   Tue Dec 10 20:00:02 2019 -0800

    move SDK up b/c global pollution is gone

commit 47e8a41
Author: Connor Clark <cjamcl@google.com>
Date:   Tue Dec 10 19:44:59 2019 -0800

    comment

commit 9f47880
Author: Connor Clark <cjamcl@google.com>
Date:   Mon Dec 9 15:02:57 2019 -0800

    remove unused js

commit 7d50227
Author: Connor Clark <cjamcl@google.com>
Date:   Sat Dec 7 00:36:07 2019 -0800

    nul

commit ed4bb21
Author: Connor Clark <cjamcl@google.com>
Date:   Sat Dec 7 00:33:39 2019 -0800

    remove ParsedURL

commit 43da869
Author: Connor Clark <cjamcl@google.com>
Date:   Sat Dec 7 00:30:08 2019 -0800

    tmp

commit 0d73a8b
Author: Connor Clark <cjamcl@google.com>
Date:   Sat Dec 7 00:22:10 2019 -0800

    reduce code

commit 4a9127d
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 23:52:44 2019 -0800

    delete some stuff not needed

commit dff8358
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 23:24:48 2019 -0800

    errors

commit 808736d
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 22:56:20 2019 -0800

    Common.console

commit 122f2a2
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 22:54:42 2019 -0800

    ts

commit 2f80d5a
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 22:50:18 2019 -0800

    remove hacky globalThis.cdt

commit 7ad9389
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 21:24:00 2019 -0800

    do not pollute global array

commit fa07a80
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 21:17:56 2019 -0800

    mapping test

commit f9408f3
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 20:49:23 2019 -0800

    count lines

commit 6d27caa
Author: Connor Clark <cjamcl@google.com>
Date:   Fri Dec 6 20:41:09 2019 -0800

    initial
@connorjclark

Copy link
Copy Markdown
Collaborator Author

I'm working out why results have changed slightly for unused js audit in the smoke test.

silly reason. I forgot to multiply them by the transferRatio. results are the same now.

@patrickhulce patrickhulce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I skimmed the bulk of the lines changed and they seemed like a move, but if there are areas to focus more attention on let me know :)

Comment thread lighthouse-core/computed/unused-javascript-summary.js Outdated
Comment thread lighthouse-core/computed/unused-javascript-summary.js
// Default threshold is 512, but is lowered here so that squoosh generates more
// results.
// TODO(cjamcl): the bundle visualization feature will require most of the logic currently
// done in unused-javascript to be moved to a computed artifact. When that happens, these

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that what this is?

I'm a little unclear of what else needs to happen to remove this TODO if it's not this PR :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya oops

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so moving this test to the computed artifact makes that file way more complicated. WDYT of keeping the test here, and only testing the source map features of the computed artifact indirectly via the audit test?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah keeping the test here sounds fine to me, we've got the basics in place for testing the computed anyhow.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just remove the TODO then :)

Comment thread lighthouse-core/test/audits/byte-efficiency/unused-javascript-test.js Outdated
Comment thread lighthouse-core/audits/byte-efficiency/unused-javascript.js
Co-Authored-By: Patrick Hulce <patrick.hulce@gmail.com>

@patrickhulce patrickhulce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

* @return {Promise<ByteEfficiencyAudit.ByteEfficiencyProduct>}
*/
static async audit_(artifacts, networkRecords, context) {
const bundles = artifacts.SourceMaps ? await JSBundles.request(artifacts, context) : [];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof, yeah not sure how I missed this. I guess I was still in "oh just code movement" mode until the additions below 🤦

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants