Repository navigation
fix(react): republish an equal object definition as the same object (objectui#10106) - #10149
Conversation
…objectui#10106) `useSettledSchema` re-reads `getObjectSchema` whenever the adapter identity changes and settled a FRESH `def` object even when the answer was byte-identical. Every consumer its doc comment instructs keys its record fetch on `def` — which is what AGENTS.md §5 commandment #10 tells a consumer to do — so the fresh object re-fired all of them: an adapter swap on provider `object` cost TWO record queries carrying the SAME `$expand` set. The repair is the producer half of that same sentence: a settle whose answer is value-equal to the one already published keeps the object consumers hold. A definition that genuinely changed still publishes a new object and still re-queries. Measured first-hand on `ObjectGantt` with an instrumented adapter, three cases in one command: a byte-identical answer as a fresh object cost 2 `find` (expand `[['owner'], ['owner']]`), the SAME def object from both adapters cost 1, and a genuinely different def cost 2 with the second carrying `['owner','account']`. After the repair the first case reads 1 and the other two are unchanged. The counts and their control are pinned in `useSettledSchema.equalPayload-10106.test.tsx`. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq
|
| Step | Outcome |
|---|---|
| Build packages | success |
| Check console performance budget | failure |
Which half objected:
| Eager-closure half | Verdict |
|---|---|
| Aggregate closure ceiling | ✅ pass |
| Per-chunk ceilings | ✅ pass |
| Ceiling sensitivity (headroom) | |
| Ceiling freshness (checkout vs. base branch) | ✅ pass |
⚠️ A broken gauge half is a verdict about the ceiling, not about the bundle: that line has drifted out of range of the regression it exists to catch, or the report behind it cannot be trusted. It does not say anything grew. TheCheck console performance budgetstep log carries the ceiling and the number it was compared against.
Reason: The entry chunk measured 146.9 KB, but the eager-closure half of this gate returned no trustworthy VERDICT: the report could not be read, a ceiling has drifted out of range of the regression it must catch, or (objectui#6245) a ceiling was replaced on the base branch after this checkout was made. The step log says which. This is not a passing budget — and it is not a size regression either.
See the workflow run for details.
📦 Bundle Size Report
| Package | Size | Gzipped |
|---|---|---|
| app-shell (consoleActionDispatch.js) | 0.20KB | 0.19KB |
| app-shell (index.js) | 16.68KB | 6.20KB |
| app-shell (runtime-config.js) | 20.68KB | 7.36KB |
| app-shell (types.js) | 0.01KB | 0.04KB |
| app-shell (urlParams.js) | 10.06KB | 3.86KB |
| auth (ActiveOrganizationStorage.js) | 25.05KB | 9.16KB |
| auth (AuthContext.js) | 0.31KB | 0.24KB |
| auth (AuthGuard.js) | 2.07KB | 1.00KB |
| auth (AuthProvider.js) | 40.18KB | 10.59KB |
| auth (AuthShell.js) | 3.49KB | 1.40KB |
| auth (ForgotPasswordForm.js) | 12.21KB | 3.45KB |
| auth (LoginForm.js) | 18.15KB | 5.39KB |
| auth (PreviewBanner.js) | 0.90KB | 0.50KB |
| auth (RegisterForm.js) | 6.65KB | 2.22KB |
| auth (SocialSignInButtons.js) | 9.61KB | 3.89KB |
| auth (UserMenu.js) | 3.41KB | 1.23KB |
| auth (auth-gate-events.js) | 1.29KB | 0.66KB |
| auth (authStyles.js) | 5.04KB | 1.72KB |
| auth (createAuthClient.js) | 40.21KB | 10.80KB |
| auth (createAuthenticatedFetch.js) | 8.46KB | 3.43KB |
| auth (index.js) | 3.19KB | 1.44KB |
| auth (invitation-status.js) | 1.22KB | 0.70KB |
| auth (org-roles.js) | 6.66KB | 2.78KB |
| auth (phone-identifier.js) | 1.11KB | 0.66KB |
| auth (types.js) | 0.59KB | 0.35KB |
| auth (useAuth.js) | 5.30KB | 1.02KB |
| auth (useWorkspaceAdminStatus.js) | 11.08KB | 4.58KB |
| collaboration (CommentThread.js) | 26.08KB | 7.56KB |
| collaboration (LiveCursors.js) | 3.17KB | 1.27KB |
| collaboration (PresenceAvatars.js) | 6.49KB | 2.64KB |
| collaboration (PresenceProvider.js) | 2.79KB | 1.13KB |
| collaboration (index.js) | 1.68KB | 0.73KB |
| collaboration (useCollaborationTranslation.js) | 6.05KB | 2.52KB |
| collaboration (useCommentSearch.js) | 1.98KB | 0.88KB |
| collaboration (useConflictResolution.js) | 7.75KB | 1.86KB |
| collaboration (useMentionNotifications.js) | 1.81KB | 0.68KB |
| collaboration (usePresence.js) | 6.33KB | 1.84KB |
| collaboration (useRealtimeSubscription.js) | 7.91KB | 2.01KB |
| components (index.js) | 545.92KB | 130.72KB |
| core (index.js) | 8.94KB | 3.59KB |
| create-plugin (index.js) | 27.94KB | 9.51KB |
| data-objectstack (index.js) | 221.99KB | 61.72KB |
| fields (index.js) | 251.81KB | 63.47KB |
| i18n (LocalizationContext.js) | 1.76KB | 0.96KB |
| i18n (builtinAggregateLabels.js) | 0.86KB | 0.49KB |
| i18n (currency.js) | 1.22KB | 0.64KB |
| i18n (fallbackInterpolation.js) | 6.25KB | 2.77KB |
| i18n (i18n.js) | 8.87KB | 3.64KB |
| i18n (index.js) | 5.22KB | 2.26KB |
| i18n (pickLocalized.js) | 9.86KB | 3.95KB |
| i18n (provider.js) | 32.15KB | 10.49KB |
| i18n (useDisplayLocale.js) | 2.85KB | 1.45KB |
| i18n (useObjectLabel.js) | 34.34KB | 9.17KB |
| i18n (useSafeTranslation.js) | 5.60KB | 2.33KB |
| layout (index.js) | 38.90KB | 10.97KB |
| mobile (MobileProvider.js) | 0.92KB | 0.49KB |
| mobile (ResponsiveContainer.js) | 0.94KB | 0.38KB |
| mobile (breakpoints.js) | 1.51KB | 0.70KB |
| mobile (createOfflineDataSource.js) | 5.61KB | 1.75KB |
| mobile (index.js) | 1.99KB | 0.87KB |
| mobile (offlineQueue.js) | 3.91KB | 1.35KB |
| mobile (pwa.js) | 0.97KB | 0.49KB |
| mobile (serviceWorker.js) | 1.48KB | 0.62KB |
| mobile (serviceWorkerSource.js) | 3.41KB | 1.48KB |
| mobile (useBreakpoint.js) | 1.54KB | 0.65KB |
| mobile (useGesture.js) | 6.96KB | 1.98KB |
| mobile (useOfflineSync.js) | 1.99KB | 0.72KB |
| mobile (usePullToRefresh.js) | 2.53KB | 0.85KB |
| mobile (useResponsive.js) | 0.72KB | 0.42KB |
| mobile (useSpecGesture.js) | 5.52KB | 2.10KB |
| mobile (useTouchTarget.js) | 1.01KB | 0.54KB |
| permissions (MePermissionsProvider.js) | 13.52KB | 4.88KB |
| permissions (PermissionContext.js) | 0.31KB | 0.25KB |
| permissions (PermissionGuard.js) | 0.89KB | 0.45KB |
| permissions (PermissionProvider.js) | 6.24KB | 2.16KB |
| permissions (discardProofCache.js) | 1.04KB | 0.55KB |
| permissions (evaluator.js) | 8.39KB | 3.10KB |
| permissions (index.js) | 0.93KB | 0.41KB |
| permissions (store.js) | 0.91KB | 0.42KB |
| permissions (useFieldPermissions.js) | 1.28KB | 0.53KB |
| permissions (usePermissions.js) | 4.83KB | 2.27KB |
| plugin-ai (index.js) | 14.81KB | 3.63KB |
| plugin-calendar (index.js) | 51.08KB | 14.50KB |
| plugin-charts (index.js) | 71.73KB | 20.08KB |
| plugin-chatbot (index.js) | 198.20KB | 47.14KB |
| plugin-dashboard (index.js) | 132.96KB | 35.17KB |
| plugin-designer (index.js) | 215.94KB | 44.33KB |
| plugin-detail (index.js) | 255.17KB | 66.48KB |
| plugin-editor (index.js) | 2.23KB | 1.05KB |
| plugin-form (index.js) | 139.56KB | 35.40KB |
| plugin-gantt (index.js) | 167.99KB | 41.37KB |
| plugin-grid (index.js) | 213.40KB | 58.19KB |
| plugin-kanban (index.js) | 48.71KB | 15.17KB |
| plugin-list (index.js) | 113.53KB | 27.99KB |
| plugin-map (index.js) | 21.48KB | 6.99KB |
| plugin-markdown (index.js) | 13.88KB | 4.80KB |
| plugin-report (index.js) | 43.49KB | 11.97KB |
| plugin-timeline (index.js) | 30.68KB | 8.95KB |
| plugin-tree (index.js) | 10.58KB | 3.72KB |
| plugin-view (index.js) | 85.18KB | 21.05KB |
| providers (DataSourceProvider.js) | 0.75KB | 0.39KB |
| providers (MetadataProvider.js) | 1.37KB | 0.59KB |
| providers (ThemeProvider.js) | 1.90KB | 0.85KB |
| providers (UploadProvider.js) | 11.66KB | 3.50KB |
| providers (index.js) | 0.45KB | 0.23KB |
| providers (types.js) | 0.01KB | 0.04KB |
| react-runtime (index.js) | 5.62KB | 2.34KB |
| react (LazyPluginLoader.js) | 4.47KB | 1.63KB |
| react (SchemaRenderer.js) | 109.04KB | 36.08KB |
| react (data-invalidation.js) | 5.05KB | 2.08KB |
| react (index.js) | 4.63KB | 2.18KB |
| react (schema-input.js) | 4.25KB | 2.04KB |
| react (spec-input.js) | 0.20KB | 0.18KB |
| sdui-parser (body-dialect.js) | 4.38KB | 1.98KB |
| sdui-parser (codegen.js) | 6.58KB | 2.74KB |
| sdui-parser (dashboard-widget-options.js) | 3.08KB | 1.30KB |
| sdui-parser (index.js) | 5.74KB | 2.54KB |
| sdui-parser (input-type.js) | 2.84KB | 1.40KB |
| sdui-parser (kanban-quick-add.js) | 3.89KB | 1.87KB |
| sdui-parser (parse.js) | 25.28KB | 7.80KB |
| sdui-parser (provenance.js) | 3.66KB | 1.82KB |
| sdui-parser (types.js) | 0.28KB | 0.23KB |
| sdui-parser (validate.js) | 15.71KB | 5.30KB |
| types (ai.js) | 4.11KB | 2.06KB |
| types (api-types.js) | 0.20KB | 0.18KB |
| types (app.js) | 2.87KB | 1.00KB |
| types (base.js) | 0.20KB | 0.18KB |
| types (blocks.js) | 0.20KB | 0.18KB |
| types (complex.js) | 2.93KB | 1.49KB |
| types (crud.js) | 0.20KB | 0.18KB |
| types (dashboard-filter-alias.js) | 6.23KB | 2.74KB |
| types (data-display.js) | 3.75KB | 1.85KB |
| types (data-protocol.js) | 0.20KB | 0.19KB |
| types (data.js) | 0.20KB | 0.18KB |
| types (designer.js) | 1.85KB | 0.85KB |
| types (disclosure.js) | 0.20KB | 0.18KB |
| types (error-code.js) | 1.54KB | 0.88KB |
| types (expression.js) | 0.20KB | 0.18KB |
| types (feedback.js) | 0.20KB | 0.18KB |
| types (field-types.js) | 0.20KB | 0.18KB |
| types (form.js) | 0.20KB | 0.18KB |
| types (http-inflight.js) | 8.87KB | 3.73KB |
| types (http-retry.js) | 4.32KB | 2.02KB |
| types (icon-key-migration.js) | 4.26KB | 1.63KB |
| types (index.js) | 4.74KB | 2.25KB |
| types (layout.js) | 0.20KB | 0.18KB |
| types (managed-by.js) | 0.19KB | 0.18KB |
| types (mobile.js) | 5.00KB | 2.39KB |
| types (navigation.js) | 0.20KB | 0.18KB |
| types (objectql.js) | 0.20KB | 0.18KB |
| types (overlay.js) | 0.20KB | 0.18KB |
| types (permissions.js) | 0.20KB | 0.18KB |
| types (plugin-scope.js) | 0.20KB | 0.18KB |
| types (record-components.js) | 0.20KB | 0.19KB |
| types (record-semantics.js) | 1.28KB | 0.67KB |
| types (registry.js) | 0.20KB | 0.18KB |
| types (reports.js) | 0.20KB | 0.18KB |
| types (select-option.js) | 0.20KB | 0.19KB |
| types (spec-report.js) | 5.05KB | 1.93KB |
| types (spec-ui-namespace.js) | 0.20KB | 0.19KB |
| types (strict-authoring-face.js) | 14.04KB | 5.36KB |
| types (system-fields.js) | 3.33KB | 1.54KB |
| types (theme.js) | 6.28KB | 2.87KB |
| types (ui-action.js) | 8.11KB | 3.32KB |
| types (views.js) | 0.20KB | 0.18KB |
| types (widget.js) | 0.20KB | 0.18KB |
Size Limits
- ✅ Core packages should be < 50KB gzipped
- ✅ Component packages should be < 100KB gzipped
⚠️ Plugin packages should be < 150KB gzipped
✅ 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
|
Fixes #10106
Clause-②: no — a provider's republish identity. No exported symbol and no key on a published payload moves. Re-declared from the actual diff: the diff adds a module-private
isEqualPayloadand asettleclosure insideuseSettledSchema's effect; the hook's exported signature, itsSettledSchemainterface and every key on the value it publishes are byte-unchanged.The re-take — it REPRODUCES
The card was wholly second-hand (filed from objectui#10036's hand-back, re-run by nobody), so the first deliverable was the measurement, not a diff. Taken first-hand on the REAL consumer,
ObjectGantt, with an instrumented adapter, swapping the adapter on providerobject, three cases in ONE command so that "two" is a discrimination and not a counting artefact of the harness:findon the new adapter[['owner'], ['owner']][['owner']][['owner'], ['owner','account']]The middle row is what makes the top row a finding: the same harness counts ONE the moment the producer keeps the payload's identity, so the extra query is the republish and nothing else. The bottom row is where two queries are WARRANTED — the second carries an expand set the first could not have — which is why the repair may never be "fetch less".
After the repair, re-measured in the same harness: SUBJECT 2 → 1 (
[['owner']]), and both controls unchanged (1 and 2, the latter still widening to['owner','account']).getObjectSchemawas called exactly once on the new adapter in every case, before and after: this is not "the refetch was skipped".What was repaired, and where
AGENTS.md§5 commandment #10 closes with two halves:The consumers are already on the right side of the second half —
ObjectGantt,ObjectCalendar,ObjectView,ObjectTimelineandObjectGalleryeach key their record fetch ondef, the payload, not on a memo identity. The breach was the first half, at the producer:useSettledSchemare-readgetObjectSchemaon an adapter change and settled a freshdefobject for a byte-identical answer, re-firing every one of those fetches.The fix is at that producer and nowhere else: a settle whose answer is value-equal to the one already published keeps the object consumers hold. Nothing moved into a consumer's dependency list, and no cache was introduced — commandment #10 names both as the wrong cure in the same sentence.
Why
readydoes not save anyone here, since it is easy to misread:readyisresolution.key === key, and an adapter swap does not move the key.readystays TRUE right through the swap, so a consumer's gate holds nothing back — the first query goes out at once on the definition already in hand, and the republish adds the second. That is now pinned too.Evidence
RED-before — the pin run against the hook byte-identical to
origin/main, with the file state proved in the SAME command (git hash-objecton the hook equal to itsHEADblob, both printed asbb550f98d):2 failed | 3 passed. The two subject assertions failed; all three controls passed.GREEN-after — same pin with the repair on disk (blob
f287de8b6, printed in the same command):5 passed.Ablation from the committed state — the
settlebail-out replaced by the pre-repair unconditional republish. The mutation was proved by content and by hash, never by an exit code: injected marker count1, removed-guard count0, blobf287de8b6 → ae320ff3b. The pin went2 failed | 3 passed— the same two, with all three controls still green. Restore proved the same way: blob back tof287de8b6,git diff HEADempty.Suites —
packages/reactin full plus everyuseSettledSchemaconsumer pin (ObjectGanttfetch gate,ObjectCalendar,ObjectKanbanx2,ObjectGallery,ObjectTimeline,ObjectTree,ObjectView) and the two doc-example reader gate suites: 115 files / 1353 tests passed, atfe23217e9with a clean tree (printed in the same command).Type-check —
@object-ui/react:tsc --noEmitandtsc -p tsconfig.test.json, both clean. The test project SELECTS the new pin (--listFilesfinds it).Gates, re-run last, at
fe23217e9with nothing unstaged —check:control-bytes,check:new-line-citations,check:doc-examples,check:doc-example-ids,check:doc-example-readers,check:doc-snippets,check:doc-types,check:readme-exports,check:test-path-roots,check:vi-mock-specifiers,check:unreferenced-sources,check:pending-changeset-literals,check-changeset-presence,check-changeset-fixed,check-changeset-no-major, andeslinton both changed files: all exit 0.check:doc-examplesandcheck:readme-exportsfirst answered PRECONDITION NOT MET / population COLLAPSED (nodiston disk —readme-exportsreportedtypesResolved: 0against a floor of 2). Those runs are recorded as not-a-verdict, not as passes. Both were then re-run properly afterturbo run buildover the filter the gate itself prints, and the green above is from those runs, with a healthy population (readme-exports: 3384 export symbols from 36 of 40 packages, 58 keys compared).Changeset — decided by running the gate, not from memory:
check-changeset-presenceexited 1 and named@object-ui/react; apatchchangeset was added and it now exits 0.Acceptance notes
Noted while in the file, ⛔ not filed and ⛔ not fixed here:
useSettledSchema.test.ts's case "re-fetches when dataSource identity changes even if the key does not" carries a comment stating "Ready flips false the instant the source changes, same mechanism as a key change". That is not what the code does:readyisresolution.key === keyand an adapter swap leaves the key alone, soreadystays true — which is exactly the mechanism this card rests on. The assertions in that case are correct and still pass; only the sentence is wrong. Left alone because it is a different class from this card's defect, and correcting someone else's prose is not this card's business; the correct statement is now written and pinned in the new file next to it.Not in scope, deliberately
@examplepublishes, because this card's file surface isuseSettledSchema.tsand its tests. TheObjectGanttreading above was taken with a throwaway probe, reported here and removed — it is not part of the diff.packages/plugin-ganttonly, so there is no overlap with this branch.🤖 Generated with Claude Code
https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq
Generated by Claude Code