Uh oh!
There was an error while loading. Please reload this page.
feat(plugin-grid): declare the host-driven external-pagination contract and type-check its tests (#4277, #4040) - #4297
Merged
Conversation
…ct and type-check its tests (#4277, #4040) ObjectGridProps declared 12 members while ObjectGrid read 12 more out of `...rest`, each through an `as any` cast — the framework#2212 host-driven external-pagination path, deliberate (the `:418` comment says so) and declared nowhere. Per the #4277 裁决 (option B + derivation pin): - `ObjectGridExternalPaginationProps` names the mode; `ObjectGridProps` extends it. The 11 members with a `DataTableSchema` counterpart — the type ObjectGrid forwards them to — are TYPE-DERIVED (`Partial< Pick< … > >`), not a second hand-written enumeration. Only `onColumnStateChange` is explicit, with its reason: the table vocabulary has per-event `onColumnResize` / `onColumnReorder` and no merged-layout callback. - The 12 `(rest as any)` reads become typed destructuring; `...rest` is gone. - `tsconfig.test.json` per the #3032 template, chained from `type-check`. - The two mechanical errors #4277 recorded: `importMissingRequiredHint` was omitting the required `dataSource`, and the `runAggregate` stubs declared no parameters while the cases read the second one through casts. - plugin-grid leaves TEST_DEBT (declared 2, measured 4, now 0). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Aug 11, 2026
Open
yinlianghui
marked this pull request as ready for review
August 11, 2026 13:58
yinlianghui
enabled auto-merge
August 11, 2026 14:00
…vals kept, this PR's removal kept)
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#4277. Part of #4040 — tranche 2, package 1 of 3. This is the tranche-1 blocker:
@object-ui/plugin-gridstopped on a public-type question, filed it, and stayed inTEST_DEBTuntil the PM ruled.The ruling this executes
#4277 was ruled on 2026-08-11 (option B, plus a derivation pin). Quoted verbatim — a ruling rewritten is a ruling changed:
ObjectGridRenderer'sanyindex signature is therefore not touched here.Measured before / after — re-measured, not read off the registry
TEST_DEBT421c145af), template as-isThe registry number was two tranches stale, which is why tranche 2 was dispatched to re-measure rather than trust it. The one config-tier error is
TS2550—Array.prototype.atincolumn-features.test.tsx/columnIdentity.test.tsx— resolved by the test project'slib, not by a code change. The four code-tier ones, verbatim:What changed
ObjectGridExternalPaginationProps(src/ObjectGrid.tsx) names the host-driven mode;ObjectGridPropsextends it. Eleven of its twelve members are type-derived fromDataTableSchema— the very type ObjectGrid forwards them to at:2207— asso there is exactly one written-out signature per member in the repository, and the pair cannot drift.
Partialis the only shape change and it is deliberate: the whole mode is opt-in, whileDataTableSchema['data']is required because a table always has rows — a grid that is given nodatafetches its own.The twelfth,
onColumnStateChange, is explicit, with its reason:DataTableSchemahas no counterpart to derive from. The table vocabulary reports column changes as separate per-event callbacks (onColumnResize(columnKey, width),onColumnReorder(newOrder)), whereas this one reports the merged, persisted{ order, widths }layout after ObjectGrid has folded either event into the state it also writes tolocalStorage— a different payload fired at a different moment. Its shape is exported asObjectGridColumnStateand reused by the component's own state hook, so those two cannot drift either.The twelve
(rest as any)reads became typed destructuring, which left...restreferenced by nothing, so it is gone. Two consequences worth stating rather than burying:saveColumnState's dependency array was[columnStorageKey, rest].restis a fresh object on every render, so the callback was never actually memoized; it is now[columnStorageKey, onColumnStateChange]. Strictly more stable, no behavior change.restwere already going nowhere —restwas never spread onto anything — so dropping it changes nothing at runtime.Two mechanical fixes recorded on #4277 so they would travel with the package:
importMissingRequiredHint.test.tsxomitted the requiredImportWizardProps.dataSource. These cases never leave the mapping step, but the wizard probes the source forlistImportMappings/importRecords/listImportJobson render, so a capability-free{}is the accurate fixture, named and commented.useBulkExecutor.test.tsstubbedrunAggregateasvi.fn(async () => undefined)whileBulkExecutorOptions.runAggregateis(def, rows, params)and the hook dispatches all three. vitest records the real arguments whatever the declared signature, so the cases that readmock.calls[0][1]passed at runtime and lied to the compiler; both reads were papered over with casts. A sharedaggregateStub()declares the three parameters, and both casts are deleted — the assertions now read the real declared tuple instead of asserting through a hole.Discrimination proof — three probes, all reverted, none in the diff
1. The new test project can fail (the #3009 third failure mode: a
tsconfig.test.jsonthat exists but nothing runs). A provably-false line appended toserverPagination.test.tsx:2. The declaration is what makes it compile. Removing only
extends ObjectGridExternalPaginationPropsfromObjectGridProps— the pre-fix contract, exactly — goes red:Worth reading precisely, because it is not where the template presumes the red lands: the errors surface at the source destructuring, not only at the test. That is the point — before this PR those twelve reads were
(rest as any)and the compiler had no opinion about any of them; now every one is load-bearing at the definition site, so deleting the declaration breaks the component itself rather than just one call site.3. The derivation is live, not a hand copy that happens to match. Passing a wrong-typed handler in the test:
(page: number) => void, parameter name and all, isDataTableSchema.onPageChangeverbatim — the error is quotingpackages/types, which is what the derivation pin asks for. A hand-copied enumeration would produce the same message today and drift silently tomorrow; this one cannot.Verification
Consumer sweep — downstream direction (
--filter '...@object-ui/plugin-grid', the prefix form, i.e. the packages that DEPEND on plugin-grid). This changes an exported interface, so the closure was rebuilt first and the consumers type-checked against the freshly emitteddist/index.d.ts, not a stale one:Those two are the only packages with a typed
< ObjectGrid … />call site besidesapps/console/src/dev/DevRowActions.tsx(schemaonly). Everything else reaches the grid throughObjectGridRenderer, whoseanyindex signature is out of scope by the ruling. The change is additive — every new member is optional — so no consumer can be narrowed by it; the sweep confirms rather than discovers.TEST_DEBTshrinks by exactly this package's line; no other entry is touched.Changeset
minorfor@object-ui/plugin-grid, per the ruling — declaring an already-accepted surface is a capability becoming visible, not a fix.Generated by Claude Code