Skip to content

Block Ghost's own apps during Lighthouse runs - #2

Merged
betschki merged 2 commits into
mainfrom
fix/lighthouse-without-ghost-apps
Oct 30, 2026
Merged

betschki merged 2 commits into
mainfrom
fix/lighthouse-without-ghost-apps

Conversation

@betschki

@betschki betschki commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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 in tests/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 main once before): test/theme.test.mjs printed packageTheme's "── Zip: …" lines into the stream node --test uses 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.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fb69df0e-b2f9-4dea-90c7-5378b815fd97
Commits

Reviewing files that changed from the base of the PR and between 454834a and 01f1555.

Files selected for processing: 4
  • README.md
  • test/theme.test.mjs
  • tests/lib/ghost.mjs
  • tests/lighthouse.spec.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@betschki
betschki merged commit 17d1b85 into main Oct 30, 2026
3 checks passed
@betschki
betschki deleted the fix/lighthouse-without-ghost-apps branch October 30, 2026 08:50
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.

1 participant