Uh oh!
There was an error while loading. Please reload this page.
ObjectMap reads schema.data in one place again — normalize the array shorthand at the getDataConfig boundary - #5501
Merged
Conversation
…Config boundary WIP — tests to follow. Removes the fetch effect's direct `schema.data` read (react-hooks/exhaustive-deps 609:6) by normalizing the array shorthand into the declared `value` provider in `getDataConfig`, where ObjectGrid already pins the same shape. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zHsbJoTkTZeJQ5DLbRXrE
…#5305) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zHsbJoTkTZeJQ5DLbRXrE
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zHsbJoTkTZeJQ5DLbRXrE
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This was referenced Aug 21, 2026
qq9340100
marked this pull request as ready for review
August 21, 2026 07:28
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 21, 2026
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.
Fixes#5305
ObjectMap's fetch effect carried a second short-circuit beside theprops.dataone #5003 / PR #5297 handled: it readschema.datadirectly and tested whether that value was itself an array. eslint reported it asmissing dependency: schema.data— the lastreact-hooks/exhaustive-depswarning on that effect.The card framed this as a binary: delete the branch if no producer can reach it, or thread the dependency if one can. The measurement selected neither, and this PR explains why before it explains what changed.
What the measurement found
1. The dependency was never actually missing.
getDataConfig(schema)already returnsschema.dataverbatim; the result is memoized onJSON.stringify(rawDataConfig)intodataConfig, anddataConfigis one of the effect's declared dependencies. Authored rows therefore reached the effect before this change. The direct read was a duplicate of an already-threaded value — so addingschema.datato the dependency array would have silenced a warning without changing any behaviour.2. The array shape is not an
ObjectMapaccident. It is a deliberate, commented convention in six sibling blocks —ObjectGrid's owngetDataConfig("Check if data is an array (shorthand format)"),ListView("Also support schema.data as a plain array (shorthand for value provider)"),ObjectTree,ObjectChart,ObjectDataTable,calendar-view-renderer.3. There is a landed ruling on exactly this question.#5090 raised the same declared-vs-runtime split for
object-gridand landed as PR #5108, which corrected the declaration to aViewDataobject ("inline rows go underitemshere rather than in a bare array") and left the runtime array normalization in place —ObjectGrid.tsx:393still carries it onmain. The settled position is: not authorable, still normalized at runtime.4. Deleting was measured, not assumed. With the array handling ablated, an array-shorthand map does not render an empty map — it renders
Error: DataSource required for object/api providers.object-mapwould have become the one block in the family that answers the shorthand with an error box.The change
The array handling moved into
getDataConfig, whereObjectGridalready pins the same normalization. The effect now reads onlydataConfig, which is already a dependency, so the warning is gone with no directive and no redundant dependency.One behavioural consequence, and it is the point: an array under
datanow yieldsprovider: 'value', sohasInlineDatais true and the sibling effect no longer callsdataSource.getObjectSchema()for it. That request's only read site isbuildExpandFields()inside the object-provider fetch branch, which an inline schema never reaches — the call was pure waste. The shorthand now behaves exactly like the declared{ provider: 'value', items }form it is shorthand for.packages/types/**was read-only for this card and is untouched — the declared shape staysdata?: ViewData.Producer-side census, with its control probes
Every zero below was counter-probed; a zero without a passing control is not a reading.
data:/"data":array literal acrosspackages,apps,examples,contentstaticData:/"staticData":array literal, identical scope and pattern shapeobject-mapschemaobject-mapanywhere in theobjectstackspec repoobject-grid, same scopeschema.datareachingObjectMapfrom any in-repo producerArray.isArray(schema.data)consumers, same scopePer-producer results:
ListView'smapbranch forwards nodatakey at all (theganttbranch immediately above it does —...(schema.data ? { data: schema.data } : {})— so the omission is visible, not assumed). ListView instead passes its rows as thedataprop,{...(ganttOwnsData ? {} : { data })}, which is thedataProppath fix(plugin-map): thread props.data and seed clustering zoom from the applied camera #5297 already handles.examples/schema-catalogmap schemas authorstaticData, notdata.content/docs/plugins/plugin-map.mdxhas no baredata:key anywhere; its Schema API documentsstaticDataas an array ofanyanddataas aViewDataconfig.dataunset, and says so in a comment.plugin-map's own 11 test files authordata: { provider: 'value', items }throughout.objectstackspec repo has noobject-mapfixture; its twoobject-maphits are English prose inpackages/restmeaning "object-shaped map".So: no in-repo producer sends an array-shaped
schema.datatoObjectMap, and none of the spec, the types, or this package's docs offer it. The shape is nonetheless normalized rather than dropped, because six sibling blocks accept it, PR #5108 kept the equivalent normalization forobject-grid, and an author or generator that learned the shorthand fromobject-gridwrites it forobject-mapnext.Contract position
ViewDataresolves to@objectstack/spec'sViewDataSchema— az.discriminatedUnion('provider', […])over object variants, whosevaluemember additionally declaresaliases: { data: 'items', rows: 'items', records: 'items' }. A bare array underdatais off-contract twice over, and this PR does not make it authorable: it neither widens a type nor adds an input declaration. It only keeps the renderer's existing tolerance in one place instead of two.Verification
Gate union at
0fe2fc76b, the final commit:pnpm --filter @object-ui/plugin-map type-check→TYPECHECK_EXIT=0(pnpm echoedtsc --noEmit && tsc -p tsconfig.test.json, so this was a real run, not a zero-match no-op)npx vitest run --maxWorkers=2 packages/plugin-map/src, from the repo root →VITEST_EXIT=0,Test Files 12 passed (12),Tests 70 passed (70)schema.data dep warning present: false.ObjectMap.tsxalone goes 16 problems → 15,react-hooks/exhaustive-deps3 → 2. The two that remain are both on the pre-existinguseMemoat:569(JSON.stringifyin its dependency array), a different hook that the card scoped out.Ablation. The array normalization was removed, the mutation confirmed on disk by grep count (
const authored: unknown1 → 0,items: authored1 → 0, restored to 1/1 afterwards by anEXIT/INT/TERMtrap), and the suite re-run: 3 failed | 2 passed. The three array-shorthand tests went red and the two controls — the declared{ provider: 'value', items }form and thedata-prop precedence test — stayed green. No rebuild was needed for this ablation: the tests import./ObjectMapas a relative source specifier, so nothing resolves throughdist/.Not addressed here
object-map's registryinputsdeclare 2 of the 12 keysObjectMapSchemasays the renderer reads — the #4648 gap, never applied toplugin-map. That is the designer/declaration surface rather than this fetch effect, so it is recorded separately in #5500 and is out of scope: #5500 remains open.Generated by Claude Code