Skip to content

perf(web): keep the app's providers off the marketing site - #1123

Merged
danielgerhart merged 2 commits into
mainfrom
perf/marketing-js
Nov 20, 2026
Merged

danielgerhart merged 2 commits into
mainfrom
perf/marketing-js

Conversation

@danielgerhart

@danielgerhart danielgerhart commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1122

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

The root layout keeps only the theme provider; React Query, the toaster and BFF error handling move to AppProviders, mounted by the (tenant)/[org] and (admin)/admin layouts around their shells.

Why

Marketing pages downloaded the signed-in app's machinery. Production build, gzip: /blog, /product, /features/review 247 → 198 KB; / 278 → 229; /pricing 257 → 208. The remaining ~150 KB is React and the Next runtime.

Proof

tsc, eslint clean; next build succeeds; sizes above measured from the build's own chunks. Every useQuery/useToast consumer is under the two wrapped layouts (login, reset, invite and the widget use neither). Full unit, component and Playwright tiers run in CI.

Risk & rollback

A page outside the two app layouts that starts using React Query or toasts would throw for a missing provider; CI's app tiers cover today's pages. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:3e3bc06b-d81e-4190-ac2b-57548484e1b3 on 6384b48a4e71 · 2026-11-21T00:05:39Z — reverted by #1124 (99b0d1a9).

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not: blocked — merge fd8c72a3 turned frontend red (run 44837410412: desktop-chromium audit holds its clock while paused failed all three attempts). Reverted by Revert "perf(web): keep the app's providers off the marketing site (#1123)" #1124; main green again on 99b0d1a9 (frontend 44840266590 success).
  • images built, or correctly never ran because nothing that goes into
    an image changed: images built for fd8c72a3; superseded by the revert.
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion: deploy 44837596912 success; the live site served 198 KB gzip JS on /blog and /product (was 247) until the revert deployed (deploy 44840462339).
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change: blocked — change reverted before the nightly legs ran.
  • the board card reached Done through the automation rather than by
    hand, and the issue closed: Marketing pages load the signed-in app's providers #1122 reopened after the revert; it tracks the re-land.
  • follow-ups are open for everything deferred here — numbers: deferred — Marketing pages load the signed-in app's providers #1122 (re-land with the root cause of the audit-test failure); Docs code headers: dark-mode contrast failure in WebKit #1125 fixed the separate docs contrast flake.
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned: recorded here: the audit lock test is timing-sensitive; re-landing needs a local browser run of marketing-interactions.spec.ts before merge.

Specific to this change

Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Files

🤖 Generated with Claude Code

danielgerhart and others added 2 commits November 20, 2026 23:04
The root layout wrapped every page in React Query, the toaster and BFF
error handling, so a static blog post shipped 247 KB gzip of JavaScript.
The root keeps only the theme provider; AppProviders wraps the tenant and
admin shells. Measured on a production build: /blog, /product and
/features/review 247 -> 198 KB gzip, / 278 -> 229, /pricing 257 -> 208.
What remains is mostly React and the Next runtime (~150 KB).

Closes 1122

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@danielgerhart
danielgerhart merged commit fd8c72a into main Nov 20, 2026
40 checks passed
danielgerhart added a commit that referenced this pull request Nov 20, 2026
…1123)" (#1124)

This reverts commit fd8c72a. On main it fails the desktop-chromium
"audit holds its clock while paused" test on every attempt (run
44837410412); that test passed on main before the merge and on every
other recent merge, so the change is the likely cause. One diagnosis
pass did not produce an obvious fix, so per land-pr this reverts rather
than leaving main red. The speed fix will be re-landed with a root cause.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Marketing pages load the signed-in app's providers

1 participant