Repository navigation
Description
Follow-on to the first public-site pass (#778 Track A, #791's audit, #793's Sentry removal). Planned 2026-09-17 from the nightly Lighthouse run on main at c67f930d2 — the first run where every page passes the ratcheted budgets bar one CLS warning. This epic is the next ratchet. (Step 1 shipped 2026-09-17; the harness changed with it — see the note under step 1 before reading this table.)
Where we are
Nightly Lighthouse CI run 35206759488, mobile preset, CI runner, brotli on the wire, median of 3:
| page | perf | FCP | LCP | SI | TBT | TTI | CLS | wire |
|---|---|---|---|---|---|---|---|---|
/ |
0.67 | 2119 | 2119 | 4057 | 2143 | 17866 | 0.020 | 2.89 MB |
/contact |
0.67 | 1974 | 1974 | 4282 | 2002 | 17499 | 0.002 | 2.88 MB |
/jobs |
0.62 | 1761 | 1807 | 7851 | 2427 | 18425 | 0.001 | 2.89 MB |
/privacy |
0.67 | 1969 | 1969 | 4408 | 2026 | 17520 | 0.000 | 2.88 MB |
/support |
0.63 | 1966 | 1966 | 4554 | 1990 | 17480 | 0.114 | 2.88 MB |
/terms |
0.68 | 1697 | 1697 | 4618 | 2006 | 17568 | 0.002 | 2.88 MB |
Two weeks ago /jobs was LCP 94 s and CLS 0.98; / scored 0.52. The paint metrics are now fine. What is left is uniform across pages and is not download: 2.9 MB on the wire, but 2.0–2.4 s of main-thread blocking and ~17.5 s to interactive, because every page parses and executes the whole 13.6 MB entry bundle. That single fact orders everything below.
The plan, in order
1. The lever — route splitting (#797) — done, #803 merged 2026-09-17
Enabled asyncRoutes: { web: 'production' }: 13.6 MB → 8.5 MB of JS per public page (2.88 → 1.55 MB brotli), mapbox-gl and the assessment corpus in their own route chunks. Same machine, same harness: TBT −25–40 %, TTI −27 % on every page, paint metrics unchanged.
What it took, so nobody re-derives it: the async came from React's bootstrapScripts, which @expo/router-server's streaming renderer hands the chunk list to; upstream fixed it in 57.0.10, and patches/@[email protected] back-ports that (drop with the SDK 57 bump, #483). The server-side rewrite this epic proposed would have fixed CI only — production is the EAS worker and never runs apps/scaffald/server/index.js.
- Boots on every public route — 12/12 page×device pairs; new
scripts/audit/boot-pages.mjsruns in the Lighthouse job before it measures, becausehydration-pages.mjsreported clean on a build whose JS died before hydration - Per-page JS ~8.5 MB with mapbox-gl and luscher-test in route chunks
- SSR metadata and JSON-LD unchanged; client navigation into a split route works
- Lighthouse before/after on Route splitting works and the result does not boot: async script tags race the shared chunk #797 and the PR
- Dangling NOTE replaced
- Budget ratchet in
.lighthouserc.json— after the first nightly onmainwith devtools throttling (see the harness note below), not from a guess
Harness change to know about: .lighthouserc.json now uses throttlingMethod: devtools. The default simulated mode produced a bimodal LCP — 2.2 s or 13 s on the same commit — because Lantern estimates from an unthrottled trace and folds hydration into LCP whenever Chrome's first paint lands after the deferred chunks (which finish in ~450 ms on localhost). Real throttling is stable to ~100 ms. The table at the top of this epic and every nightly before 2026-09-17 are not comparable with runs after it. First devtools-throttled CI run on the merged code: perf 0.68–0.79, LCP 1.3–3.0 s (/jobs highest), TBT ~0.93 s, TTI ~13 s.
2. Cheap, independent, any session — do these first or alongside — S each
- Content-hashed assets are cached for one hour, so every repeat visitor re-downloads 17.4 MB #788 immutable cache headers on
/_expo/static/*— applied 2026-09-17 on prod, dev and preview (CloudFront response headers policyscaffald-immutable-assets; repo side in infra(cloudfront): content-hashed assets immutable for a year, loader JSON no longer edge-cached for a day #809). Also found and fixed there: loader JSON under/_expo/loaders/*had been edge-cached for 24 h, so a client-side jump to/jobscould be a day stale; it now caches like the HTML (60 s). - Finish the icon consolidation: bump the ui pointer, once ui-docs can resolve lucide-react-native in CI #795 close-out. The
uipointer already landed via fix(native): no cookie sheet on iOS/Android, and Office tables render as cards on an iPad #794 (91e5fb693, pasta3d473c, CI green). Owed: one export + source-map attribution showinglucide*at ~1.14 MB not 2.20 MB, then close boxes 1–2. Box 3 becomes step 3 below. - No remote error reporting since Sentry left: wire logger.error and ErrorBoundary to PostHog exception capture, or decide on none #800 decide error reporting: PostHog exception capture (already in the bundle, zero new bytes, consent-gated) or explicitly none. Today
logger.errorprints and stops. - Store metadata and RELEASE-PROCESS still name Sentry; the privacy page's effective date and core.legal_documents disagree #801 store metadata, RELEASE-PROCESS and the privacy page's effective date after No remote error reporting since Sentry left: wire logger.error and ErrorBoundary to PostHog exception capture, or decide on none #800's decision. Recommendation recorded there: do not bump
core.legal_documentsfor the Sentry removal; fix thev1.0 / 2025-03-01vsMay 1, 2025mismatch. -
/supportCLS 0.114 — the one budget still warning. Find the shift (likely the same skeleton/min-height class as perf(jobs): render the public listing's rows on the server (LCP 94s → 3s) #783 fixed on/jobs); fold into whichever PR touches that page first.
3. After splitting: shrink what __common still carries — M
Only worth measuring once step 1 lands, because the split changes what is shared.
- Metro tree shaking experiment —
EXPO_UNSTABLE_TREE_SHAKING=1 EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH=1 expo export, one run, one attribution, hydration audit.lucide-react-nativeissideEffects: false, so its 1.14 MB barrel is the headline candidate; zod and our own barrels come along. Zero code change if it holds. - If tree shaking does not hold: the deep-import codemod from Finish the icon consolidation: bump the ui pointer, once ui-docs can resolve lucide-react-native in CI #795 option 1 (246 barrel importers; note the package
exportsmap only exposes.and./icons, andmetro.config.js:19enables package exports, so the resolver needs an exception) - Re-attribute
packages/scf-core(2.2 MB, our largest single area) now that Sentry and the icon fork are gone — what marketing pages still pull from it that a(public)group layout should not
4. Keep the measurement honest — S
- Add a per-page JS-weight line to the nightly (
total-byte-weightis already in the LHRs; print it beside the metrics) so a bundle regression shows up without a manual audit - Turn Bundle audit: what the 17.4 MB web entry bundle is actually made of #791's source-map attribution walk into
scripts/audit/bundle-attribution.mjsso steps 2, 3 and every future "before/after" use the same numbers
Shipped to production — 2026-09-17
scripts/deploy-web-eas.sh prod from a clean worktree at 50b93fcc4 (deployment scf-scaffald--mutwtwajzh, CloudFront invalidated). Verified on scaffald.com: chunks emitted defer in order, entry bundle public, max-age=31536000, immutable, HTML caching unchanged, 12/12 page×device boots, 18/18 hydration clean, JSON-LD intact, /privacy no longer names Sentry, 1.72 MB brotli JS per page. Edge functions were not redeployed — nothing under packages/supabase/functions changed behaviour since 1bdcc0dfd (only #771/#776/#780 tooling), and migration 352 (#784) was already applied.
Decisions for Clay
Each has a recommendation so a session can proceed and be overruled.
- Route splitting works and the result does not boot: async script tags race the shared chunk #797 stopgap vs wait. Recommend the server-side rewrite now, upstream issue in parallel. Nothing upstream fixes it, including SDK 57.
- No remote error reporting since Sentry left: wire logger.error and ErrorBoundary to PostHog exception capture, or decide on none #800 error reporting. Recommend PostHog exception capture; the alternative is accepting blindness and saying so in
logger.ts. - Store metadata and RELEASE-PROCESS still name Sentry; the privacy page's effective date and core.legal_documents disagree #801 legal version. Recommend no
legal_documentsbump — removing a processor narrows the policy and a bump forces every user through re-acceptance. - Content-hashed assets are cached for one hour, so every repeat visitor re-downloads 17.4 MB #788 needs AWS. Either you run it, or a session gets the credentials from Rotate the AWS credentials carried over from the Unicorn org, then prune 11 dead secrets #486's rotation.
Carried from the last session, not performance
- core.jobs.visibility exists in production but no migration creates it #761
core.jobs.visibilityin production with no migration. Real, but a ledger/drift problem in Migration ledger does not reflect production, and two OAuth scope catalogs conflict #437's lineage, and the nightly drift audit checks migration history not columns, so it will not self-report. Keep it on the DB list, not this epic.
What is solid
- Every public page passes the ratcheted budgets except one 0.014 CLS overshoot; LCP is 1.7–2.1 s everywhere; a11y is 1.0 on
/and/contact; hydration is clean across 15 page×device pairs. - Sentry is gone (17.4 → 13.6 MB) and the duplicate icon set is gone on
main, pending the attribution proof. - The measurement is trustworthy: brotli like production, per-device SSR, three runs, and a Lighthouse job that has completed on every push since ci(lighthouse): measure the bundle the way production serves it #789.
- Production, preview and dev were verified on the same commit at the end of the last pass; production has not been redeployed since perf: remove Sentry — 17.4 MB → 13.6 MB #793, so
scaffald.comstill ships Sentry and its privacy text until the nextscripts/deploy-web-eas.sh prod.
Ship
Same route as #778: merge to main (auto-deploys dev.scaffald.com), verify on the run's per-deploy *.expo.app URL, scripts/deploy-web-eas.sh prod from a clean worktree at origin/main, then curl -sI the entry bundle and the HTML for #788 and re-run Lighthouse for the before/after on #797.
Related: #778 (v1.18.0 epic, Track A), #791 (audit), #797, #795, #788, #800, #801, #774 (closed baseline).
Activity
perf(web): route-level code splitting — 13.6 MB → 8.5 MB of JS per pa…
infra(cloudfront): content-hashed assets immutable for a year, loader…