Skip to content

Commit 5986ae7

Browse files
committed
build(console): keep the marketplace namespace loader and its page frame out of the eager closure
The loader's chunk group followed its imports and took the eager locale registry and preload helper; the frame, shared by the two lazy pages, sat in the chunk they share with the eager Studio packages page. Both groups now hold only their own module, so the loader, the frame and the ten catalogues are lazy and the eager closure changes only by the i18n-locale-en chunk's reading, recorded beside its ceiling. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgXDwFw71MwSG9FKYDQ
1 parent f10a7fd commit 5986ae7

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

‎ui/apps/console/vite.config.ts‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,27 @@ export default defineConfig({
12421242
// when a marketplace page mounts, none is resident, so one group per
12431243
// catalogue for the rule above. The loader module gets a group too:
12441244
// without one it would fall to `i18n-runtime` below and be eager,
1245-
// while its only reader is the marketplace pages' lazy route chunk.
1246-
{ name: 'i18n-ns-marketplace', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]index\.ts$/, priority: 84 },
1245+
// while its only reader is the marketplace pages' frame.
1246+
//
1247+
// ⛔ Both the loader's group and the frame's (`marketplace-namespace-gate`,
1248+
// app-shell's `MarketplaceNamespaceGate.tsx`, the one module that
1249+
// imports the loader) take `includeDependenciesRecursively: false`,
1250+
// and the frame needs its group at all, for two measured reasons
1251+
// (console build of objectstack#30588, eager closure read from
1252+
// `eager-closure.json`):
1253+
// - with rolldown's default the loader's group followed its imports
1254+
// and took `locales/registry.ts` out of `i18n-runtime` and the
1255+
// dynamic-import preload helper out of `framework`; both are
1256+
// eager, so the group became an eager 2,374 B gz chunk;
1257+
// - without a group of its own the frame, shared by the two lazy
1258+
// marketplace pages, landed in the chunk those pages share with
1259+
// the eager Studio packages page (`MarketplaceRowActions.tsx` and
1260+
// the refusal readers), which is EAGER by that co-tenancy, and
1261+
// pulled the loader into the eager closure with it (+1,281 B gz).
1262+
// With both, the loader, the frame and the ten catalogues are lazy,
1263+
// the shared chunk is the one the base build emits, and the only
1264+
// change to the eager closure is `i18n-locale-en`'s.
1265+
{ name: 'i18n-ns-marketplace', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]index\.ts$/, priority: 84, includeDependenciesRecursively: false },
12471266
{ name: 'i18n-ns-marketplace-en', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]en\.ts$/, priority: 84 },
12481267
{ name: 'i18n-ns-marketplace-zh', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]zh\.ts$/, priority: 84 },
12491268
{ name: 'i18n-ns-marketplace-ja', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]ja\.ts$/, priority: 84 },
@@ -1254,6 +1273,7 @@ export default defineConfig({
12541273
{ name: 'i18n-ns-marketplace-pt', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]pt\.ts$/, priority: 84 },
12551274
{ name: 'i18n-ns-marketplace-ru', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]ru\.ts$/, priority: 84 },
12561275
{ name: 'i18n-ns-marketplace-ar', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]ar\.ts$/, priority: 84 },
1276+
{ name: 'marketplace-namespace-gate', test: /[\\/]packages[\\/]app-shell[\\/]src[\\/]console[\\/]marketplace[\\/]MarketplaceNamespaceGate\.tsx$/, priority: 84, includeDependenciesRecursively: false },
12571277
//
12581278
// ⛔ `i18n-runtime` takes `includeDependenciesRecursively: false`
12591279
// for the reason `data-adapter` below does (objectui#9345, read out

‎ui/scripts/check-eager-closure-budget.mjs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,6 +2226,16 @@ export const PER_CHUNK_GZIP_CEILINGS = Object.freeze({
22262226
//
22272227
// ⚠️ RAISED ×1.20 by objectui#12653 (2026-10-16), the maintainer's 20%
22282228
// ruling, from 50,000 (the entry on MAX_EAGER_CLOSURE_GZIP_BYTES).
2229+
//
2230+
// READ, ⛔ not moved, by objectstack#30588 (2026-11-05): the pack's
2231+
// `marketplace.*` group (bar the keys Studio's packages page reads) left
2232+
// the ten packs for the lazy `marketplace` namespace
2233+
// (`packages/i18n/src/namespaces/marketplace/`). On two console builds
2234+
// (`CI=true vite build`, `apps/console/dist/eager-closure.json`) at
2235+
// `bdbaf80c` and at that card's head this chunk read 59,951 -> 57,010
2236+
// gzipped bytes, headroom 49 -> 2,990. The eager closure read 2,204,342 ->
2237+
// 2,201,440 (-2,902), with no chunk added and none but this one moving by
2238+
// more than 40 bytes.
22292239
'i18n-locale-en': 60_000,
22302240
// Raised by the maintainer ruling of 2026-09-08, ⛔ not by a measurement here:
22312241
// `main` had been red on this line since `f76f43628`. The bytes that put it

0 commit comments

Comments
 (0)