perf: cut heavy admin/dialog/results modules from the eager dashboard bundle (round 2, phase 1)#475
Conversation
… bundle Round-2 phase 1 (bundle & mount hygiene). Six modules leave the home route's eager JS, proven by the dev SSR script-tag set: - DocumentManagerPanel suite (SetupChecklist/UploadPanel/IndexingMonitor/ IngestionQualityConsole/LibraryHealthStrip) loads via next/dynamic when an admin drawer opens; its data-only types/helpers move to document-manager-model.ts so consumers never pull the component module. - SettingsDialog and AccountSetupDialog load on first open (useHasEverBeenTrue latch keeps them mounted afterwards, preserving dialog-local state). Sheet renders null while closed, so first-open behavior is unchanged. GuideDialog stays static: it shares dashboard-shell with the eagerly-used UtilityDrawer. - applications-launcher-page: the tools count now reads toolCatalogRecords.length from the data-only catalog instead of a value import that dragged the whole 849-line launcher into the eager chunk. - document-admin: DrawerGroupLabel (3-line presentational) moves to dashboard-shell; its value import was defeating the existing DocumentDrawer dynamic() split. Remaining imports are type-only. - document-search-results: deleting the clinical-dashboard barrel (index.ts + one-line ClinicalDashboard re-export) removes the re-export chain through which the shell eagerly pulled the results panel, un-defeating the round-1 lazy-loading split. The shell now imports ClinicalDashboard directly. - Deletes the dead clinical-dashboard-lazy.tsx / clinical-dashboard-client.tsx wrappers (zero importers). Webpack prod build: the 337.1 KB chunk that mixed the admin panel with the settings dialog is gone (admin code now in a 253.2 KB drawer-time chunk, settings in its own 19.5 KB first-open chunk). Verified: tsc, eslint, prettier, targeted vitest, and verify:ui (120 passed; 4 navigation-timing flakes from dev on-demand compile latency all pass on a warmed targeted re-run). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
cb0bcf3
into
claude/site-performance-speed-61d154
Summary
Phase 1 of the round-2 performance initiative (stacked on #458). Six modules leave the home route's eager JS — including two leaks discovered during verification that were silently defeating existing dynamic() splits:
DocumentManagerPanelsuite (710 lines)SettingsDialog(585) /AccountSetupDialog(336)applications-launcher-page(849)applicationsLauncherItemCountvalue importtoolCatalogRecords.length(data-only catalog)document-admin(~1,100)DrawerGroupLabelvalue import — defeated the existingDocumentDrawersplitDrawerGroupLabelmoved todashboard-shell; remaining imports type-onlydocument-search-results(1,129)clinical-dashboardbarrel the shell imported — defeated round 1's lazy results panelClinicalDashboarddirectlyclinical-dashboard-lazy/client.tsxProof (dev SSR script-tag set, home route):
document-admin,document-search-results,DocumentManagerPanel,settings-dialog,account-setup-dialog,applications-launcherall absent from the eager set (35 script tags).Webpack prod build: the 337.1 KB chunk mixing the admin panel + settings dialog is gone — admin code now in a 253.2 KB drawer-time chunk, settings in a 19.5 KB first-open chunk.
Deliberately NOT done:
ssr:falseon the whole dashboard (blanks FCP); splittingGuideDialog(sharesdashboard-shellwith the eagerly-usedUtilityDrawer— no win).Verification
tsc,eslint,prettierclean; targeted vitest (dashboard suites) greenverify:ui: 120 passed, 4 failures — all navigation-timing flakes from dev on-demand compile latency (first-hit compiles of 6–10s vs 10–15s expect windows); all 4 pass on a warmed targeted re-runSheetrenders null while closed, and theuseHasEverBeenTruelatch keeps dialogs mounted after first open so dialog-local state persists across close/reopen exactly as before🤖 Generated with Claude Code