PERF: Load only the active reader route - #173
Conversation
Context: Opening any route loaded a 4.76 MB script containing unrelated readers, benchmark tools, and datasets before the requested page could appear. Changes: Defer feature modules, unify local packet loading, preserve aliases and route identity, and report failed downloads without adding retries or dependencies. Impact: Controlled cold library readiness falls from 1813ms to 1099ms median; initial decoded JavaScript falls from 4759KB to 1860KB. Tests: 25 focused Vitest cases; 3 production Chromium cases; typecheck, build, integrity, and scoped lint/diff checks. Preserve the existing alias-effect warning. Docs: Add a reproducible local-only probe and measured receipt; update WORKLOG. ADR: CORE-006 existing lazy-loading intent.
Context: The latency review also exposed redundant subscriptions/discovery, weak validation coverage, setup friction, and hardcoded provenance copy. Changes: Add six scoped follow-up tickets to the existing Issues.md with evidence, acceptance criteria, ownership, risk, and confidence; cross-reference the debt inbox. Impact: Other agents can pick up bounded deletion-first improvements without expanding the current route-loading change. Tests: Documentation links and scoped whitespace checks. Docs: Issues.md and docs/roadmaps/TECH-DEBT-INBOX.md.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # docs/WORKLOG.md
|
@codex review Please review exact current head 7bff3f7 and the focused route-loading diff above #174. Refreshed Node 24.19.0 unit, type, build and production browser checks pass; the PR description contains the updated controlled startup measurements. The latest merge carries the Windows configuration correction and retained documentation only; no route changes since the measured source. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Retain both issue/debt queues; carry the reviewed route guard and ADR amendment. Startup sources are unchanged. Combined provider/settings/dialog and app-screen tests plus TypeScript pass; fresh CI follows.
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
The library and Gita entry routes downloaded the full reader dependency tree before showing their own content. Load the reader and liturgy routes through React lazy/Suspense so each entry fetches only what it needs, retaining the existing chunk-download error UI.
Changes
App.tsxshrinks from 162 to 160 lines. Keep native React loading and error handling; no route loader framework, dependency changes or background automation. The existing startup issue includes a reproducible cold-browser probe and refreshed evidence.Testing
Node 24.19.0: 25 focused tests, TypeScript, production build and three existing route browser tests pass. Twelve controlled cold Chromium runs (three per route/version, 4× CPU slowdown, 80 ms/10 Mbit network, gzip, external traffic blocked) report no page errors.
Median library readiness: 1,916 → 1,167 ms; JavaScript transferred: 4,765 → 1,867 KB. Median Gita readiness: 1,757 → 610 ms; JavaScript: 4,764 → 197 KB. Synthetic cold-start measurements are not production latency guarantees.
Review
Stacked on #174 to keep already-reviewed configuration changes out of this diff. No merge or deployment. CI and review must cover the current remote head.