Skip to content

perf(console): the first load stops downloading the Studio designer strings and the metadata form strings - #33682

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-34376i
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-34376i

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #33582

Clause-②: no
Metadata-protocol: none

Seat domain:ui#2 · os-project-manager · card thread session_01FEkQ5ousB2MKFUbJFc3Hwp · claim 6889348795 and its two amendments

维护者速读

What changes

Measured first on origin/main 3c0033f9 with the instrument #33580 used (the console's own vite.config.ts run through Vite's build() plus one read-only plugin that dumps getModuleInfo() and every chunk's module list; that build writes the same eager-closure.json as a plain build): 107 eager chunks, 2,165,707 B gzip. i18n-ns-studio-en (64,296 B) and metadata-form-i18n (11,363 B) are eager.

The edges, read from that graph (eager importers only):

module eager importer(s) on main cut here
packages/i18n/src/namespaces/studio/index.ts metadata-admin/i18n.ts; the module itself sits in the eager i18n-runtime group, with its static en edge new i18n-ns-studio chunk group
metadata-admin/i18n.ts studio-design/studio-canvas-preview.tsx, metadata-admin/datasource/DatasourceResourcePage.tsx, metadata-admin/PositionGrantCells.tsx, metadata-admin/previews/useDatasetCatalog.ts all four, below
metadata-admin/metadata-form-i18n.ts preview/changeKeyLabels.ts only, through preview/DraftChangesPanel.tsx, mounted closed by preview/DraftPreviewBar.tsx (in ConsoleLayout) DraftChangesPanel lazy

