Found while implementing objectui#6535. Filed unassigned, recording only. Observational: nothing is broken.
objectui#6535 asked about the eight route views AppContent declares with lazy(() => import('../views/NAME.js')). While measuring those, the same read of apps/console/dist/eager-closure.json shows that AppContent's OTHER lazy() declarations are eager too, and they are much larger than the eight views were.
Measured on ece68882 plus objectui#6535's branch (files[] IS the eager set, 49 of 508 chunks):
| chunk | declared in AppContent.tsx as | gzipped, eager |
|---|
metadata-admin | six lazy() pages (MetadataDirectoryPage, StudioHomePage, MetadataResourceListPage, MetadataResourceEditPage, MetadataResourceHistoryPage, MetadataDiagnosticsPage) | 181,228 B |
MarketplacePackagePage | lazy() | 7,672 B |
MarketplacePage | lazy() | 3,129 B |
MarketplaceInstalledPage | lazy() | 1,842 B |
That is ~193.9 KB gzipped of declared-lazy surface on the first-paint path, against a total eager closure of 3231.7 KB and a ceiling of 3266.6 KB -- i.e. roughly 5.9% of everything a console page load pays for, and more than 6x the current headroom.
For scale: the eight views objectui#6535 was filed about were worth 5.3 KB once freed. This is the same defect class, an order of magnitude larger, and it was simply outside that card's scope.
Why it is separate from objectui#6535
objectui#6535's scope was the eight single-file route views, and its repair (scripts/vite-declared-lazy-views.ts) deliberately parses ONLY the ../views/NAME.js specifiers. Widening that ledger to a directory barrel (../views/metadata-admin/index.js), a sibling directory (./marketplace/*.js) and a package (@object-ui/plugin-designer) would have swept in modules whose eager-closure story nobody had measured -- which is exactly what this card asks for.
The mechanism is very likely NOT the same one objectui#6535 fixed. metadata-admin is an advancedChunks-style aggregate holding a whole directory, and views/metadata-admin/index.ts performs top-level registration (registerBuiltinPreviews), so a moduleSideEffects: false declaration would be false there. Measure before assuming.
What this card does NOT claim
- Not a budget regression --
pnpm check:eager-closure PASSES today. - Not that these should simply be deleted or made side-effect-free.
views/metadata-admin/index.ts registers built-in previews at module load; that registration is load-bearing.
Suggested shape, if graded
For each of the four, find the static edge into the eager closure the way objectui#6535 did -- the emitted chunk's own module list, not a source-level search (see objectui#6680 for why the source graph is not enough). Then decide per chunk whether the edge is removable. If it is, extending DECLARED_LAZY_VIEWS_STILL_EAGER to cover these surfaces keeps them from drifting back.
Related
- objectui#6535 -- the card this was found under; the same measurement, narrower scope.
- objectui#6680 -- chunk co-tenancy, the mechanism that defeated two of objectui#6535's views.
- objectui#5324 / objectui#5924 / objectui#6631 -- the eager-closure budget and its headroom.
Generated by Claude Code
Found while implementing objectui#6535. Filed unassigned, recording only. Observational: nothing is broken.
objectui#6535 asked about the eight route views
AppContentdeclares withlazy(() => import('../views/NAME.js')). While measuring those, the same read ofapps/console/dist/eager-closure.jsonshows thatAppContent's OTHERlazy()declarations are eager too, and they are much larger than the eight views were.Measured on
ece68882plus objectui#6535's branch (files[]IS the eager set, 49 of 508 chunks):AppContent.tsxasmetadata-adminlazy()pages (MetadataDirectoryPage,StudioHomePage,MetadataResourceListPage,MetadataResourceEditPage,MetadataResourceHistoryPage,MetadataDiagnosticsPage)MarketplacePackagePagelazy()MarketplacePagelazy()MarketplaceInstalledPagelazy()That is ~193.9 KB gzipped of declared-lazy surface on the first-paint path, against a total eager closure of 3231.7 KB and a ceiling of 3266.6 KB -- i.e. roughly 5.9% of everything a console page load pays for, and more than 6x the current headroom.
For scale: the eight views objectui#6535 was filed about were worth 5.3 KB once freed. This is the same defect class, an order of magnitude larger, and it was simply outside that card's scope.
Why it is separate from objectui#6535
objectui#6535's scope was the eight single-file route views, and its repair (
scripts/vite-declared-lazy-views.ts) deliberately parses ONLY the../views/NAME.jsspecifiers. Widening that ledger to a directory barrel (../views/metadata-admin/index.js), a sibling directory (./marketplace/*.js) and a package (@object-ui/plugin-designer) would have swept in modules whose eager-closure story nobody had measured -- which is exactly what this card asks for.The mechanism is very likely NOT the same one objectui#6535 fixed.
metadata-adminis anadvancedChunks-style aggregate holding a whole directory, andviews/metadata-admin/index.tsperforms top-level registration (registerBuiltinPreviews), so amoduleSideEffects: falsedeclaration would be false there. Measure before assuming.What this card does NOT claim
pnpm check:eager-closurePASSES today.views/metadata-admin/index.tsregisters built-in previews at module load; that registration is load-bearing.Suggested shape, if graded
For each of the four, find the static edge into the eager closure the way objectui#6535 did -- the emitted chunk's own module list, not a source-level search (see objectui#6680 for why the source graph is not enough). Then decide per chunk whether the edge is removable. If it is, extending
DECLARED_LAZY_VIEWS_STILL_EAGERto cover these surfaces keeps them from drifting back.Related
Generated by Claude Code