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

feat: Surface Lighthouse results #4773

Merged
merged 28 commits into from
May 3, 2022
Merged

feat: Surface Lighthouse results #4773

merged 28 commits into from
May 3, 2022

Conversation

mxdvl
Copy link
Contributor

@mxdvl mxdvl commented Apr 28, 2022

What does this change?

Surface Lighthouse results in all PRs. On merge to main, update the comment on #4584 to reflect the latest Lighthouse scores.

The script updating the comment is powered by Deno and Github’s official @octokit’s libraries, as well as types from the lhci/cli library.

Why?

Closes #4584

Screenshots

image

jlieb10 and others added 6 commits April 27, 2022 16:54
@github-actions
Copy link

github-actions bot commented Apr 28, 2022

Size Change: -17.4 kB (-1%)

Total Size: 1.65 MB

Filename Size Change
dotcom-rendering/dist/2480.********************.js 0 B -4.14 kB (removed) 🏆
dotcom-rendering/dist/2856.legacy.********************.js 0 B -7.33 kB (removed) 🏆
dotcom-rendering/dist/7750.legacy.********************.js 0 B -4.3 kB (removed) 🏆
dotcom-rendering/dist/9595.********************.js 0 B -7.19 kB (removed) 🏆
dotcom-rendering/dist/DiscussionContainer-importable.********************.js 6.49 kB +138 B (+2%)
dotcom-rendering/dist/DiscussionContainer-importable.legacy.********************.js 6.79 kB +129 B (+2%)
dotcom-rendering/dist/FilterKeyEventsToggle-importable.********************.js 3.32 kB +131 B (+4%)
dotcom-rendering/dist/frontend.server.js 435 kB +2.86 kB (+1%)
dotcom-rendering/dist/guardian-braze-components-end-of-article.********************.js 9.2 kB -882 B (-9%)
dotcom-rendering/dist/guardian-braze-components-end-of-article.legacy.********************.js 9.29 kB -894 B (-9%)
dotcom-rendering/dist/MostViewedRightWrapper-importable.********************.js 9.56 kB +2.37 kB (+33%) 🚨
dotcom-rendering/dist/OnwardsLower-importable.legacy.********************.js 14.6 kB +153 B (+1%)
dotcom-rendering/dist/OnwardsUpper-importable.legacy.********************.js 19.5 kB +149 B (+1%)
ℹ️ View Unchanged
Filename Size Change
dotcom-rendering/dist/1384.legacy.********************.js 3.31 kB 0 B
dotcom-rendering/dist/1440.********************.js 5.72 kB 0 B
dotcom-rendering/dist/1490.********************.js 5.29 kB 0 B
dotcom-rendering/dist/2270.********************.js 3.94 kB 0 B
dotcom-rendering/dist/2270.legacy.********************.js 4.42 kB 0 B
dotcom-rendering/dist/2670.********************.js 3.09 kB 0 B
dotcom-rendering/dist/2947.********************.js 2.6 kB 0 B
dotcom-rendering/dist/2947.legacy.********************.js 2.68 kB 0 B
dotcom-rendering/dist/3178.legacy.********************.js 6.17 kB 0 B
dotcom-rendering/dist/3388.legacy.********************.js 5.42 kB 0 B
dotcom-rendering/dist/3515.********************.js 22.3 kB 0 B
dotcom-rendering/dist/3515.legacy.********************.js 24.7 kB 0 B
dotcom-rendering/dist/3584.********************.js 1.8 kB 0 B
dotcom-rendering/dist/3584.legacy.********************.js 1.8 kB 0 B
dotcom-rendering/dist/3747.legacy.********************.js 31.1 kB +52 B (0%)
dotcom-rendering/dist/4043.legacy.********************.js 2.74 kB 0 B
dotcom-rendering/dist/5224.legacy.********************.js 5.81 kB 0 B
dotcom-rendering/dist/5226.********************.js 5.72 kB 0 B
dotcom-rendering/dist/5226.legacy.********************.js 6.17 kB 0 B
dotcom-rendering/dist/53.********************.js 4.15 kB 0 B
dotcom-rendering/dist/53.legacy.********************.js 4.15 kB 0 B
dotcom-rendering/dist/5334.********************.js 5.09 kB 0 B
dotcom-rendering/dist/5436.legacy.********************.js 2.68 kB 0 B
dotcom-rendering/dist/5976.********************.js 4.78 kB 0 B
dotcom-rendering/dist/6342.********************.js 2.68 kB 0 B
dotcom-rendering/dist/6400.********************.js 21.5 kB 0 B
dotcom-rendering/dist/6400.legacy.********************.js 21.5 kB 0 B
dotcom-rendering/dist/6995.********************.js 33.3 kB 0 B
dotcom-rendering/dist/7576.********************.js 4.62 kB 0 B
dotcom-rendering/dist/7576.legacy.********************.js 5.06 kB 0 B
dotcom-rendering/dist/7800.********************.js 11.3 kB 0 B
dotcom-rendering/dist/8129.legacy.********************.js 11.8 kB 0 B
dotcom-rendering/dist/9439.legacy.********************.js 3.22 kB 0 B
dotcom-rendering/dist/9485.legacy.********************.js 2.92 kB 0 B
dotcom-rendering/dist/9794.legacy.********************.js 2.8 kB 0 B
dotcom-rendering/dist/9804.********************.js 2.78 kB 0 B
dotcom-rendering/dist/9804.legacy.********************.js 2.89 kB 0 B
dotcom-rendering/dist/AlreadyVisited-importable.********************.js 4.52 kB 0 B
dotcom-rendering/dist/AlreadyVisited-importable.legacy.********************.js 4.52 kB 0 B
dotcom-rendering/dist/atomIframe.********************.js 1.76 kB 0 B
dotcom-rendering/dist/atomIframe.legacy.********************.js 2.03 kB 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.********************.js 460 B 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.legacy.********************.js 518 B 0 B
dotcom-rendering/dist/bootCmp.********************.js 8.01 kB 0 B
dotcom-rendering/dist/bootCmp.legacy.********************.js 11.6 kB 0 B
dotcom-rendering/dist/Branding-importable.********************.js 3.99 kB 0 B
dotcom-rendering/dist/Branding-importable.legacy.********************.js 4 kB 0 B
dotcom-rendering/dist/braze-web-sdk-core.********************.js 36.1 kB 0 B
dotcom-rendering/dist/braze-web-sdk-core.legacy.********************.js 36.1 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.********************.js 9.56 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.legacy.********************.js 10.3 kB 0 B
dotcom-rendering/dist/CalloutBlockComponent-importable.********************.js 7.2 kB 0 B
dotcom-rendering/dist/CalloutBlockComponent-importable.legacy.********************.js 7.55 kB 0 B
dotcom-rendering/dist/ChartAtomWrapper-importable.********************.js 262 B 0 B
dotcom-rendering/dist/ChartAtomWrapper-importable.legacy.********************.js 272 B 0 B
dotcom-rendering/dist/CommentCount-importable.********************.js 6.38 kB +84 B (+1%)
dotcom-rendering/dist/CommentCount-importable.legacy.********************.js 6.54 kB 0 B
dotcom-rendering/dist/CommercialMetrics-importable.********************.js 7.06 kB +54 B (+1%)
dotcom-rendering/dist/CommercialMetrics-importable.legacy.********************.js 7.59 kB +45 B (+1%)
dotcom-rendering/dist/CoreVitals-importable.********************.js 6.36 kB +58 B (+1%)
dotcom-rendering/dist/CoreVitals-importable.legacy.********************.js 6.57 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.********************.js 6.82 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.legacy.********************.js 7 kB 0 B
dotcom-rendering/dist/DocumentBlockComponent-importable.********************.js 2.95 kB 0 B
dotcom-rendering/dist/DocumentBlockComponent-importable.legacy.********************.js 3.05 kB 0 B
dotcom-rendering/dist/dynamicImport.********************.js 2.9 kB 0 B
dotcom-rendering/dist/dynamicImport.legacy.********************.js 3.19 kB 0 B
dotcom-rendering/dist/EditionDropdown-importable.********************.js 3.69 kB 0 B
dotcom-rendering/dist/EditionDropdown-importable.legacy.********************.js 3.75 kB 0 B
dotcom-rendering/dist/EmbedBlockComponent-importable.********************.js 2.84 kB 0 B
dotcom-rendering/dist/EmbedBlockComponent-importable.legacy.********************.js 2.92 kB 0 B
dotcom-rendering/dist/embedIframe.********************.js 1.76 kB 0 B
dotcom-rendering/dist/embedIframe.legacy.********************.js 2.04 kB 0 B
dotcom-rendering/dist/EnhancePinnedPost-importable.********************.js 6.14 kB 0 B
dotcom-rendering/dist/EnhancePinnedPost-importable.legacy.********************.js 6.72 kB 0 B
dotcom-rendering/dist/FilterKeyEventsToggle-importable.legacy.********************.js 3.38 kB 0 B
dotcom-rendering/dist/FocusStyles-importable.********************.js 4.71 kB 0 B
dotcom-rendering/dist/FocusStyles-importable.legacy.********************.js 4.77 kB 0 B
dotcom-rendering/dist/ga.********************.js 3.76 kB 0 B
dotcom-rendering/dist/ga.legacy.********************.js 4.03 kB 0 B
dotcom-rendering/dist/GetCricketScoreboard-importable.********************.js 6.92 kB 0 B
dotcom-rendering/dist/GetCricketScoreboard-importable.legacy.********************.js 7.14 kB 0 B
dotcom-rendering/dist/GetMatchNav-importable.********************.js 12 kB +85 B (+1%)
dotcom-rendering/dist/GetMatchNav-importable.legacy.********************.js 12.4 kB +82 B (+1%)
dotcom-rendering/dist/GetMatchStats-importable.********************.js 9.17 kB +90 B (+1%)
dotcom-rendering/dist/GetMatchStats-importable.legacy.********************.js 10 kB +86 B (+1%)
dotcom-rendering/dist/GetMatchTabs-importable.********************.js 5.98 kB 0 B
dotcom-rendering/dist/GetMatchTabs-importable.legacy.********************.js 6.18 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.********************.js 11.1 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.js 10.3 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.legacy.********************.js 11.1 kB 0 B
dotcom-rendering/dist/guardian-braze-components-end-of-article.js 8.71 kB 0 B
dotcom-rendering/dist/GuideAtomWrapper-importable.********************.js 263 B 0 B
dotcom-rendering/dist/GuideAtomWrapper-importable.legacy.********************.js 274 B 0 B
dotcom-rendering/dist/initDiscussion.********************.js 10.2 kB +14 B (0%)
dotcom-rendering/dist/initDiscussion.legacy.********************.js 10.6 kB +43 B (0%)
dotcom-rendering/dist/InstagramBlockComponent-importable.********************.js 2.96 kB 0 B
dotcom-rendering/dist/InstagramBlockComponent-importable.legacy.********************.js 3.04 kB 0 B
dotcom-rendering/dist/InteractiveBlockComponent-importable.********************.js 7.15 kB +94 B (+1%)
dotcom-rendering/dist/InteractiveBlockComponent-importable.legacy.********************.js 7.38 kB 0 B
dotcom-rendering/dist/islands.********************.js 10.5 kB 0 B
dotcom-rendering/dist/islands.legacy.********************.js 11.3 kB 0 B
dotcom-rendering/dist/KnowledgeQuizAtomWrapper-importable.********************.js 268 B 0 B
dotcom-rendering/dist/KnowledgeQuizAtomWrapper-importable.legacy.********************.js 280 B 0 B
dotcom-rendering/dist/LabsHeader-importable.********************.js 8.27 kB 0 B
dotcom-rendering/dist/LabsHeader-importable.legacy.********************.js 8.42 kB 0 B
dotcom-rendering/dist/Links-importable.********************.js 5.66 kB 0 B
dotcom-rendering/dist/Links-importable.legacy.********************.js 5.73 kB 0 B
dotcom-rendering/dist/LiveBlogEpic-importable.********************.js 5.65 kB 0 B
dotcom-rendering/dist/LiveBlogEpic-importable.legacy.********************.js 3.96 kB 0 B
dotcom-rendering/dist/Liveness-importable.********************.js 3.32 kB +7 B (0%)
dotcom-rendering/dist/Liveness-importable.legacy.********************.js 5.82 kB 0 B
dotcom-rendering/dist/MapEmbedBlockComponent-importable.********************.js 7.89 kB 0 B
dotcom-rendering/dist/MapEmbedBlockComponent-importable.legacy.********************.js 8.18 kB +84 B (+1%)
dotcom-rendering/dist/MostViewedFooterData-importable.********************.js 12.5 kB 0 B
dotcom-rendering/dist/MostViewedFooterData-importable.legacy.********************.js 10.4 kB 0 B
dotcom-rendering/dist/MostViewedRightWrapper-importable.legacy.********************.js 7.54 kB +99 B (+1%)
dotcom-rendering/dist/newsletterEmbedIframe.********************.js 1.92 kB 0 B
dotcom-rendering/dist/newsletterEmbedIframe.legacy.********************.js 2.18 kB 0 B
dotcom-rendering/dist/OnwardsLower-importable.********************.js 14.3 kB 0 B
dotcom-rendering/dist/OnwardsUpper-importable.********************.js 19.1 kB 0 B
dotcom-rendering/dist/ophan.********************.js 7.11 kB 0 B
dotcom-rendering/dist/ophan.legacy.********************.js 7.33 kB 0 B
dotcom-rendering/dist/PersonalityQuizAtomWrapper-importable.********************.js 271 B 0 B
dotcom-rendering/dist/PersonalityQuizAtomWrapper-importable.legacy.********************.js 282 B 0 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.********************.js 263 B 0 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.legacy.********************.js 274 B 0 B
dotcom-rendering/dist/PulsingDot-importable.********************.js 1.66 kB 0 B
dotcom-rendering/dist/PulsingDot-importable.legacy.********************.js 1.76 kB 0 B
dotcom-rendering/dist/QandaAtomWrapper-importable.********************.js 262 B 0 B
dotcom-rendering/dist/QandaAtomWrapper-importable.legacy.********************.js 273 B 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.********************.js 4.58 kB 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.legacy.********************.js 4.6 kB 0 B
dotcom-rendering/dist/readerRevenueDevUtils.********************.js 3.35 kB 0 B
dotcom-rendering/dist/readerRevenueDevUtils.js 2.34 kB 0 B
dotcom-rendering/dist/readerRevenueDevUtils.legacy.********************.js 4.4 kB 0 B
dotcom-rendering/dist/ReaderRevenueLinks-importable.********************.js 5.08 kB 0 B
dotcom-rendering/dist/ReaderRevenueLinks-importable.legacy.********************.js 5.46 kB 0 B
dotcom-rendering/dist/relativeTime.********************.js 2.3 kB 0 B
dotcom-rendering/dist/relativeTime.legacy.********************.js 2.57 kB 0 B
dotcom-rendering/dist/RichLinkComponent-importable.********************.js 8.57 kB 0 B
dotcom-rendering/dist/RichLinkComponent-importable.legacy.********************.js 8.74 kB 0 B
dotcom-rendering/dist/sentry.********************.js 684 B 0 B
dotcom-rendering/dist/sentry.legacy.********************.js 691 B 0 B
dotcom-rendering/dist/sentryLoader.********************.js 5.08 kB 0 B
dotcom-rendering/dist/sentryLoader.legacy.********************.js 8.02 kB 0 B
dotcom-rendering/dist/SetABTests-importable.********************.js 8.65 kB 0 B
dotcom-rendering/dist/SetABTests-importable.legacy.********************.js 9.19 kB 0 B
dotcom-rendering/dist/ShareCount-importable.********************.js 6.48 kB +86 B (+1%)
dotcom-rendering/dist/ShareCount-importable.legacy.********************.js 6.65 kB +86 B (+1%)
dotcom-rendering/dist/shimport.********************.js 2.78 kB 0 B
dotcom-rendering/dist/shimport.legacy.********************.js 2.79 kB 0 B
dotcom-rendering/dist/SignInGateMain.********************.js 4.49 kB 0 B
dotcom-rendering/dist/SignInGateMain.js 2.87 kB 0 B
dotcom-rendering/dist/SignInGateMain.legacy.********************.js 4.59 kB 0 B
dotcom-rendering/dist/SignInGateSelector-importable.********************.js 5.43 kB 0 B
dotcom-rendering/dist/SignInGateSelector-importable.legacy.********************.js 5.78 kB 0 B
dotcom-rendering/dist/SlotBodyEnd-importable.********************.js 9.35 kB 0 B
dotcom-rendering/dist/SlotBodyEnd-importable.legacy.********************.js 10.7 kB +2 B (0%)
dotcom-rendering/dist/SpotifyBlockComponent-importable.********************.js 7.81 kB +94 B (+1%)
dotcom-rendering/dist/SpotifyBlockComponent-importable.legacy.********************.js 8.1 kB +85 B (+1%)
dotcom-rendering/dist/StickyBottomBanner-importable.********************.js 8.99 kB 0 B
dotcom-rendering/dist/StickyBottomBanner-importable.legacy.********************.js 11 kB 0 B
dotcom-rendering/dist/SubNav-importable.********************.js 6.1 kB +88 B (+1%)
dotcom-rendering/dist/SubNav-importable.legacy.********************.js 6.29 kB 0 B
dotcom-rendering/dist/TimelineAtomWrapper-importable.********************.js 264 B 0 B
dotcom-rendering/dist/TimelineAtomWrapper-importable.legacy.********************.js 274 B 0 B
dotcom-rendering/dist/TopRightAdSlot-importable.********************.js 2.24 kB 0 B
dotcom-rendering/dist/TopRightAdSlot-importable.legacy.********************.js 2.27 kB 0 B
dotcom-rendering/dist/TweetBlockComponent-importable.********************.js 1.8 kB 0 B
dotcom-rendering/dist/TweetBlockComponent-importable.legacy.********************.js 1.79 kB 0 B
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.********************.js 2.94 kB 0 B
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.legacy.********************.js 3.03 kB 0 B
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.********************.js 7.91 kB 0 B
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.legacy.********************.js 8.19 kB 0 B
dotcom-rendering/dist/VineBlockComponent-importable.********************.js 2.77 kB 0 B
dotcom-rendering/dist/VineBlockComponent-importable.legacy.********************.js 2.85 kB 0 B
dotcom-rendering/dist/YoutubeBlockComponent-importable.********************.js 8.56 kB 0 B
dotcom-rendering/dist/YoutubeBlockComponent-importable.legacy.********************.js 8.91 kB 0 B