The cuts, each the #33580 shape:

  • services/lazyPage.tsx (new). perf(console): the first load stops downloading the Setup pages, the package form and the view config panel #33580's lazyPage moves here from builtinComponents.tsx unchanged, so the three registration sites below share the one wrapper. It gains an optional third argument, fallback, so a list cell draws nothing while its module loads instead of the page-sized loading line. builtinComponents.tsx imports it (and its fallback, still used by the two metadata-admin registrations).
  • studio-design/studio-canvas-preview.tsx is imported by the package entry for its load-time registerStudioCanvasPreview('object', …) (it is in app-shell's sideEffects). The default grid and everything only it reads (the @object-ui/react renderer hooks, useAuth, the designer strings) move verbatim to studio-design/studio-object-records-canvas.tsx. The registry module keeps the registry, the contexts, navEntryListTarget and listViewsOf, and exports StudioObjectRecordsCanvas as lazyPage('studio canvas', () => import('./studio-object-records-canvas.js')). The name is unchanged and is the value registered, so StudioDesignSurface's StudioCanvas === StudioObjectRecordsCanvas check and the package entry's re-export need no edit.
  • metadata-admin/datasource/register.ts registers DatasourceResourcePage through lazyPage, typed with the registry's ListPage props { type: string }.
  • services/builtinComponents.tsx: the position list's PositionHolderCountCell and PositionGrantedSetsCell are lazyPage(…, null); the column render functions are unchanged.
  • views/ObjectView.tsx: CreateViewDialog is lazy() with its mount inside Suspense fallback={null}, exactly as ViewConfigPanel. Nothing else in the file changes.
  • preview/DraftPreviewBar.tsx (seat amendment 2): DraftChangesPanel is lazy() with its mount inside Suspense fallback={null}. The bar draws only in preview mode, so the sheet's chunk is requested only there.
  • ui/apps/console/vite.config.ts: an i18n-ns-studio group for namespaces/studio/index.ts with includeDependenciesRecursively: false, beside the existing i18n-ns-studio-en / -zh groups and for the reason the marketplace loader's group gives. en stays a static import of the namespace module, so it stays the synchronous fallback (app-shell: a published library that is 66% Console product surface — retire the 67 zero-reference exports now, decide the split, and fold the second i18n table into @object-ui/i18n #25922); the module and its en catalogue leave the eager closure together.

Result, final head 58e603fe, two builds of the same tree: 103 eager chunks, 2,058,464 B gzip both times (the console:build dist served in the live check read the same), −107,243 B (−5.0%) against main.

chunk before, B gz after
i18n-ns-studio-en 64,296 left the eager closure
metadata-form-i18n 11,363 left the eager closure
i18n 8,085 left
json-schema-to-fields 1,882 left
object-fields-io 1,578 left
useDatasetCatalog 1,059 left
objectViewTitleSwitcher 16,823 8,131
src 38,144 31,115
newViewSpec 4,236 309

Three small eager chunks appear: usePendingDrafts (1,490), drillUrlFilters (1,454) and studio-canvas-preview (919). They are modules that were already eager inside chunks that shrank, regrouped by rolldown; not new first-load bytes.

pnpm check:eager-closure on that build: exit 0, aggregate 2010.2 KB / 2431.6 KB ceiling, headroom 421.4 KB = 0.61x the 695.0 KB regression. evaluateHeadroomSensitivity's predicate (headroom ≥ 1x) does not fire, so the gate asks for no re-pin; BASELINE is untouched.

Changeset .changeset/33582-console-eager-closure-studio-strings.md: @object-ui/console patch (app-shell is private; the console's dist ships it). Clause-②: no: nothing a package exports changes shape; app-shell is private, its entry still exports registerStudioCanvasPreview with the same signature, and no @object-ui/i18n key is added or removed.

Tests

  • New pin in studio-canvas-preview.test.tsx, "the registered object default loads the grid on first draw (objectstack#33582)": the registered default is the wrapper, not the grid module's own component, and drawn through getStudioCanvasPreview('object'), as StudioDesignSurface draws it, it loads and draws the grid with the schema the module's component renders. The file's existing grid-behaviour tests (objectui#11774, objectui#11823) now render the module's own component, imported at module scope (ui/AGENTS.md, lazy-boundary rule).
  • Ablation (scripts/ablation-replace.mjs on studio-canvas-preview.tsx, the wrapper's loader .then((m) => m.StudioObjectRecordsCanvas) replaced by one that resolves a component drawing nothing): "drawn through the registry, it loads and draws the grid" red (1 failed, 1 passed, 15 skipped); restore: blob equal to HEAD 88577d58c086, git diff HEAD empty.
  • Census row moved: console/__tests__/openPathObjectReaders-12811.test.ts classifies every source file that reads useMetadata().objects; the reader moved with the grid, so its row names studio-object-records-canvas.tsx (same kind: 'off', same reason).
  • Affected suites, from ui/ under the lock: every views/studio-design/*.test.ts(x), every test importing ObjectView, every preview/*.test.tsx and CreateViewDialog*.test.tsx, and every test naming the changed modules (builtinComponents, PositionGrantCells, the datasource registration, register-builtins): 500 files, 3,982 tests. First run 498 files passed; the two red files were the canvas tests above (rendering the lazy name synchronously) and the census row. After the fix both files pass (20 / 20). The other 498 were not re-run after the test-only commit and the one-line type annotation.
  • pnpm --filter @object-ui/app-shell run type-check (both tsc passes): exit 0 on the final head. The first console build:dist caught TS2322 on the datasource registration (an optional type prop inferred); fixed by typing the wrapper with those props.
  • eslint on the seven changed sources: 0 errors; warnings 70 on main to 60 here (the one new one is react-refresh/only-export-components on lazyPage.tsx exporting a function beside a component).
  • The ineffective-dynamic-import ledger ("41 ineffective dynamic imports, all pinned") and declared-lazy-views ("11/12 … 1 eager, all pinned") print the same lines as on main, so none of the new import()s is defeated by a static edge.

Acceptance notes

  • Card correction. The card names four edges into metadata-admin/i18n.ts and says metadata-form-i18n rides the same edges. Measured on main, the four edges are exactly as named, but metadata-form-i18n is not held by them: its only eager importer is preview/changeKeyLabels.ts, reached through preview/DraftChangesPanel.tsx, which preview/DraftPreviewBar.tsx mounts closed. That edge also carried the object-fields-io straggler. The seat added DraftPreviewBar.tsx (the DraftChangesPanel import and mount only) to the claim before it was edited.
  • Where the strings now load. Studio and Setup screens load them as before. A list route also requests them as the list mounts, because CreateViewDialog is mounted closed with the list and its chunk carries the dataset catalogue, as ViewConfigPanel does since perf(console): the first load stops downloading the Setup pages, the package form and the view config panel #33580. They stay off the dashboard and every non-list route (live check below).
  • ObjectView itself is still eager (AppContent's always-eager block): that is console first load: plugin-grid, plugin-form and RecordDetailView are still in the eager closure (split from #33293) #33581's, not touched here. AppContent and apps/console/src/register-plugins.ts are not edited.
  • No out-of-scope finding to file.

Verification

Live, the built console (turbo run build:dist --filter=@objectstack/console at 58e603fe) served by the showcase app (objectstack dev --ui --seed-admin --no-watch), a fresh browser context per route (cold cache, so every chunk the route needs is a request), Chromium via Playwright. Probe, screenshots and routes.json: /mnt/project-files/pm-orders/ui/33582-probe/ in the project files.

route draws moved chunks requested
dashboard showcase_ops_dashboard yes, no page errors none of i18n-ns-studio-en, i18n-ns-studio, metadata-form-i18n, the canvas, the datasource page, the position cells, CreateViewDialog, DraftChangesPanel
task list, then view switcher → "Add new view" the Create View dialog opens, English text ("Pick a view type, then give it a name…") CreateViewDialog, i18n-ns-studio(-en), metadata-form-i18n on list mount
Studio → Interfaces → Tasks (object leaf) the runtime records grid in the canvas, English Studio chrome the canvas module on clicking the leaf
Setup → Datasources the datasources list (Default, External Analytics) the datasource page, i18n-ns-studio(-en)
position list (metadata/position) Holders and Permission sets columns filled per row the position cells

No route showed a raw engine.* string key or a console error.

Gates (local, head 58e603f)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 44 families. All run; 43 exit 0; pnpm check:dual-build-cjs-loads exit 3 (PREREQUISITE NOT MET: no packages/qa/scenarios/dist), NOT MEASURED, left to CI. --ran reconciliation: "44 derived famil(ies) accounted for — 43 run, 1 NOT-MEASURED". Per-family record: /mnt/project-files/pm-orders/ui/33582-gates-ran.txt. Outside the derived list: pnpm --dir ui check:eager-closure exit 0 (above).


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5ousB2MKFUbJFc3Hwp

…the screens that read them

The default Studio canvas moves to its own module and registers through
lazyPage, which moves to services/lazyPage.tsx so every such registration
shares one wrapper. The datasource page, the position list's two cells,
the create-view dialog and the Pending changes sheet load on first draw.
The studio namespace loader gets its own chunk group, so the eager
i18n-runtime chunk stops carrying its static en edge.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5ousB2MKFUbJFc3Hwp
@github-actions github-actions Bot added size/l 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 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

席位核对

Verdict: ACCEPT · head 7b25d554 · 2026-11-15T06:44Z

  1. Shape. Draft → main, Fixes #33582. 11 files, +463/−269:

    • services/lazyPage.tsx (new): perf(console): the first load stops downloading the Setup pages, the package form and the view config panel #33580's lazyPage moved out of builtinComponents.tsx unchanged, plus an optional fallback
    • studio-design/studio-canvas-preview.tsx → studio-object-records-canvas.tsx: the default object grid moved verbatim and is registered lazily under the same name
    • lazy registrations or mounts for datasource/register.ts, the two position list cells, ObjectView.tsx's CreateViewDialog and DraftPreviewBar.tsx's DraftChangesPanel
    • an i18n-ns-studio chunk group in apps/console/vite.config.ts
    • pins in studio-canvas-preview.test.tsx
    • one root changeset

    All of it is on the claimed surface, as amended twice. The one file outside it by name is openPathObjectReaders-12811.test.ts, a census of useMetadata().objects readers by path, whose one row now names the moved canvas module. That is accepted as the same move.

  2. Premise. Measured from eager-closure.json and the chunks' module lists: i18n-ns-studio-en (64,296 B) and metadata-form-i18n (11,363 B) were in the eager closure.

    • The result: the eager closure drops from 2,165,707 to 2,058,464 B gzipped (−107,243) and from 107 to 103 chunks, on two builds of the same tree.
    • check:eager-closure reads 0.61×, so no re-pin is owed.
    • Live check, cold context per route: the dashboard requests none of the moved chunks. The Studio object canvas, Setup → Datasources, the position list cells and list Create View all draw, with English strings.
    • The registry pin went red under ablation and was restored.
  3. Card correction. metadata-form-i18n was held by the DraftChangesPanel edge, not by the card's four. That is seat amendment 2, and it is in the PR's Acceptance notes.

  4. Declarations. Clause-②: no, Metadata-protocol: none, patch. Right: every touched package file is in the private @object-ui/app-shell or in the console app. No contract record is owed.

  5. Gates on head 7b25d554 (after the base sync below): All 58 check runs are success (47) or skipped (11).

    • The dev's local run: 44 derived, 43 exited 0. check:dual-build-cjs-loads exited 3 on a missing prerequisite (NOT MEASURED), and CI measured it.
  6. Same-surface note. ui seat 1's console first load: plugin-grid, plugin-form and RecordDetailView are still in the eager closure (split from #33293) #33581 is fenced off these files, and ObjectView.tsx changes only the CreateViewDialog import and its mount.

  7. K. 23 first-parent commits since the base, which is 15 or more, so the base was synced through the relay (58e603fe → 7b25d554) and CI ran green on the synced head. Path face: not governed; 732 changed lines.

  8. Authority. Landing under the maintainer's standing authorisation 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 06:45
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 6603978 Nov 15, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-34376i branch November 15, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l 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: the Studio en strings and metadata-form i18n are still in the eager closure (split from #33293)

1 participant