Repository navigation
perf(web): keep sign-in, the seek bar, and admin user code out of the launch bundle - #2246
Conversation
The bundle check failed whenever the eager launch bundle moved more than 1 KB from the number in web/perf-budget.json, in either direction. Pull requests that grew it by less than that left the number alone, so main drifted to the edge and the next unrelated change crossed it; editing a lazy page also shifts the entry chunk by a few hundred bytes because it lists lazy chunk hashes. The number was rewritten 16 times in 16 days, mostly to match main. The check now prints the eager size without failing on it. It still fails when the React vendor chunk imports another chunk and when index.html gains a cross-origin render-blocking resource. The pnpm script keeps its name because PR CI runs main's copy of the workflow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… launch bundle Every launch downloaded code that a signed-in Home never runs: - The Login page and its QR code library. Login now loads like the other sign-in pages, behind the routed Suspense boundary. - The full SeekBar component, which the persistent playback bar imported only for formatTime. formatTime moves to player/utils/formatTime.ts and every caller imports it from there. - The codec detection module, which the shell only prewarms. The prewarmer now imports it dynamically; the watch page still probes on its own if the warm-up fails. - The admin users API, which the admin sessions code reached only for three helpers re-exported from adminAuthority.ts. Those callers now import adminAuthority.ts directly. The eager launch bundle drops from 322,326 to 303,365 brotli bytes, and the entry chunk from 204,479 to 185,517. The boot request-budget test preloads the Login module, since its settle loop waits on requests and not on module imports. The vendor-react chunk hash changes once because the lazy Login chunk needs a CommonJS interop helper for react-qr-code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The reviewed formatter change preserves current call sites, and no merge-blocking risk is evident. Pre-merge checks |
|
|
Note Grok commenting on Quick's behalf. Ranked impact: perf, priority: P2: trims sign-in, seek bar, and admin user code from the launch bundle for every visit; nothing is broken today. Scope note: replacing the byte-count budget gate with a report is a separate CI policy change from the code splitting (the description calls it "Separately"), so it may be worth its own PR if reviewers want to weigh it on its own. |
# Conflicts: # web/src/player/components/ChaptersMenu.tsx
…dle" This branch only carried that commit so the web launch bundle budget check would pass. Silo-Server#2246 fixed the budget on main, so the change now stays in Silo-Server#2204 alone. This reverts commit e954671.
…ayed mark (#2217) * fix(web): keep the download storage API out of the launch bundle RealtimeEventsProvider loads with the app and imported adminDownloadStorageRootKey from the download storage API module, which pulled that whole module into the launch chunk. The key now lives in adminDownloadStorageCache, as adminSessionsKey does, so the API stays in the admin Downloads chunk. The launch bundle drops from 326,619 B to 326,313 B brotli, back inside the budget check's tolerance. * fix(userstore): keep a played mark made in the same second as a removal A history removal stores its watermark to the microsecond, but imported progress and history were checked against it as whole-second RFC 3339 text. A played mark in the same second as an earlier removal compared at or before the watermark and stayed hidden, while webhook sync recorded the event as applied. The Postgres store now compares imported writes with the watermark as timestamptz, and watch state hands imported history to the store with its full time. Imported history keeps its whole-second stamp unless that second is at or before the watermark, so replays still match rows stored before. SQLite keeps whole-second text and truncates sub-second input. * fix(userstore): count imports in the same second as one play An import that lands in a removal's second keeps its precise time, so an exact-time duplicate check let the same play through twice when two sources reported it a few milliseconds apart. Imported history now treats any row in the same second as the same play, which also still matches whole-second rows stored before. AddHistory inserts the time it checked. * test(userdb): check the error from closing the test database * Revert "fix(web): keep the download storage API out of the launch bundle" This branch only carried that commit so the web launch bundle budget check would pass. #2246 fixed the budget on main, so the change now stays in #2204 alone. This reverts commit e954671. --------- Co-authored-by: Quick104 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Problem
Related issue: N/A
Validation tasks: none
The web app's launch bundle carried code most visits never run: the sign-in page, the seek bar, and the admin user module. Shared helpers pulled the last two in by import. Separately, CI failed any PR whose launch bundle moved more than 1 KiB from the number in
web/perf-budget.json, so each size change needed a budget edit unrelated to the change.This change moves that code out of the launch bundle and replaces the byte-count gate with a report. It affects web app load time for everyone and the CI workflow for contributors.
Approach
Launch bundle:
Loginis now a lazy route, like the other auth pages.formatTimemoves fromSeekBar.tsxtoplayer/utils/formatTime.ts. Importers offormatTimeno longer pull in the seek bar.adminAuthorityinstead ofadminUsers, so the admin user module stays out of the launch path.signedInBoot.test.tsxloads the Login module before each run, so the suspended route doesn't outlast the test's settle step.CI:
budget:checkstill prints the launch bundle size. It now fails only when the React vendor chunk imports another chunk orindex.htmlgains a cross-origin render-blocking resource. A config change can break those two silently, and a byte count can't tell a real regression from normal churn.perf-budget.jsonandbudget:updateare removed, and the CI step andCONTRIBUTING.mdare renamed to match.Web only. No API, jellycompat,
silo-apple, orsilo-androidimpact.Validation
tsc -b,pnpm run format:checkon changed files, and ESLint on changed files pass. ESLint reports only warnings that already exist on lines this PR doesn't touch.make test-web: 843 files, 7,287 tests pass.pnpm run budget:checkon production builds: the eager launch bundle drops from 322,316 to 303,444 brotli bytes, and the entry chunk from 204,469 to 185,596. The vendor chunk imports nothing, andindex.htmlhas no cross-origin render-blocking resources.vite previewand opened/login: the sign-in page renders the same on both. The Login chunk, including the CommonJSreact-qr-codepackage, loads and runs without console errors.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-2246/
Risks
pnpm run budget:updatewill break. Nothing in this repository calls it.Checklist
AI Disclosure