Skip to content

finding(console): two declared-lazy views are held in the eager closure by CHUNK CO-TENANCY, a mechanism no source-level search can see #6680

Description

@claude

Found while implementing objectui#6535. Filed unassigned, recording only. Observational: nothing is broken.

Measured on ece68882 plus objectui#6535's branch, from a console vite build and the emitted chunks' own module lists (dist/stats.html).

What was measured

objectui#6535 removed the app-shell barrel's static edge to the route views. Three of the six eager views went lazy. Two did not, and the reason is not an import of the view at all -- it is CHUNK CO-TENANCY: rolldown emits the view in a chunk it shares with a module that IS eagerly used, so the whole chunk is eager and the view's bytes ride along.

declared-lazy viewits chunk also holdsthe eager co-tenant's importer
views/RecordFormPage.tsx (2,317 B gz)providers/expressionUser.tsconsole/AppContent.tsx imports it statically; the barrel re-exports it to the console's InternalFormRoute.tsx
views/ReportView.tsx (4,125 B gz)views/ReportConfigPanel.tsx, views/RuntimeDraftBar.tsxviews/ViewConfigPanel.tsx (a barrel export the console uses) imports RuntimeDraftBar statically

providers/expressionUser.ts is objectui#6515's leaf module.

Why this is worth a card

This mechanism is invisible to every source-level search. git grep for a static import of RecordFormPage finds only the barrel line objectui#6535 already neutralised -- the view has NO remaining source-level static importer, and it is eager anyway. Only the emitted chunk's module list shows it. Anyone measuring this area from the source graph will conclude the split works.

It is also not confined to these two: it is a property of how rolldown assigns a shared leaf module with few importers, so any future lazy() boundary can be defeated the same way with nothing in the diff to see.

What this card does NOT claim

  • Not a budget regression. The eager closure PASSES: 3231.7 KB of a 3266.6 KB ceiling after objectui#6535.
  • Not obviously fixed by moving the co-tenants. providers/expressionUser.ts sits in a package area held by objectui#6559 at the time of writing, and the obvious lever -- an advancedChunks group in apps/console/vite.config.ts that isolates the shared leaves -- is a chunking-policy change that interacts with the per-chunk ceilings and needs its own measurement.

Suggested shape, if graded

Measure whether an advancedChunks group isolating the shared app-shell leaf modules separates them without moving other chunks past their ceilings. scripts/vite-declared-lazy-views.ts already pins both views with the co-tenant named, so a fix that lands will FAIL the build until the ledger entry is deleted -- the win cannot be taken silently.

Related

  • objectui#6535 -- the card this was found under; both views are pinned in its ledger.
  • objectui#6515 -- the leaf module in the RecordFormPage chunk.
  • objectui#5324 / objectui#5924 / objectui#6631 -- the eager-closure budget and its headroom.

Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:queuepriority:p2

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions