Repository navigation
chore(ui): raise the eager ui-components ceiling by 8,000 bytes on maintainer ruling - #36100
Conversation
…intainer ruling Maintainer ruling 7063116595 (option B, 2026-11-21T13:12Z): raise PER_CHUNK_GZIP_CEILINGS['ui-components'] from 347,000 to 355,000 and move its PER_CHUNK_BASELINE row by the same +8,000 (265,937 -> 273,937), so the form line-item grid change can land. Rows from two console builds on one tree (main 78f7160 alone, and with that change's head fbbaaa9 merged) are in the comment on the key. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgWSAwkSz6F3eit2Y9u
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — ACCEPT (L1-b)Head-sha 9a2794b · read 2026-11-21T14:01Z · first L1 record on this PR, full read · base 维护者速读这个 PR 只改一个预算数字:控制台首屏加载的 Must-fixNone. Should-fixNone. Nits
Checked
Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T14:02Z · Budget-only PR on the maintainer's ruling 7063116595 (#36023, option B: raise the eager |
…maintainer ruling (objectstack-ai#36109) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuWrubarDyy1TAMVqK1ZWbAY)_ repo:objectstack#1 · os-sales · session_01L6bhgWSAwkSz6F3eit2Y9u Refs objectstack-ai#36023 Area: b1-L · budget-only, follow-up to objectstack-ai#36100. **Authorisation: maintainer ruling 7063869131 on objectstack-ai#36023** (amends point 2 of 7063116595). At 2026-11-21T14:01Z the maintainer widened the raise on objectstack-ai#36100's thread, verbatim: 「这个可以大幅放宽」 (this can be raised by a lot), then picked "raise 30%, to 451,100" on the decision card that followed. objectstack-ai#36100 was already in the merge queue at +8,000 and landed as it was so S5 objectstack-ai#36039 was not held up; this PR carries the rest. ## What changes One file, `ui/scripts/check-eager-closure-budget.mjs`, constants and their comments only: | constant | before (objectstack-ai#36100) | after | |---|---:|---:| | `PER_CHUNK_GZIP_CEILINGS['ui-components']` | 355,000 | 451,100 | | `PER_CHUNK_BASELINE['ui-components']` | 273,937 | 265,937 | - Ceiling: 347,000 (the value ruling 7063116595 started from) × 1.30 = 451,100 exactly, rounded nowhere. - Baseline: back to its measurement (`bbf6b02d9`'s 265,937). objectstack-ai#36100's +8,000 only kept the ceiling-minus-baseline gap; a ruled raise widens the gap instead, as the 2026-11-17 30% ruling on `i18n-locale-en` and the 20% ruling (objectui#12653) left their baseline rows alone. Both checked constraints hold: 451,100 > 265,937, and the gap 185,163 < `REGRESSION_THIS_GATE_MUST_CATCH_BYTES` (711,680). - A dated "⚠️ RAISED ×1.30 ... ON EXPLICIT MAINTAINER RULING" entry on the key, with the rows below and a "⭐ PAYBACK: objectstack#36102" line (L1-b's N1 on objectstack-ai#36100). objectstack-ai#36100's entry stays as the history it is. - Not moved: `MAX_EAGER_CLOSURE_GZIP_BYTES`, `BASELINE`, `REGRESSION_THIS_GATE_MUST_CATCH_BYTES`, the other three per-chunk rows. No code change, no exemption, no import made lazy. ## Why The maintainer wants this line to stop ejecting form and field PRs one at a time. With +8,000 the chunk keeps about 4.8 KB once S5 lands; with ×1.30 about 98.6 KB. ### The rows (one container, one instrument) `CI=true pnpm exec turbo run build --filter=@object-ui/console...`, reading `apps/console/dist/eager-closure.json`, twice on one tree: `main` at `1586ddec` (objectstack-ai#36100 landed) alone, then that `main` with objectstack-ai#36039's head `fbbaaa99` merged in (`034f0628`, local, not pushed). This file is not a console build input, so the branch builds the same bytes as `main`. Gzipped bytes: | chunk | `1586ddec` | `034f0628` | delta | |---|---:|---:|---:| | `vendor-objectstack` | 671,638 | 671,638 | 0 | | `i18n-locale-en` | 65,900 | 65,900 | 0 | | `framework` | 88,341 | 88,341 | 0 | | `ui-components` | 347,621 | 350,177 | +2,556 | | aggregate | 2,030,013 | 2,032,544 | +2,531 | Same 104 eager chunks by name in both builds; besides `ui-components` none moved by more than 21 bytes. Headroom of `ui-components`: | ceiling | on `1586ddec` | with S5 | |---|---:|---:| | 355,000 (now) | 7,379 | 4,823 | | 451,100 (this PR) | 103,479 | 100,923 (0.14x the 695 KiB regression) | ### What the bytes buy Shared headroom only, so form and field PRs are not ejected on this line one at a time. Not a budget for a new component group; a whole group still belongs behind a lazy boundary. Payback: objectstack-ai#36102 takes GridField out of the eager chunk; re-measure when it lands. ## Verification Clause-②: no Metadata-protocol: none - `pnpm --dir ui run check:eager-closure` on the `034f0628` build (S5 merged) with this branch's constants: exit 0; `ui-components` 342.0 KB / 440.5 KB, headroom 98.6 KB; aggregate, membership and sensitivity halves all ✅. - `pnpm --dir ui exec vitest run scripts/`: 172 files passed, 2 skipped (5,121 tests passed), including `check-eager-closure-budget.test.ts`. - `eslint ui/scripts/check-eager-closure-budget.mjs`: exit 0. - `node scripts/pm/check-governed-merges.mjs --branch HEAD`: NOT governed. - Same one-file list as objectstack-ai#36100, whose 16 `dispatch-gates.mjs --commands` all exited 0 on that head; of those, only the `vitest run scripts/` family reads this file's values, and it was re-run above. - `skip-changeset`: `ui/scripts/` belongs to the private root package `object-ui-monorepo`, so nothing publishes. Branch is the harness-assigned `claude/project-thread-usk9vf`, restarted from `main` after objectstack-ai#36100 merged. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. (no names added) - [x] 3. No formatter ran; `pnpm lint` passes. (`eslint` on the one file: exit 0) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing: `skip-changeset`) - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWSAwkSz6F3eit2Y9u Co-authored-by: Claude <noreply@anthropic.com>
…e console's eager chunk (objectstack-ai#36417) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbUq2j5tRRVo3TVY3wcS1Fdg)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Fixes objectstack-ai#36102 Clause-②: yes (widening) Metadata-protocol: none Ruling-ref: 7063116595 on objectstack-ai#36023 (option B, "a separate card follows to take GridField out of the eager chunk, after which the ceiling can come back down"); seat note 7064483594 on this card, on ruling 7063869131 (lower the ceiling and baseline by the bytes taken out, no more) ## 维护者速读 - 用户无感:控制台首次加载少下载约 6 KB(压缩后),明细表格改为第一次打开带明细的表单时才加载,新建与编辑发票时表格照常出现、输入不丢焦点。 - 这是上次为放行明细表格改动而临时抬高控制台首屏体积上限之后约定的后续工作,把那部分体积收回来。 - 出错时最坏:明细表格的代码要单独下载,如果连续两次下载失败,错误会交给表单的出错处理,整个带明细的表单(不只是明细表格)会换成出错提示;网络正常时只是第一次打开时明细区多停一会儿在「正在加载列」。整个改动可直接撤回。 - 要你做什么:无。 ## What changes The line-item grid's body (`GridField`, about 90 KB of source) sat in the console's eager `ui-components` chunk. The package entry imported it lazily but also exported it statically, so the lazy import did nothing. It now loads the first time a grid is drawn, in a lazy `fields-grid` chunk. No published export was removed or renamed. - **`ui/packages/fields/src/widgets/GridField.ts`** (new, the published face). It keeps the pure helpers (`evalArith`, `computeRow`, `lookupAutofillPatch`, `columnHelpByField`, `UNTOUCHED_NEW_ROW`, `isUntouchedNewRow` and the column types), which stay eager. It also exports `GridField` and `LineItemsField` as a small lazy face with the same props. - Each mount decides once: a grid mounted after the body has loaded renders it directly. A grid mounted before that renders it through `Suspense`, with a busy placeholder (`grid-field-loading`). - A load landing later therefore never remounts the body, and focus is kept. - New export: `preloadGridField()`. It starts the one shared load and never rejects; a failed load is reported by the grid that needs it, through the nearest error boundary. - **`widgets/grid-field/GridFieldWidget.tsx`** is the body, moved from `widgets/GridField.tsx` (git reads it as a rename, R081). Only `loadGridFieldWidget`'s `import()` reaches it. - **The record forms wait for it.** - `MasterDetailForm` starts the load when it mounts. It draws a collection's grid only once the body has settled; until then it shows its existing "Loading columns…" copy. That holds on every path: derived columns, columns authored in full, and authored-but-untyped columns drawn while the derivation is in flight. - The record page's line-item editor (`RecordBodyTableEditor`) waits for the body together with the child schema. - `LineItemsPanel` starts the load when it mounts. - **Console chunking:** - `vite.config.ts` gains a `fields-grid` group (priority 82, ahead of `ui-components`). - `check-eager-closure-budget.mjs` gains its `PER_CHUNK_MEMBERSHIP_CARVE_OUTS` row (`src/widgets/grid-field` → `fields-grid`), following the `fields-date-picker` precedent (objectui#12622). - `vite-ineffective-dynamic-imports.ts` drops GridField from its defeated-lazy list, because the import is now effective. - **Budget:** the `ui-components` ceiling and its baseline come down by the bytes removed (below). The objectstack-ai#36100 and objectstack-ai#36109 entries no longer call this card a payback. - **Tests:** about 30 fields test files import the body by its new path (`GridFieldWidget as GridField`); the helpers stay on `./GridField`. Three plugin-form test files await `preloadGridField()` at module scope. ### The bytes (in the budget file's "Raising it" style) One container, one instrument: `CI=true pnpm exec turbo run build --filter=@object-ui/console...`, reading `apps/console/dist/eager-closure.json`, run twice on one tree. The first build is `main` at `b3bcfefc` alone; the second is the same `main` plus this change, at `3c422050`. Gzipped bytes: | chunk | `b3bcfefc` | `3c422050` | delta | |---|---:|---:|---:| | `vendor-objectstack` | 674,662 | 674,662 | 0 | | `i18n-locale-en` | 66,785 | 66,785 | 0 | | `framework` | 88,559 | 88,559 | 0 | | `ui-components` | 352,359 | 346,403 | −5,956 | | ⇒ aggregate | 1,875,902 | 1,869,974 | −5,928 | - The same 105 eager chunks appear by name in both builds. Total chunks go from 2,577 to 2,578; the new one is `fields-grid`, which is lazy (20,374 raw bytes). - Apart from `ui-components`, no chunk moved by more than 31 bytes (`index` +31). - Raw minified `ui-components`: 1,309,110 → 1,289,869 (−19,241). - Re-read on this PR's final head (`eb102830`, same instrument): `ui-components` is still 346,403, and the aggregate is 1,869,971 (−3 bytes against `3c422050`, spread over `index`, `src`, `relativeTime` and `useConsoleActionRuntime`). - An intermediate read at `4ca78ed1` (before the face became a JSX-free `.ts`) gave 346,399 (−5,960). The ceiling follows the final tree's −5,956. | constant | before | after | delta | |---|---:|---:|---:| | `PER_CHUNK_GZIP_CEILINGS['ui-components']` | 451,100 | 445,144 | −5,956 | | `PER_CHUNK_BASELINE['ui-components']` | 265,937 | 259,981 | −5,956 | The gap between ceiling and baseline is unchanged (185,163). ⛔ Not moved: `MAX_EAGER_CLOSURE_GZIP_BYTES`, `BASELINE`, `REGRESSION_THIS_GATE_MUST_CATCH_BYTES` and the other per-chunk rows. No exemption was added. `pnpm check:eager-closure` on the final build: `✅ chunk ui-components 338.3 KB measured / 434.7 KB ceiling`, plus the membership line `its src/widgets/grid-field subtree 1 in fields-grid, exactly`. ## Tests <details><summary>The first-open pin (live e2e, ui/e2e/live/master-detail.spec.ts)</summary> The new describe is "the line-item grid on a form's first open (objectstack#36102)". The spec is in the required `test:e2e:live:ci` lane. - An init script installs a `MutationObserver` before the document's first byte. It counts every attach of the placeholder (`grid-field-loading`) and of the grid (`line-items`). The grid count is the observer's control. - **Create:** the invoices list → New → the dialog's grid is visible → add a line → type `first-open` into the Description cell. The cell must still be focused after 300 ms and hold the text. Assertions: grid attaches > 0, placeholder attaches = 0. - **Edit:** `INV-1002`'s edit route. Its stored lines are drawn (Description not empty), then the same typing and the same counts. Local live stack: the workspace backend (`ui/e2e/live/ci/start-backend.sh`) and `vite preview` of a root-base console build, as the CI job runs them. - **Red first.** At `e581a9a5`, before `MasterDetailForm` gated the grid, the create case failed: `the grid never mounted on its loading placeholder: Expected: 0, Received: 1`. A trace showed the placeholder attached inside `md-collection` about 0.4 s before the grid, because the collection drew authored-but-untyped columns while the derivation was in flight. - **Then green.** At `51af8021`: `--repeat-each 3 --retries 0` → `15 passed (1.1m)` (the whole spec, 5 tests × 3). </details> <details><summary>Unit: the lazy face, and its ablation</summary> `GridField.test.tsx`, new describe "GridField — the lazy face the package exports (objectstack#36102)", using `vi.resetModules()` and a fresh import: - A mount before the body loads shows the placeholder, then the grid. A focused Description cell is still connected and still `document.activeElement` after a re-render. - After `await preloadGridField()`, `LineItemsField` renders with no placeholder. - `LineItemsField` is `GridField`, the same face. **Ablation** (committed first, through `node scripts/ablation-replace.mjs`): `const [loadedAtMount] = React.useState(() => gridFieldWidgetModule);` was replaced by `const loadedAtMount = gridFieldWidgetModule;`, so the decision is re-read on every render. - Anchor 1 → 0, blob `2e286b33ebdf → 1f484acf48d9`. - Result: `× a mount before the body loads shows the placeholder, then the grid, and a later render keeps the focused cell`, with `Tests 1 failed | 91 passed (92)`. - Restored: blob == HEAD (`2e286b33ebdf`) and `git diff HEAD` empty. </details> <details><summary>Suites</summary> - `pnpm exec vitest run packages/plugin-form/` (from `ui/`): `Test Files 244 passed (244)`, `Tests 2750 passed | 1 skipped`. - `pnpm exec vitest run packages/fields/ scripts/__tests__/check-eager-closure-budget.test.ts scripts/__tests__/vite-ineffective-dynamic-imports.test.ts scripts/__tests__/vite-declared-lazy-views.test.ts`: `Test Files 323 passed | 1 skipped (324)`, `Tests 5064 passed | 7 skipped`. - `pnpm --filter @object-ui/plugin-form run type-check` and `pnpm --filter @object-ui/fields run type-check`: both exit 0, after a rebuilt fields `dist`. - `pnpm --dir ui exec vitest run scripts/`: exit 0 (part of the derived gate list). </details> ## Acceptance notes - **Clause-② is `yes (widening)`, not the claim's `no`.** The new published export `preloadGridField()` widens `@object-ui/fields`'s surface; every existing export keeps its name and shape. It is needed so a host can have the grid's body in its first render, as the record forms do. - **On a cold first open, a master-detail collection shows "Loading columns…" until the child schema and the grid's body are both in.** The body load starts on mount and overlaps the schema fetch. A form that mounts after the body has settled draws its grid at first paint. - Before this PR, a collection with authored, untyped columns drew those columns at once and drew them again when the derivation landed. - **`LineItemsPanel` (the record page's read panel) starts the load but does not gate on it.** It draws its grid after its own fetches. The pin covers the create and edit forms the card names. - **Overlap:** two same-seat drafts conflict with the move of `widgets/GridField.tsx` to `widgets/grid-field/GridFieldWidget.tsx`. - objectstack-ai#36351 conflicts in `GridField.lookupAutofill-28245.test.tsx` and the widget body. - objectstack-ai#36392 conflicts in `GridField.test.tsx` and the widget body. - Whichever lands second re-applies its body hunks to `grid-field/GridFieldWidget.tsx`. The landing order is the seat's call. `origin/main` merges cleanly. - **Outside the claim's file surface:** `packages/spec/liveness/field.json`, whose evidence pointer moved to the helper's new file (`check:liveness` exit 0). - **Out of scope, for the seat to file (L1-d 7078535343):** `React.lazy` caches a first load failure for the whole session, so a host that renders `GridField` without `preloadGridField()` and hits one failed chunk load never recovers until a reload. - **Possible further carve-out, not done here:** `widgets/gridCellPanels.tsx` is imported only by the body and could follow it into `fields-grid` (about 2.5 KB gzip by estimate, not measured). ## Verification Read first, by risk: 1. `ui/packages/fields/src/widgets/GridField.ts`: the face, specifically `GridField`'s `useState(() => gridFieldWidgetModule)` and `loadGridFieldWidget`'s retry-on-failure. 2. `ui/packages/plugin-form/src/MasterDetailForm.tsx`: `useGridBodySettled` and the `!d.columns?.length || !gridBodyReady` arm. 3. `ui/scripts/check-eager-closure-budget.mjs`: the LOWERED entry, the baseline note and the carve-out row. Two-minute check: `cd ui && pnpm exec vitest run packages/fields/src/widgets/GridField.test.tsx`. Expect `Tests 92 passed (92)`, including the three cases of the "lazy face" describe. --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ)_ <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgWSAwkSz6F3eit2Y9u
Refs #36023
Area: b1-L · budget-only, no card of its own. Authorisation: maintainer ruling 7063116595 on #36023 (option B on the seat's decision card, chosen 2026-11-21T13:12Z: raise the eager
ui-componentsbudget by about 8 KB, with headroom, in its own budget-only PR).What changes
One file,
ui/scripts/check-eager-closure-budget.mjs, constants and their comments only:PER_CHUNK_GZIP_CEILINGS['ui-components']PER_CHUNK_BASELINE['ui-components']The ceiling and its baseline move together by the same +8,000, which keeps the ceiling-minus-baseline gap (81,063) the way objectstack#28124 did for⚠️ RAISED ... ON EXPLICIT MAINTAINER RULING" entry on the key carries the rows below and what the bytes buy. No code change, #36039 is not touched, no exemption added, no import made lazy. Not moved:
i18n-locale-en. A dated "MAX_EAGER_CLOSURE_GZIP_BYTES,BASELINE,REGRESSION_THIS_GATE_MUST_CATCH_BYTES, the other three per-chunk rows.Why
mainsits 104 bytes under the old line, so S5 #36039 (the form's line-item grid cells) is ejected from the merge queue on it, and so would the next form-field PR be.The rows (one container, one instrument)
CI=true pnpm exec turbo run build --filter=@object-ui/console..., readingapps/console/dist/eager-closure.json, twice on one tree:mainat78f7160ealone, then thatmainwith #36039's headfbbaaa99merged in (a31a993e, local, not pushed). Gzipped bytes:78f7160ea31a993evendor-objectstacki18n-locale-enframeworkui-componentsThe same 104 eager chunks by name in both builds; besides
ui-componentsonlysrcmoved by more than 4 bytes (+19). Raw minifiedui-components: 1,292,123 -> 1,299,070 (+6,947). (The S5 thread measured +2,679 on an older main,7ba22bb6;mainhas since drifted +5.4 KB in this chunk, which is why it now sits 104 bytes under the line on its own.)What the bytes buy
GridSelectCell,GridDateCell) and its pop-out text input (GrowingCellInput), so a form's line items edit in the cell as a list grid does.import()ed but also statically exported frompackages/fields/src/index.tsx), after which both numbers come back down together.Verification
Clause-②: no
Metadata-protocol: none
pnpm --dir ui run check:eager-closureon the merged tree (a31a993ebuild, this branch's constants): exit 0;ui-components341.3 KB / 346.7 KB ceiling, headroom 5.4 KB; aggregate, membership and sensitivity halves all ✅.pnpm --dir ui exec vitest run scripts/__tests__/check-eager-closure-budget.test.ts: 174/174 passed (ceiling > baseline, gap < 695 KiB).node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, ordinary queue landing.dispatch-gates.mjs --commands(16 commands for this file list), each:: exit 0: check-closing-keyword-parity (+--self-test), check-comment-mask-corpus,pnpm --dir ui exec vitest run scripts/, check:adr-anchors, check:driver-memory-census, check:gitlink-declared, check:nul-bytes, check:pm-expected-skips, check:published-files, check:refd-timer-probe, check:registry-log-declared, check:rest-log-spy-declared, check:tier-file-adoption, check:undeclared-dep-imports, check:watch-hint-literal.skip-changeset: the only file is underui/scripts/, owned by the private root packageobject-ui-monorepo, so the diff publishes nothing from any released package (AGENTS.md Post-Task Checklist step 3).Branch is the harness-assigned
claude/project-thread-usk9vf, notclaude/issue-<n>-…(no card of its own).Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslinton the one file: exit 0; comment and constant edits only)main, one pull request.skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgWSAwkSz6F3eit2Y9u