Skip to content

Console eager chunk: GridField sits in ui-components although it is dynamically imported (static export + sideEffects); carve it out and lower the ceiling #36102

Description

@objectstack-fleet

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Follow-up owed by the maintainer's ruling 7063116595 on #36023 (option B: raise the eager ui-components ceiling by about 8 KB, in budget PR #36100, so #36039 can land; "a separate card follows to take GridField out of the eager chunk, after which the ceiling can come back down"). Evidence: the fable review build-seat1/36023/S5/fable-budget.md in the project folder.

What happens

GridField (ui/packages/fields/src/widgets/GridField.tsx, about 90 KB of source) is in the console's eager ui-components chunk. ui/packages/fields/src/index.tsx imports it dynamically, but the same entry also exports it statically, and the package is sideEffects: true, so the dynamic import does nothing. The repo already lists it as an ineffective dynamic import (ui/scripts/vite-ineffective-dynamic-imports.ts). Also, ui/apps/console/vite.config.ts assigns every packages/(components|fields)/ module to ui-components by path, so a lazy boundary alone saves nothing without a chunk group and a PER_CHUNK_MEMBERSHIP_CARVE_OUTS entry (precedent: fields-date-picker, objectui#12622). Main itself drifted about +5.4 KB on this line today, measured by #36100.

To do

  1. Measure GridField's in-chunk gzip size on main (two builds of one tree).
  2. Take it out of the eager chunk: drop the static export or route it through the lazy path, add its chunk group and carve-out, and make sure the record form's line-item table shows no blank or flash on first render (a preload when the form mounts is one way; measure it).
  3. Lower PER_CHUNK_GZIP_CEILINGS['ui-components'] and its baseline by what was taken out, in the file's own "Raising it" style with the rows published.

Acceptance

  • ui-components eager gzip drops by GridField's measured size, and the ceiling comes down with it.
  • The line-item table in a create and an edit form renders on first open with no blank cell and no focus loss, pinned in an e2e.

Activity

  1. added
    enhancement
    priority:p2
    pm:queue
    domain:ui
    on Nov 21, 2026
  2. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue; rationale: area:ux · Task · GridField (~90 KB source) sits in the console's eager ui-components chunk because the fields entry also exports it statically; carve it out and lower the ceiling again; owed by the maintainer's ruling 7063116595 on #36023 (option B raised the ceiling ~8 KB for now) → p2 as filed · size S (measure first).

  3. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Seat note · 2026-11-21T14:55Z · For whoever builds this card: after #36109 the ui-components ceiling is 451,100 on the maintainer ruling 7063869131, and that ruling says this card is no longer what brings the budget back down. Step 3 therefore lowers the ceiling and baseline by the bytes GridField takes out, no more; and the PR rewords the two budget entries that call this card a "PAYBACK" (#36100 and #36109) to "follow-up, not a payback; lower both numbers by the bytes removed" (L1-b N1 on #36109, 7064451361).

  4. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

    Claim: PM loop · area f7-shell · 2026-11-22T07:32Z · measure first
    Session: session_01QsR2jV3scu6UYPb42n5okQ
    Account: zhuangjianguo
    Branch: claude/issue-36102-gridfield-carve-out
    Worktree: objectstack-issue-36102
    Domain: domain:ui
    Seat: repo:objectstack#7
    Area: f7-shell
    File surface: ui/packages/fields/src/index.tsx (the static GridField export at :5502), ui/packages/fields/src/widgets/GridField.tsx only for a lazy boundary, ui/apps/console/vite.config.ts (chunk group at :1510), ui/scripts/check-eager-closure-budget.mjs (PER_CHUNK_GZIP_CEILINGS['ui-components'], its baseline, a PER_CHUNK_MEMBERSHIP_CARVE_OUTS entry, the two budget entries #36100 / #36109 reworded), ui/scripts/vite-ineffective-dynamic-imports.ts, the record form's line-item consumers of the static export, an e2e pin, a changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: opus (default tier; dispatch-gates --tier at 2b57044: no path-derived mandate on ui/**), effort: high (two-build measurement plus a first-render check)
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: n/a — not a defect card (follow-up owed by ruling 7063116595 on #36023)
    Ruling-ref: 7063116595
    Thread-read: 7064483594
    Premise: holds — at origin/main 2b57044 fields/src/index.tsx:4823 imports GridField lazily and :5502 exports it statically; console/vite.config.ts:1510 assigns packages/(components|fields)/ to ui-components by path; the ceiling is 451,100 (check-eager-closure-budget.mjs:2492).
    Pre-claim lane: repo:objectstack whole-repo lane, area f7-shell (seat 7 lease, #35557); paths ui/** (domain:ui).
    Pre-claim deps: none (#36100, #36109 merged).
    Prior rulings read: check-prior-rulings.mjs --card 36102 --paths 'ui/packages/fields/src/**,ui/apps/console/vite.config.ts' exit 0 at 2b57044; ruling 7063116595 (option B: the ceiling rose ~8 KB, a separate card takes GridField out); ruling 7063869131 (ceiling 451,100; this card no longer brings the budget back down) via seat note 7064483594: lower the ceiling and baseline by the bytes GridField takes out, no more, and reword the two "PAYBACK" entries to "follow-up, not a payback; lower both numbers by the bytes removed".
    Fold-or-serial: no other area card touches these files; not folded.
    Serial constraints cleared: shared budget file check-eager-closure-budget.mjs: any open PR raising a ceiling there is a textual neighbour; overlap-check runs before the first push and before the queue (landing K rule for shared budgets).
    Amendment: Clause-② no → yes on the dev report 7078442412: PR #36417 adds one published @object-ui/fields export, preloadGridField() (no export removed or renamed). A default-tier L2 is owed before the queue; the seat runs it. The surface also grew by packages/spec/liveness/field.json (an evidence path follows the moved helper).

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  6. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ
    os-dev-report

    {
     "issue": 36102,
     "status": "done",
     "branch": "claude/issue-36102-gridfield-carve-out",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/36417",
     "head": "eb10283083a14bed026d9ad123c8cd9745f02a25",
     "session": "session_01QsR2jV3scu6UYPb42n5okQ",
     "premise_still_valid": true,
     "summary": "GridField's body moved, as a git rename, to ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx, in a new lazy fields-grid chunk (a vite group plus a PER_CHUNK_MEMBERSHIP_CARVE_OUTS row, following the fields-date-picker precedent). widgets/GridField.ts keeps the pure helpers, which stay eager, and exports GridField and LineItemsField as a small lazy face with unchanged names and props, plus one new export, preloadGridField(). No published export was removed or renamed. MasterDetailForm draws a collection's grid only once the body has settled, and RecordBodyTableEditor waits for the body with the child schema, so the create and edit invoice forms never mount the grid on its placeholder; this is pinned in the live e2e. Measured on two builds of one tree, ui-components went from 352,359 to 346,403 (-5,956). The ceiling went from 451,100 to 445,144 and the baseline from 265,937 to 259,981, and the #36100 and #36109 entries were reworded to 'follow-up, not a payback'.",
     "tests": "At eb102830 and its parent 51af8021: `cd ui && pnpm exec vitest run packages/plugin-form/` gave Test Files 244 passed (244), Tests 2750 passed / 1 skipped. `pnpm exec vitest run packages/fields/` plus the 3 scripts tests (eager-closure-budget, ineffective-dynamic-imports, declared-lazy-views) gave Test Files 323 passed / 1 skipped (324), Tests 5064 passed / 7 skipped. plugin-form and fields type-check both exit 0. Live e2e master-detail.spec.ts against the local workspace backend and a vite preview: at e581a9a5 the new create case was red ('the grid never mounted on its loading placeholder: Expected 0, Received 1'; a trace put the placeholder inside md-collection about 0.4 s before the grid). At 51af8021, with --repeat-each 3 --retries 0, 15 passed (1.1m). Ablation through scripts/ablation-replace.mjs, after committing: useState(() => gridFieldWidgetModule) was replaced by a per-render read (anchor 1->0, blob 2e286b33ebdf->1f484acf48d9), giving 'x a mount before the body loads shows the placeholder, then the grid, and a later render keeps the focused cell' and Tests 1 failed / 91 passed. Restore was verified: blob == HEAD and git diff HEAD is empty. The tested subject resolves from source, so no dist rebuild was needed.",
     "gates": "Local: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at 51af8021 derived 73 commands; each was run with its exit captured before any pipe. `--ran` with exits gave 73 derived, 71 run, 2 NOT-MEASURED (exit 3, PREREQUISITE NOT MET): check-plugin-teardown-shape --self-test (shallow clone cannot reach its pinned fixture commit) and check:dual-build-cjs-loads (unbuilt unrelated packages' dist); 0 UNRUN. `check:eager-closure` on the final default-base build is exit 0: ui-components 338.3 KB / 434.7 KB, and membership is 'src/widgets/grid-field subtree 1 in fields-grid, exactly'. `check-platform-checklist --changed-from origin/main` exit 0 (1 anchor judged, 0 lost). check:liveness exit 0, check:nul-bytes exit 0. The eb102830 commit only rewords a budget comment. CI at eb102830 (69 check-runs, 59 success, 10 skipped, 0 red): Test Core (1-10/10) success, Live E2E UI success, Build & E2E UI success, Type Check UI success, Lint UI success, Lint & Repo Gates success, Lint · ESLint success, Lint · PM dispatch-gates success, Type Check · workspace/source/consumer/debt success, Check Changeset success, Build Core success. Overlap-check at eb102830 is exit 1: it conflicts with same-seat drafts #36351 and #36392 in GridField tests and the moved widget body; origin/main, #36343 and #36399 merge cleanly.",
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "2 — relay pr_create (fleet-write run 45014729009: POST pulls draft + POST issues/36417/assignees; read-back 11566 bytes identical), post-stamped os-dev-report comment on issue 36102 (POST issues/36102/comments)",
     "open_questions": [
      {
       "question": "The claim said Clause-② no; this PR declares yes (widening) because of the new published export preloadGridField(). Does the seat route it to L2 (TIER_DEFAULT)?",
       "options": [
        "A keep yes (widening) and route L2",
        "B drop the export and make the forms preload through an internal path"
       ],
       "recommendation": "A, because a host rendering GridField itself needs a way to have the body in its first render, and the record forms use the same entry"
      },
      {
       "question": "Landing order against same-seat drafts #36351 and #36392, which edit widgets/GridField.tsx (now moved to grid-field/GridFieldWidget.tsx)",
       "options": [
        "A land #36417 first; the others re-apply their body hunks to the new path",
        "B land the others first; #36417 merges main and re-moves the body"
       ],
       "recommendation": "A, because the move is mechanical to re-apply on the other side, while re-measuring the ceiling after B costs another two builds"
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: widgets/gridCellPanels.tsx is imported only by the grid body and could follow it into fields-grid (about 2.5 KB gzip, estimated, not measured); in PR Acceptance notes"
     ],
     "deviations": "The claim declared Clause-② no; the PR body declares yes (widening) for the new preloadGridField export. packages/spec/liveness/field.json, outside the claim's file surface, was edited (evidence path to the helper's new file). The extra MasterDetailForm gate (useGridBodySettled) was added after the live pin caught the placeholder; it is within MasterDetailForm.tsx. Gate list derived on a tree 23 commits behind origin/main (no merge: overlap-check reads origin/main as merging cleanly).",
     "files_changed": 51
    }

    Generated by Claude Code

  7. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ

    Close-out · area f7-shell · 2026-11-22T13:41Z

  8. removed
    pm:dispatched
    on Nov 22, 2026
  9. added a commit that references this issue on Nov 23, 2026
    0628e08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions