Repository navigation
perf(studio): 32 kB gzip of initial-load headroom - #89
Merged
Merged
Conversation
The initial load was at 419.9 of 420 kB gzip. Rolldown keeps a module whole in its shared chunk, so a shell import of one small hook pulled in the whole module and its imports: SiteShell → useTaxonomyData, useNotifications → Elevation / ElevationRequest → AgentModes, and the bell panel's item components. - The bell's item list (NotificationItems.tsx) loads lazily, fetched as soon as a notification exists. - Small hooks move to their own modules: elevation-actions.ts, useShortDuration.ts, taxonomy-keys.ts (re-exported where they were). - bundle-budget.ts: LAZY_ONLY guards so they cannot creep back. Initial load 419.9 → 387.6 kB gzip (72 chunks instead of 94); the entry stays under its budget. Studio 1204/1204; screenshots of the shell, the ⌘K palette and the bell at 1440 and 390 px pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Studio's initial load was at 419.9 / 420 kB gzip; it is now 387.6 kB, with no behaviour change.
Cause: Rolldown keeps a module whole in its shared chunk. The shell imported small hooks from big modules (
SiteShell→useTaxonomyData;useNotifications→Elevation/ElevationRequest→AgentModes; the bell's item components), which pulled each whole module and its imports into the initial load.Changes
NotificationItems.tsx) isReact.lazy, prefetched as soon as a notification exists. The empty state, toasts and browser notifications are unchanged.elevation-actions.ts,useShortDuration.ts,taxonomy-keys.ts. They are still implemented once and re-exported where they were.bundle-budget.ts: newLAZY_ONLYguards (NotificationItems,AgentModes,Elevation,ElevationRequest,Taxonomy,RelativeTime,lib/taxonomy,lib/seo,lib/activity). The budget stays at 420 kB, so the room is kept for shell features.Checks: Studio 1204/1204; typecheck, design lint (363 files) and size pass; the
vite buildbudget passes. Screenshots of the shell, the ⌘K palette and the bell panel at 1440 and 390 px show no console errors and no sideways scroll.Not taken yet: moving route-only blocks of
en.tsinto lazy namespaces (about 10 kB more), and a lazySitePublishdialog.🤖 Generated with Claude Code