Skip to content

perf(console): the first load stops downloading the grid and detail packages - #36336

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-33581-console-eager-closure
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-33581-console-eager-closure

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #33581
Clause-②: yes (widening) — one new published exports subpath, @object-ui/plugin-detail/core; nothing removed or renamed, the package root exports the same names as before
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:控制台第一次打开任何页面时少下载约 165 KB(压缩后,约为首屏下载量的 8%);首页、仪表盘、列表页、记录页、记录浮层画面和操作都不变。
  • 为什么做:控制台首屏提速——过去每个页面都要先下载表格和详情组件,再去读数据。
  • 出错会怎样:若某处漏改,表格或详情块第一次出现时会多等一次加载,画面内容不变;本改动可以直接撤回。
  • 要你做什么:无。

What changes

On every route the console used to download the plugin-grid chunk (all of @object-ui/plugin-grid plus 77 @object-ui/plugin-detail modules, 183 KB gzip) before its first data read. That chunk now leaves the eager closure; the list and record routes fetch it with their own route chunks, and any other surface fetches it the first time it draws a grid or a detail block.

  • @object-ui/plugin-detail/core (new subpath, ESM only, like the other /core subpaths): the pure helpers the console shell needs on every page, registering nothing. Names: isRefusedFeedRead, relatedListEntryNames, RELATED_ARRANGEMENT_RECORD_VERSION, relatedArrangementFromRecord, relatedArrangementToRecord, deriveFieldGroupDetailSections, deriveHighlightFields, resolveDetailSections, isWideFieldType, prefetchRelatedCounts, relatedCountTargetsIn, COMPACT_RELATED_ROWS, normalizeRelatedListSort, seedQueueClaimDecision, seedRecordFieldAccess, seedRecordVerdict, type RelatedArrangement. The root still exports all of them. normalizeSortSpec moved verbatim from RelatedList.tsx to relatedListSort.ts so the subpath does not reach the component.
  • Published ESM build of plugin-detail: a second pass (vite.es.config.ts) emits index and core in one pass with preserveModules, so the record-page caches the /core seeds write are the same module instances the root's hooks read. File names match the package's existing sideEffects spellings (./dist/queueClaim.js and friends). The UMD build is unchanged.
  • Console shell (@object-ui/app-shell): eight modules take the helpers from /core. The record pointer card's key fields and the approval decision's child tables draw HeaderHighlight / RelatedList through lazy() wrappers (lazyDetailSurfaces.tsx); the pointer card starts the chunk load beside its record read (no timeout raised). A wrapper mounted after the chunk loaded draws without suspending.
  • Console (register-plugins.ts): the bare import '@object-ui/plugin-grid' / import '@object-ui/plugin-detail' become registerLazy stubs for every tag the two packages register, with the namespaces their registrations declare: object-grid, view:grid, detail-view, detail-section, view:detail, and the eleven record: blocks (details, related_list, highlights, activity, chatter, discussion, path, quick_actions, history, reference_rail, alert). App.tsx loads the dev-only row-actions page lazily. vite.config.ts gets a plugin-detail-core chunk group so the subpath's closure does not fall into the plugin-grid group.

The card's other two slices were already in place on main: plugin-form and plugin-view were lazy behind their /core subpaths (#34176), and RecordDetailView / ObjectView sat behind the lazy route boundary (#33677). Step 1 below shows it.

Step 1: main 29556850, what held each package eager

Eager closure 2,042,500 B gzip, 105 of 2551 chunks. Largest eager chunks: vendor-objectstack 673,811 · ui-components 351,125 · plugin-grid 183,395 · index 135,521 · framework 88,559 · vendor-react 81,619 · i18n-locale-en 66,610 · vendor-radix 59,724 · src 43,005 · infrastructure 37,749.

Package Eager on main? Edges holding it
plugin-grid (chunk = 74 grid + 77 detail modules) yes, 183,395 B register-plugins.ts bare imports of grid and detail; App.tsx to dev/DevRowActions.tsx (ObjectGrid); app-shell named imports from the plugin-detail root in sharedUserFeeds, deriveRelatedLists, workspacePreference, recordDetailSections, recordDrawerStack, recordPagePayload, SubmittedRecord (RelatedList), RecordPreviewCard (HeaderHighlight)
plugin-form no (only plugin-form-core, 6,652 B) none; lazy since #34176
plugin-view no (only plugin-view-core, 1,789 B) none; lazy since #34176
RecordDetailView no none; behind the lazy route boundary since #33677

Before / after

Build Eager gzip bytes Eager chunks grid / form / detail / RecordDetailView eager
main 337f435c 2,043,450 105 plugin-grid 183,666
this branch feb24f53 (same base) 1,874,495 (−168,955) 105 none; plugin-detail-core 15,702 joins
this branch head 58e12ffd (main 99fbaa6d merged) 1,875,181 105 none (plugin-detail-core 15,702, plugin-form-core 6,654, plugin-view-core 1,789)

The head row includes main's own drift between the two merges (for example ui-components +662 B). check:eager-closure on head: exit 0, 1831.2 KB, headroom 600.4 KB.

Lazy chunks, gzip (python gzip -6, main 337f435c vs head feb24f53): plugin-grid 183,368 / 188,399 · plugins-views 62,376 / 55,420 · plugin-form 47,198 / 47,212 · plugin-view 19,846 / 19,846 · RecordDetailView 29,554 / 30,003. The grid chunk grows by the detail renderers that left plugins-views.

Tests

Local, scoped (CI runs the full suites):

  • Before the last main merge, head feb24f53: 406 test files (app-shell tests of every touched module, all console __tests__, plugin-detail, the ui/scripts side-effects and declared-lazy-views tests): 405 passed, 1 failed (RecordPreviewCard.test.tsx, the highlight strip under the new lazy wrapper). Fixed in feb24f53; that file plus the pins rerun: 13 files / 149 tests passed.
  • type-check for @object-ui/plugin-detail, @object-ui/app-shell, @object-ui/console: exit 0 (on feb24f53 and again on 58e12ffd). eslint on the changed files: exit 0. vitest over scripts/: 5127 tests passed.
  • Head 58e12ffd (after merging main 99fbaa6d): full turbo build exit 0, eager-closure budget exit 0, type-checks exit 0. The scoped test rerun on this head (493 files) was still running when this body was written (handover cut-off): NOT MEASURED on 58e12ffd, CI is the reading.

Pins: ui/packages/app-shell/src/__tests__/pluginCoreSubpaths-33581.test.ts now also holds plugin-detail/core (names, no registrations) and the eager modules (App, register-plugins, the eight shell modules, lazyDetailSurfaces) to subpath-or-type-only imports of plugin-detail and plugin-grid.

Ablations (one-shot, on committed head feb24f53, each restored with git checkout HEAD --, blob hash compared, git diff HEAD empty):

  1. recordPagePayload.ts back to the plugin-detail root import: all three pin tests red (offender listed, importer floor 8 of 9).
  2. bare import "@object-ui/plugin-grid" added to register-plugins.ts: the bare-import pin red ("bare import from '@object-ui/plugin-grid'"). The first attempt at this ablation was a no-op (the replacement contained the anchor; the replace tool refused it); redone with a different quote spelling.

Acceptance notes

  • Real browser (Chromium, showcase app, signed in as admin; the same server served the 337f435c console build and then this branch's), five routes: home, a dashboard, an object list, a record page, a record overlay. All five drew on both builds with the same text, no page errors beyond a 404 the home page shows on both, no failed requests.
    • main fetched plugin-grid 40–75 ms after navigation on every route, before the first data read (667–1144 ms).
    • this branch: home and dashboard never fetch plugin-grid; the list fetches it at 1032 ms beside ObjectView (1050); the record page at 882 ms beside RecordDetailView (900); the overlay at 1027 ms.
    • JS requests per route (main / head): home 105 / 105, dashboard 143 / 140, list 227 / 201, record 171 / 156, overlay 229 / 203.
  • No carve-out naming plugin-grid is added to the eager-closure budget check, and none is owed. New gates are "no" by default unless the maintainer names one, and this class is already held by two things: the source pin pluginCoreSubpaths-33581 (ablation 2 turns it red) and the total check:eager-closure budget.
  • plugin-detail-core (15,702 B gzip at this head) also holds ConcurrentUpdateDialog, because isConcurrentUpdateError is in the same module. That share of the chunk is not measured on its own.

Verification

Read first:

  1. ui/apps/console/src/register-plugins.ts — a tag the two packages register but the stubs miss would draw an unresolved component on first use.
  2. ui/packages/plugin-detail/vite.es.config.ts + package.json — the published ESM layout changes to one file per module; the seed caches depend on it.
  3. ui/packages/app-shell/src/views/lazyDetailSurfaces.tsx — first-draw loading of the two shell detail components.

Two-minute check: pnpm --filter @object-ui/console build, then node -e 'const j=require("./ui/apps/console/dist/eager-closure.json");console.log(j.eagerGzipBytes, j.files.filter(f=>/^(plugin-|RecordDetailView|plugins-)/.test(f.name)).map(f=>f.name))' from the repo root. Expected: about 1,875,000, and only plugin-chatbot-core, plugin-detail-core, plugin-form-core, plugin-view-core, with no plugin-grid.

Gates: node scripts/pm/dispatch-gates.mjs --commands derived 60 families on f3214b28; all 60 ran locally and --ran reconciled 60 of 60, 0 NOT MEASURED, exit 0. First runs of four families read wrong and were rerun after a full build: dts-closure exit 1 (console .d.ts not built yet), dual-build-cjs-loads exit 3 (prerequisite unbuilt), query-options-erasure 124 (my own 300 s timeout), type-check-debt (I stopped its lock-held rebuild); all four reran to exit 0. UI extras: check:side-effects-array 0, check:sdui-registration-pins 0, check:eager-closure 0, vite-declared-lazy-views passed inside the builds (13 of 13 lazy). The gate set was not rerun on 58e12ffd (a clean main merge); the PR check-runs are the reading there.

Written by repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D (https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D).

🤖 Generated with Claude Code

@github-actions github-actions Bot added size/m dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Final head: 58e12ffd08ca58760f623cf9043e1fc9c3c4bcbf (24 files, +369/−55, Fixes #33581).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-22T06:50Z

席位核对 — REWORK (PR body only) · head 58e12ff

No code change is asked for. The code, measurements and pins hold, as listed below. Two Acceptance-notes lines read as residuals with no carrier.

To fix (body edit; the head stays 58e12ff)

  1. "No guard beyond the source pin keeps plugin-grid out of the eager closure; a check-eager-closure-budget carve-out … would close that class. Not done here." This is a stated gap with no #N. Either file a card and cite it, or state why none is owed.
    • New gates are "no" by default unless the maintainer names one (the SKILL.md four-axis frame).
    • The class is already watched by pluginCoreSubpaths-33581 (the source pin, ablation 2) and by the total check:eager-closure budget.
  2. "plugin-detail-core carries ConcurrentUpdateDialog … splitting it is a follow-up candidate, not measured separately." The same applies: cite a #N, or reword it as a measured statement of what the chunk holds, with no "follow-up candidate". Either is fine.

A body edit re-runs the PR-body guards. Tell me when they are green, and I will read the body alone.

Checked and holding

  • Shape: l1-face.mjs --pr 36336 is clean at 58e12ff, with 48 success, 11 expected skip, 0 failed and mergeable_state clean.
  • Contract review: under the declaration leg, an at-tier L2 PASS is owed before the queue. The tier is TIER_DEFAULT: no spec path and no governed path, as for fix(dashboard): a global filter on a multi-value field is sent as $contains, not = / $in #36181. The card's own acceptance says "contract record owed".
  • Lazy stubs: register-plugins.ts now stubs every tag the two entries register, with the same namespace, skipFallback and category as each ComponentRegistry.register at this head.
    • plugin-grid: object-grid and view:grid.
    • plugin-detail: detail-view, detail-section, view:detail, and the eleven record: tags from details to alert.
    • There is no tag the entries register without a stub, so a schema naming one still loads the package, and the package's own registration replaces the stub.
  • /core: it re-exports 16 pure helpers plus a type, and the root keeps the same names.
    • The ⛔ note forbids a registering module in its closure, and pluginCoreSubpaths-33581 pins the shell's imports to the subpath.
    • Module-state seeds (seedRecordVerdict and its siblings) stay one instance: the console aliases both entries to the one source module, and the published ESM pass (vite.es.config.ts, preserveModules, two entries in one pass) emits the shared modules once.
    • exports["./core"] mirrors plugin-chatbot's ./core shape. The UMD build is unchanged.
  • Measurements and the browser:
    • The eager closure goes from 2,042,500 to 1,875,181 B gzip at this head. plugin-grid (183,666) leaves and plugin-detail-core (15,702) joins. check:eager-closure exits 0.
    • In Chromium, five routes draw the same on both builds. Home and dashboard never fetch plugin-grid, while the list and record routes fetch it beside their own chunks.
  • Ablations: recordPagePayload returned to the root import turns 3 pins red, and a bare plugin-grid import turns the bare-import pin red. Restores were proven against HEAD.
  • File surface: ui/apps/console/vite.config.ts (the alias and the plugin-detail-core chunk group) and the two ui/scripts side-effects tests only deliver the change, so no amendment is owed.
  • Gates: the scoped test rerun on 58e12ff was NOT MEASURED. It is carried by green CI (Test UI) at this head after a clean main merge, which I accept.
  • Landing: this is not governed. After the L2 PASS, the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-22T06:53Z

席位核对 — ACCEPT (body) · head 58e12ff

I read the body alone, after REWORK 7075566667. The head is unchanged, so everything checked in that record stands.

  • Item 1: the eager-closure line now states that no carve-out is owed, with the reason: new gates are "no" by default, and the class is held by the source pin pluginCoreSubpaths-33581 (ablation 2) and the total check:eager-closure budget. That is true at this head.
  • Item 2: the ConcurrentUpdateDialog line is now a measured statement (plugin-detail-core is 15,702 B gzip, and the dialog rides with isConcurrentUpdateError), with no follow-up implied.
  • No residual is left without a carrier. The PR-body guards re-ran green after the edit.
  • Landing: the at-tier (TIER_DEFAULT) L2 PASS for Clause-②: yes (widening) is still owed before the queue. After it, the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 58e12ffd08ca58760f623cf9043e1fc9c3c4bcbf
Local-runs: none

Face: the Clause-②: yes (widening) declaration (no published schema, no governed path in the 24-file list). Inputs: card #33581 body and all 15 comments, the PR body and file list, the net diff 99fbaa6d..58e12ffd, and the head's check-runs. The PR author is objectstack-fleet[bot], so no extra author note is owed.

① Derived judgments

  • New accept-set entry exports["./core"] in @object-ui/plugin-detail (types → ./dist/core.d.ts, import → ./dist/core.js, no require): right. It is a pure widening with the same shape as the /core subpaths of plugin-form and plugin-view. The changeset declares it as ESM only. A CJS require of it fails with ERR_PACKAGE_PATH_NOT_EXPORTED, as it does on the precedents.
  • The root entry exports the same names: right. src/index.tsx is byte-unchanged between base and head. Each of the 17 names src/core.ts exports is still exported from the root, from the same source module, so the seed caches stay one module in both entries. normalizeSortSpec moved verbatim to relatedListSort.ts. Its parameter type RelatedListSortSpec | undefined is structurally identical to the old RelatedListProps['defaultSort'], so the root normalizeRelatedListSort signature does not change.
  • main, module, types and the . export mapping are unchanged: right. The UMD pass keeps the same entry, the same externals and inlineDynamicImports.
  • Published ESM layout: right. vite.es.config.ts emits index and core from one pass with preserveModules, so dist/index.js and dist/core.js import the same dist/queueClaim.js, dist/recordFieldAccess.js and dist/useRecordEditable.js files. That is the one-instance answer to option A of the build-shape open question in the perf(console): plugin-form and plugin-view helpers come from side-effect-free /core subpaths #34176 report. The extra per-module files under dist/ cannot be reached through exports, so they are shipped bytes, not accept set. emptyOutDir: false keeps the first pass's .d.ts files and UMD output. Bare ids are external before alias resolution, as in the main config. There are no CSS imports and no @/ imports in src.
  • The sideEffects array is complete under preserveModules: right. I scanned every non-test module in src for top-level statements. Load-time effects exist only in index.tsx (the 16 ComponentRegistry.register calls) and in the three subscribeDataChanges subscriptions in queueClaim.ts, recordFieldAccess.tsx and useRecordEditable.ts. All four are listed in both their src and dist spellings. core is added in both spellings, as on the precedents.
  • What /core reaches: right. Its static closure is 14 modules: core, autoLayout, relatedListCompact, relatedListSort, queueClaim, ConcurrentUpdateDialog, useDetailTranslation, recordFieldAccess, useRecordEditable, useRelatedCounts, renderers/recordActivityFeed, and synth/relatedListEntry, relatedArrangement and buildDefaultPageSchema. None of them is ./index, a renderer, or a module that registers anything. The console's plugin-detail-core chunk-group regex names exactly these 14.
  • Console registerLazy stubs: right. There are 16, and each one matches the tag, namespace, skipFallback and category of the registration it stands in for: object-grid and grid (view, skipFallback) from plugin-grid, then detail-view, detail-section, detail (view) and the eleven record: tags (skipFallback) from plugin-detail. Before the first load the stubs carry no label or inputs. perf(console): the first load stops downloading the object list, the record view and the list view package #33677 already accepted that for its lazy stubs.
  • App-shell repoints and lazyDetailSurfaces.tsx: right. Nine modules now take only /core names. HeaderHighlight and RelatedList are drawn through lazy() with a type-only import of the entry. RecordPreviewCard preloads the chunk beside its record read, and no timeout is raised. The pin pluginCoreSubpaths-33581.test.ts covers the new eager modules.

② Semver level

Clause-②: yes (widening) appears at the start of a line in both the PR body and the changeset, and it matches the diff: one subpath added, nothing removed or renamed. Metadata-protocol: none is right, because no spec or authorable key changes. That makes the level patch under AGENTS.md Post-Task Checklist step 3, since a non-protocol widening ships as patch. The changeset names @object-ui/plugin-detail, @object-ui/app-shell and @object-ui/console, which are the packages the diff changes. plugin-grid is untouched and correctly not listed.

Check-runs on the head: 63 in total, 50 success and 13 skipped, none red. Check Changeset reran and concluded success. Test UI 1/16 to 16/16, Type Check UI, Build & E2E UI, Live E2E UI, Lint UI and Lint & Repo Gates are all success. They answer the dev's unmeasured scoped rerun on this head. UI Published Artifacts is skipped because it runs only in the full battery, by ruling: check:node-esm-load grades the new ./core entry and the preserveModules root layout first on main's push run, and scripts/release-publish.sh blocks on it. The landing seat reads that push run.

③ Boundary flags

Findings:

  • N1 (nit): the docblock in src/core.ts, the pin docblock and the comments in register-plugins.ts call /core "side-effect-free". Its closure runs three subscribeDataChanges cache-invalidation listeners when it loads. They were already eager on main, and sideEffects declares them correctly. "Registers nothing", the changeset's wording, is the accurate claim.
  • N2 (nit; follow-up card): the plugin-detail-core chunk regex in console vite.config.ts is a hand-kept copy of the /core closure. It matches at this head. If a module joins the closure without joining the regex, about 183 KB of plugin-grid returns to every first load, and the eager-closure budget (600 KB headroom) would not catch it. The seat should file the carve-out the dev proposes.
  • N3 (nit): in lazyDetailSurfaces.tsx, "A failed load is forgotten, so the next draw asks again" is true of preloadDetailEntry. It is not true of the two React.lazy components, which keep a rejection for the life of the module. A surface recovers on a later mount only if a later preload succeeds, and SubmittedChildTables never preloads. Every console lazy() behaves this way, so the fix is to the wording.

No must-fix, no should-fix.

Implemented-by: claude/issue-33581-console-eager-closure
Reviewed-by: session_01FEkQ5kt9AD1TPLy7Y9oa9D

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D

Landing · head 58e12ffd08ca58760f623cf9043e1fc9c3c4bcbf · ACCEPT → PR #36336 comment 7075589548 (L1-b, body read after REWORK 7075566667; code and measurements held in that record) · Contract review PASS (TIER_DEFAULT, Clause-②: yes (widening) face) → PR #36336 comment 7075609766

Probe Reading
check-governed-merges.mjs --pr 36336 NOT governed; 424 changed lines (+369 / −55), under 3000
check-runs on the head 63: 50 success, 13 skipped, 0 failed, 0 pending; mergeable_state clean

Accepted deviations (nits of the contract record, no fix: each fix would move the head):

  • N1. "side-effect-free" in the /core docblocks reads more strongly than "registers nothing". The three cache-invalidation listeners were already eager on main, and sideEffects declares them.
  • N2. The plugin-detail-core chunk regex is hand-kept. No card is filed: a new gate is "no" by default unless the maintainer names one, and the class is held by the source pin pluginCoreSubpaths-33581 and the total eager-closure budget (as the PR body states).
  • N3. A wording point about React.lazy keeping a rejection, which every console lazy() shares.

The record notes that UI Published Artifacts (check:node-esm-load) grades the new ./core entry on main's push run. The area reads that run after merge.

State: ready + auto-merge. On MERGED, Fixes #33581 closes the card, and the area clears pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 06:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 2b57044 Nov 22, 2026
64 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-33581-console-eager-closure branch November 22, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console first load: plugin-grid, plugin-form and RecordDetailView are still in the eager closure (split from #33293)

2 participants