Repository navigation
perf(console): the first load stops downloading the grid and detail packages - #36336
Conversation
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-Authored-By: Claude <noreply@anthropic.com>
…e ESM pass (wip) Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-Authored-By: Claude <noreply@anthropic.com>
…s (wip) Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-Authored-By: Claude <noreply@anthropic.com>
…nsole-eager-closure # Conflicts: # ui/packages/app-shell/src/views/RecordDetailView.tsx
… without suspending Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-Authored-By: Claude <noreply@anthropic.com>
…nsole-eager-closure
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Final head:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — REWORK (PR body only) · head 58e12ffNo 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)
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
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — ACCEPT (body) · head 58e12ffI read the body alone, after REWORK 7075566667. The head is unchanged, so everything checked in that record stands.
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Contract reviewServed-tier: Face: the ① Derived judgments
② Semver level
Check-runs on the head: 63 in total, 50 success and 13 skipped, none red. ③ Boundary flags
Findings:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Landing · head
Accepted deviations (nits of the contract record, no fix: each fix would move the head):
The record notes that State: ready + auto-merge. On MERGED, |
Requested by Leehom · project thread
Fixes #33581
Clause-②: yes (widening) — one new published
exportssubpath,@object-ui/plugin-detail/core; nothing removed or renamed, the package root exports the same names as beforeMetadata-protocol: none
维护者速读
What changes
On every route the console used to download the
plugin-gridchunk (all of@object-ui/plugin-gridplus 77@object-ui/plugin-detailmodules, 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/coresubpaths): 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, typeRelatedArrangement. The root still exports all of them.normalizeSortSpecmoved verbatim fromRelatedList.tsxtorelatedListSort.tsso the subpath does not reach the component.vite.es.config.ts) emitsindexandcorein one pass withpreserveModules, so the record-page caches the/coreseeds write are the same module instances the root's hooks read. File names match the package's existingsideEffectsspellings (./dist/queueClaim.jsand friends). The UMD build is unchanged.@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 drawHeaderHighlight/RelatedListthroughlazy()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.register-plugins.ts): the bareimport '@object-ui/plugin-grid'/import '@object-ui/plugin-detail'becomeregisterLazystubs 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 elevenrecord:blocks (details,related_list,highlights,activity,chatter,discussion,path,quick_actions,history,reference_rail,alert).App.tsxloads the dev-only row-actions page lazily.vite.config.tsgets aplugin-detail-corechunk group so the subpath's closure does not fall into theplugin-gridgroup.The card's other two slices were already in place on main:
plugin-formandplugin-viewwere lazy behind their/coresubpaths (#34176), andRecordDetailView/ObjectViewsat behind the lazy route boundary (#33677). Step 1 below shows it.Step 1: main
29556850, what held each package eagerEager closure 2,042,500 B gzip, 105 of 2551 chunks. Largest eager chunks:
vendor-objectstack673,811 ·ui-components351,125 ·plugin-grid183,395 ·index135,521 ·framework88,559 ·vendor-react81,619 ·i18n-locale-en66,610 ·vendor-radix59,724 ·src43,005 ·infrastructure37,749.register-plugins.tsbare imports of grid and detail;App.tsxtodev/DevRowActions.tsx(ObjectGrid); app-shell named imports from the plugin-detail root insharedUserFeeds,deriveRelatedLists,workspacePreference,recordDetailSections,recordDrawerStack,recordPagePayload,SubmittedRecord(RelatedList),RecordPreviewCard(HeaderHighlight)plugin-form-core, 6,652 B)plugin-view-core, 1,789 B)Before / after
337f435cplugin-grid183,666feb24f53(same base)plugin-detail-core15,702 joins58e12ffd(main99fbaa6dmerged)plugin-detail-core15,702,plugin-form-core6,654,plugin-view-core1,789)The head row includes main's own drift between the two merges (for example
ui-components+662 B).check:eager-closureon head: exit 0, 1831.2 KB, headroom 600.4 KB.Lazy chunks, gzip (python gzip -6, main
337f435cvs headfeb24f53):plugin-grid183,368 / 188,399 ·plugins-views62,376 / 55,420 ·plugin-form47,198 / 47,212 ·plugin-view19,846 / 19,846 ·RecordDetailView29,554 / 30,003. The grid chunk grows by the detail renderers that leftplugins-views.Tests
Local, scoped (CI runs the full suites):
feb24f53: 406 test files (app-shell tests of every touched module, all console__tests__, plugin-detail, theui/scriptsside-effects and declared-lazy-views tests): 405 passed, 1 failed (RecordPreviewCard.test.tsx, the highlight strip under the new lazy wrapper). Fixed infeb24f53; that file plus the pins rerun: 13 files / 149 tests passed.type-checkfor@object-ui/plugin-detail,@object-ui/app-shell,@object-ui/console: exit 0 (onfeb24f53and again on58e12ffd). eslint on the changed files: exit 0.vitestoverscripts/: 5127 tests passed.58e12ffd(after merging main99fbaa6d): 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 on58e12ffd, CI is the reading.Pins:
ui/packages/app-shell/src/__tests__/pluginCoreSubpaths-33581.test.tsnow also holdsplugin-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 withgit checkout HEAD --, blob hash compared,git diff HEADempty):recordPagePayload.tsback to the plugin-detail root import: all three pin tests red (offender listed, importer floor 8 of 9).import "@object-ui/plugin-grid"added toregister-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
337f435cconsole 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.plugin-grid40–75 ms after navigation on every route, before the first data read (667–1144 ms).plugin-grid; the list fetches it at 1032 ms besideObjectView(1050); the record page at 882 ms besideRecordDetailView(900); the overlay at 1027 ms.plugin-gridis 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 pinpluginCoreSubpaths-33581(ablation 2 turns it red) and the totalcheck:eager-closurebudget.plugin-detail-core(15,702 B gzip at this head) also holdsConcurrentUpdateDialog, becauseisConcurrentUpdateErroris in the same module. That share of the chunk is not measured on its own.Verification
Read first:
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.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.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, thennode -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 onlyplugin-chatbot-core,plugin-detail-core,plugin-form-core,plugin-view-core, with noplugin-grid.Gates:
node scripts/pm/dispatch-gates.mjs --commandsderived 60 families onf3214b28; all 60 ran locally and--ranreconciled 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.tsnot 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-array0,check:sdui-registration-pins0,check:eager-closure0,vite-declared-lazy-viewspassed inside the builds (13 of 13 lazy). The gate set was not rerun on58e12ffd(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