Repository navigation
Block Ghost's own apps during Lighthouse runs - #2
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pod's CI failed Lighthouse with performance 0.81 on the homepage and 0.76 on a post. Locally the same pages score 98 to 99, on Ghost 6.65 and 6.73 alike.
The cause is Lighthouse's simulation, not the theme. On GitHub's runners the CPU is slow and the network to jsDelivr is fast. Portal's 498 KB finished downloading at 129 ms, before the page painted at 217 ms, so the simulated slow phone counted the whole download towards the largest paint: 4.9 s instead of 2.0 s. Comments UI added 239 KB on posts. Themes can't change these scripts; Ghost adds them through
{{ghost_head}}.Lighthouse now runs with
cdn.jsdelivr.net/ghost/*blocked. The pattern lives next to the other Ghost-owned origins intests/lib/ghost.mjs. Blocked requests don't log console errors, so best practices is unaffected.CI run of Pod with this branch (magicpages/pod run 41027099498, same runner speed as the failing run): home 0.98, post 0.98, simulated LCP 2.3 s, all three apps blocked.
Also fixes a flaky unit test that failed this PR (and
mainonce before):test/theme.test.mjsprintedpackageTheme's "── Zip: …" lines into the streamnode --testuses to talk to its test files, which sometimes broke with "Unable to deserialize cloned data". Under load, 44 of 400 runs failed before the fix and 0 of 400 after.