Skip to content

fix(components): route the SVG-hosted renderers' spread through toDomProps - #7564

Merged
os-project-manager merged 1 commit into
mainfrom
claude/issue-5632-dom-leak-slice-next
Sep 3, 2026
Merged

fix(components): route the SVG-hosted renderers' spread through toDomProps#7564
os-project-manager merged 1 commit into
mainfrom
claude/issue-5632-dom-leak-slice-next

Conversation

@os-project-manager

Copy link
Copy Markdown
Collaborator

Part of #5632

Clause-②: no

Determined from this diff, not from the expectation: the changed files are two renderer bodies and two test files. packages/types and packages/spec are untouched, and no registry inputs / defaultProps / namespace / label line moved — so no published accept surface moves.

The slice, and why this one

One mechanism group, per the triage seat's decomposition ruling (comment 5380586286): BARE_SPREAD_ON_SVGui:icon and ui:spinner.

Exclusion list: EMPTY. Stated rather than omitted. Both members land, so the group entry is DELETED from COMPONENTS_LEAK_GROUPS outright and the grouping is five mechanisms now, not six.

Why this group and not another, re-measured on origin/main 3e01cb55f rather than inherited (six groups, 97 targets):

Ledger: 97 targets in six shapes to 95 in five.

The mechanism: the bare toDomProps, and why NOT a third declaration