compressed-size-action

@github-actions
Copy link

github-actions bot commented Apr 29, 2022

⚡️ Lighthouse report for the changes in this PR

Lighthouse tested 2 URLs

⚠️ Budget exceeded for 1 of 10 audits.

Report for Article

tested url https://www.theguardian.com/commentisfree/2020/feb/08/hungary-now-for-the-new-right-what-venezuela-once-was-for-the-left

Category Status Expected Actual
First Contentful Paint 1500 1136
Largest Contentful Paint 3000 2208
Time to Interactive 3500 2068
Cumulative Layout Shift ⚠️ 0.002 0.004223
accessibility 0.97 1.000000

Report for Front

tested url https://www.theguardian.com/uk

Category Status Expected Actual
First Contentful Paint 1500 1339
Largest Contentful Paint 3000 2702
Time to Interactive 3500 2893
Cumulative Layout Shift 0.002 0.000000
accessibility 0.97 0.990000

@mxdvl mxdvl marked this pull request as ready for review April 29, 2022 10:50
@mxdvl
Copy link
Contributor Author

mxdvl commented Apr 29, 2022

if we’re all happy with this I will squash & merge, because there’s lots of WIP commits in there.

@bryophyta
Copy link
Contributor

if we’re all happy with this I will squash & merge, because there’s lots of WIP commits in there.

that's fine by me 👍

mxdvl added 2 commits April 29, 2022 16:28
also update the location of the `includePassedAssertions`
setting to be inside the lighthouserc.js config file
@jlieb10
Copy link
Contributor

jlieb10 commented May 3, 2022

if we’re all happy with this I will squash & merge, because there’s lots of WIP commits in there.

Yes I sometimes do a WIP after pairing if a task hasn't reached its endpoint but I need to sign off, so the branch can be pulled by whoever else is working on it. Big fan of squashing when I merge.

const dir = "dotcom-rendering/.lighthouseci";

const links: Record<string, string> = JSON.parse(
Deno.readTextFileSync(`${dir}/links.json`)
Copy link
Contributor

Choose a reason for hiding this comment

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

great

Copy link
Member

@AshCorr AshCorr left a comment

Choose a reason for hiding this comment

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

This is awesome! This will help a lot!

const getStatus = (
passed: boolean,
level: AssertionResult["level"]
): "✅" | "⚠️" | "❌" => {
Copy link
Member

Choose a reason for hiding this comment

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

Theres something interesting about a function that has an "emoji" return type, love it!

@mxdvl mxdvl merged commit 6c6e83f into main May 3, 2022
@mxdvl mxdvl deleted the jtl-surface-lighthouse branch May 3, 2022 11:27
@mxdvl
Copy link
Contributor Author

mxdvl commented May 11, 2022

A bit cheeky, usually this would be for others’s PRs, but I’ll nominate this as a hidden gem 💎 .

guardian/playground#14

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.

Surface Github Lighthouse numbers on PRs
4 participants