The sibling slice (PR #5858) could not take the bare executor: its hosts are form controls, where name and disabled are legal HTML, so it needed a declaration of its own. That question has to be asked per host, and here the answer is the opposite one — measured, not assumed. IconSchema declares icon, size, color; SpinnerSchema declares size. Both renderers already consume every one of them by name (the glyph lookup, sizeStyle, the cn() class list, sizeClasses). Nothing they declare needs to reach the element through a spread, so nothing legitimate is withheld and no third declaration is warranted.

The half a leak gate cannot see — which on an SVG host is most of it

This is the part worth reviewing. A leak gate reports attributes that ARRIVE illegitimately; it has no case for one that STOPS arriving. On an SVG host @object-ui/test-support's judge counts stroke, width, height, fill and color as legitimate, so everything lucide emits sits in the half the gate never reports, in either direction. Three real behaviours lived in that blind spot. All three were read off the DOM directly, and all three are now pinned by full-attribute-set assertions in the new probe:

  1. ui:spinner did not spin. className is on the SDUI pass-through list, so it stayed in the prop bag and overrode the computed class that followed it: a ui:spinner rendered through SchemaRenderer carried class="lucide lucide-loader-circle" and neither animate-spin nor its size class. Filtering the spread does not fix this — the key survives the filter — so it is destructured and MERGED here, the way the sibling basic/icon.tsx in this same group already did it and the way the migration's worked example layout/grid.tsx ([finding] grid renderer 把 schema 键原样漏成 DOM 属性(columns="[object Object]"、mdcolumns="2" 等无效 HTML 属性) #4787 / PR fix(components): whitelist ui:grid's DOM passthrough so schema keys stop leaking as attributes #5573) does by ordering. Named here rather than ridden along: it is the other half of the harm of the same bare spread, on the same line, and routing the spread without it would leave the filter forwarding a key that destroys a legitimate computed value.
  2. A sized ui:spinner emitted invalid dimensions. size is an enum (sm/md/lg/xl) consumed through sizeClasses; the spread also handed the string to lucide's numeric size prop, so every sized spinner carried width="lg" height="lg".
  3. An icon's color produced an invalid paint value. IconSchema.color declares a Tailwind CLASS ("Color Class") and cn() applies it. The spread also reached lucide's color prop, emitting stroke="text-red-500" beside the class doing the real work. All three color values authored in the catalog are classes, so nothing depended on the raw-CSS-colour accident; an authored raw colour no longer tints the glyph through it, which is the contract-first direction (AGENTS.md #0.1).

Evidence

"The tests are green" is not evidence on this card, and this run re-confirms why: packages/components' full 2155 tests are green in BOTH ablation directions — no existing test asserted any of these attributes, nor noticed that the spinner was not spinning.

Catalog-scale DOM measurement, new probe examples/schema-catalog/test/svg-host-dom-leak-5632.test.tsx, through the real SchemaRenderer:

  • icon: 71 nodes, 71 illegitimate attributes before, 0 after (icon[icon], the declared glyph key the renderer consumes and forwarded as well).
  • spinner: 6 nodes, 0 before and after at catalog scale — the catalog authors no undeclared keys on them, so the sweep's canary node is what covers this member. Said plainly rather than presented as a result.
  • Control ui:grid: 26 nodes, 0 in both runs, in the same run as icon's 71.
  • Node census asserted per type and read IDENTICAL across both runs (71 / 6 / 26, noElement 0 everywhere), so the after-zero is a reading and not a walk that stopped finding nodes — fix(components): route flex/stack/container/text through toDomProps (#5574) #5839's guard. Each node renders with children/body removed, so the control is not a mixture of other groups.
  • Judge self-checked for element-awareness, in the direction this group needs: the same bag reports ['label','zzcanary'] on an svg host and ['color','label','width','zzcanary'] on a div host. A judge that allowed color/width everywhere — or that lowercased SVG names — would pass everything here while seeing none of this group.

Two-way expiry observed. With the renderers fixed and the rows still present, the sweep failed on EXACTLY the two group members and no others: 2 failed | 200 passed, direction expected [] to deeply equal [ 'ariaDescribedBy', …(13) ]. The rows were then DELETED — not edited, no it.skip, no exemption — and the gate is green at 202 passed.

Reverse-verification on commit 5d023aaa2, reverting ONLY the two renderer sources to 3e01cb55f. Predicted before running; observed as predicted. Mutation proven ON DISK in both directions, not by an editor exit code: blob hashes moved to exactly the origin/main blobs, injected anchors toDomProps(iconProps)/toDomProps(spinnerProps) 2/1 to 0/0 and the deleted bare spreads counted back in at 2/1. Observed 4 failed | 201 passed: the two sweep targets (ui:icon leaked 14 non-DOM attribute(s), same for ui:spinner) plus both probe readings (expected [ …(71) ] to deeply equal [], and the legitimate-set pin at 12 attributes vs 11). The census did NOT move under mutation, so the reds are leaks and not a broken walk. Restore proven BY STATE — git diff HEAD empty, git status clean, worktree blobs byte-equal to the HEAD blobs — never by an exit code; the script carries trap on EXIT/INT/TERM with absolute paths.

Legs that do NOT discriminate, named so the discriminating ones mean something: the judge element-awareness self-check (green both legs — it renders raw markup, no renderer in the path); the ui:grid control (0 both legs by construction); the node census (identical both legs — it discriminates a broken walk, never the fix); and packages/components' 2155 tests (green both legs, which is the finding above rather than a reassurance).

Verification, and every narrowing declared

All vitest runs from the repo root; no pnpm --filter for vitest and no run from a package cwd (the #3378 guard). Union re-run at the final commit 5d023aaa2.

  • pnpm exec vitest run packages/app-shell/src/__tests__ packages/fields/src/__tests__/widget-dom-leak-e2e.test.tsx examples/schema-catalog/testTest Files 33 passed (33) / Tests 2536 passed (2536).
  • pnpm exec vitest run packages/componentsTest Files 230 passed (230) / Tests 2155 passed (2155).
  • pnpm --filter @object-ui/components --filter @object-ui/app-shell type-check — both Done. --listFiles confirms the edited sweep test is really in the tsconfig.test.json program (1 hit), so "type-check clean" actually covers it.
  • pnpm --filter @object-ui/example-schema-catalog type-check — clean, and --listFiles confirms the new probe is in that program (1 hit). It first reported five TS2882 errors in files this PR does not touch; those were an unbuilt dependency closure and cleared after pnpm --filter '@object-ui/example-schema-catalog^...' build, which reads exactly like a real break.
  • pnpm exec eslint . --no-inline-config -f json — the FULL repo, not a narrowing: 4264 files linted (population read from eslint's own config, count read from the JSON output), 0 errors in all four files this PR touches. The repo carries 93 pre-existing errors across 77 other files on this tree; none is a file this PR touches.
  • node scripts/check-changeset-presence.mjs3 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s).
  • check:control-bytes OK (6224 tracked text files) · check:icon-record-names OK (182 names, and this PR touches icon.tsx) · check:self-import OK · check:phantom-deps OK · check:side-effects-array OK.
  • check:sdui-registration-pins NOT RUN, declared: it exits 2 with No console build to weigh at apps/console/dist/assets — a prerequisite, not a failed measurement. It guards registrations being dropped by a wrong sideEffects array at bundle time; this PR changes no package.json, and check:side-effects-array (which reads that array directly) is green. CI owns the bundle-level run.

Exit codes were captured before any pipe, and every gate result above quotes the gate's own printed line rather than a bare $?.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC


Generated by Claude Code

…mProps`

`ui:icon` and `ui:spinner` forwarded their whole prop bag to the SVG they
render, so every authored SDUI key on the node became an attribute — the
`BARE_SPREAD_ON_SVG` shape of objectui#5574, 14 per target, plus `icon="check"`
on all 71 icon nodes in the schema catalog.

`IconSchema` and `SpinnerSchema` declare only `icon` / `size` / `color`, and
both renderers already consume all three by name, so the element-agnostic SDUI
pass-through list withholds nothing they need. That is why this group takes the
bare `toDomProps` rather than the third declaration the form-control group
needed for `name` and `disabled`.

Two behaviours change that the sweep gate structurally cannot see, because its
judge counts `stroke` / `width` / `height` as legitimate on an SVG host:

- `ui:spinner` now spins. Its computed class (`animate-spin` plus the size
  class) was being overwritten by the `className` carried in the spread.
- A sized `ui:spinner` no longer emits `width="lg" height="lg"`: `size` is an
  enum and the spread handed the string to lucide's numeric `size` prop.

An icon's `color` is a Tailwind class, as `IconSchema.color` declares and as
every authored value in the catalog uses; it also reached lucide's `color` prop
and emitted an invalid `stroke="text-red-500"`. Only the class path remains.

Both ledger rows are DELETED in this change, as the two-way exact-set assertion
requires — 97 targets in six shapes to 95 in five.

Part of #5632

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3182.7 KB 3191.4 KB
Main entry chunk (gzip) 143.2 KB 350 KB
Entry file index-BISou9x1.js
Status PASS

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 15.67KB 5.75KB
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) 5.13KB 2.35KB
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) 516.21KB 117.82KB
core (index.js) 6.12KB 2.42KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 180.00KB 50.20KB
fields (index.js) 242.40KB 61.26KB
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) 4.28KB 1.75KB
i18n (index.js) 3.65KB 1.47KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
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.98KB 10.98KB
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.55KB 0.62KB
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 (useResponsiveConfig.js) 1.37KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
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) 5.12KB 1.74KB
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) 15.75KB 3.80KB
plugin-calendar (index.js) 48.15KB 13.35KB
plugin-charts (index.js) 70.92KB 19.75KB
plugin-chatbot (index.js) 196.19KB 46.43KB
plugin-dashboard (index.js) 132.89KB 34.68KB
plugin-designer (index.js) 212.87KB 43.19KB
plugin-detail (index.js) 250.93KB 64.09KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 132.87KB 32.66KB
plugin-gantt (index.js) 167.44KB 41.05KB
plugin-grid (index.js) 209.25KB 56.71KB
plugin-kanban (index.js) 52.71KB 14.55KB
plugin-list (index.js) 113.28KB 27.59KB
plugin-map (index.js) 20.55KB 6.80KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 43.57KB 11.96KB
plugin-timeline (index.js) 30.84KB 8.85KB
plugin-tree (index.js) 9.38KB 3.22KB
plugin-view (index.js) 85.24KB 20.94KB
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) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
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 (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) 4.58KB 2.23KB
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 (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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants