Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

docs(guide): remove the lazy-loading promise nothing keeps from the schema-rendering guide (objectui#9989) - #10086

Merged
os-tesla merged 1 commit into
mainfrom
claude/issue-9989-lazy-loading-tabs-example
Sep 20, 2026
Merged

os-tesla merged 1 commit into
mainfrom
claude/issue-9989-lazy-loading-tabs-example

Conversation

@os-tesla

Copy link
Copy Markdown
Collaborator

Fixes #9989

Clause-②: no — a documentation page. It moves no exported symbol and no key on a published payload.

One file: content/docs/guide/schema-rendering.md. Nothing outside content/docs/** is edited.

The card's one un-taken claim, re-taken here

The card relayed, without re-running it, that the published example is refused with invalid_type at path ["items"]. Re-measured first-hand against the BUILT TabsSchema (packages/types built in this worktree, imported through the package's own ./zod export condition, i.e. dist/zod/index.zod.js — the surface a reader imports), reading the fence out of the file in the same command that measured it:

FILE STATE (same command): content/docs/guide/schema-rendering.md
  sha256 = e726e2985330081c788a5e42ba387cefa4ce9305fbc0fdcedf0cdd8d6b19f8ab

--- STAGE 1: JSON.parse of the fence exactly as published
  JSON.parse: THROWS -> Expected property name or '}' in JSON at position 86 (line 5 column 35)
  CONTROL, same command: the same bytes with the two comment spans removed
  CONTROL JSON.parse: OK  <= so the comment IS the parse fault, not some other byte

--- STAGE 2: CARD-CLAIM re-take -- TabsSchema.safeParse(the node, comments removed)
  success = false
    issue: code=invalid_type path=["items"] message="Invalid input: expected array, received undefined" expected=array
  CONTROL, same command: the SAME node with `tabs` respelled `items` and each item given value/label/content
  CONTROL success = true  <= the instrument accepts a well-formed tabs node, so the refusal is about THIS node

⇒ The card's claim stands, verbatim. Two corrections to the reasoning around it, both first-hand:

  1. The node face does NOT strip. The card says "the face strips what it does not declare". TabsSchema extends BaseSchema, and BaseSchemaCore ends .passthrough(), which .extend() carries through. Measured: a correct node plus lazyLoad plus tabs parses green and the surviving keys are ["type","defaultValue","items","lazyLoad","tabs"] — both undeclared keys survive. The strip is real one level down: TabItemSchema is a plain object, and {value,label,content,title,body} comes back as ["value","label","content"]. The empty-tab-bar outcome the card predicts is right; it arrives because items is absent, not because anything was stripped off the node.
  2. The card's three-row key table is not sufficient on its own. Applying it literally — title to label, body to content — still fails, because TabItemSchema requires value too: invalid_type@["items",0,"value"] and ["items",1,"value"], plus invalid_union@[…,"content"] for a content that is not a node. Adding value turns it green. The doc now teaches all three required item keys.

Which route I took on the lazyLoad promise, and the measurement that decided it

Route taken: nothing lazy-loads tab bodies ⇒ the promise is removed, not respelled. The sentence "Large schemas are automatically optimized:" and its example are gone. Four readings, each with a same-subject control in the same command:

measurement reading control, same command
schemas in the built zod barrel declaring lazyLoad 0 defaultValue on 17 of them
reads of .lazyLoad anywhere in the repository 2, both inside usePerformance.ts itself (the defaulting expression and the memo dependency) debounceMs is also lifted into a local and handed to setTimeout — lazyLoad has no such line
the one caller, apps/console/src/components/PerformanceDashboard.tsx calls usePerformance() with no argument; reads lazyLoad 0 times and perf.config. 0 times it reads metrics 15 times, so the file does use the hook's result
the tabs renderer lazyLoad 0 lines, React.lazy 0, Suspense 0, usePerformance 0; schema.items mapped on 2 lines, unconditionally — triggers and panels defaultValue on 3 lines — the card's own control, a key this renderer really reads

⇒ lazyLoad is inert even on the surface it genuinely belongs to: usePerformance resolves it into the config object it returns and never branches on it, and no caller reads it back. And there is no lazy gate on the tabs path to point it at even if it were live. So correcting the keys while leaving the sentence would have been, in the card's words, the same defect with better spelling.

Whether a corrected tabs example belongs in its place — I kept one, deliberately. The harm this card names has two halves: a false promise, and four wrong key spellings sitting at a well-trafficked address. Deleting the block repairs the first and abandons the second. The replacement keeps a correct tabs node where the wrong one stood, labelled For reference rather than as an optimization, and states the two failure modes an author actually meets — measured, not asserted:

  • an item missing value, label or content is refused (invalid_type at that path — measured for all three);
  • an item that also carries title / body is accepted with those keys dropped, so the panel renders empty with nothing naming the cause;
  • on the node itself body and children are refused by name, by the ADR-0049 tombstones already in TabsSchema.

The section now points deferral work at Code Splitting, the mechanism further down the same page that does exist.

The invalid-JSON half, and why no gate caught it

The old fence was tagged json and carried a block comment, so a copy failed to parse before reaching the schema. After this change every one of the 13 json fences on this page parses, checked by JSON.parse in the same command that hashed the file, with a deliberately broken literal as the instrument control. The replacement node also safeParses green against the built TabsSchema, with the pre-fix node re-parsed by the same instrument as the negative control.

Why no gate caught it — measured, ⛔ not fixed here (out of scope by the dispatch order): no gate in this repository asserts that a json-tagged fence is valid JSON.

  • check:doc-snippets compiles ts / tsx / typescript only. Its own header: a json fence is never compiled against anything.
  • check:doc-fences asks whether a TypeScript body sits under a non-TypeScript fence. A JSON body under a json fence is exactly right by its classifier.
  • check:doc-types judges the type literal and, in its own words, deliberately not the snippet's other keys.
  • check:doc-expression-carriage is the only gate that reads json fence bodies — and it is report-only, and its tolerance list removes line and block comments and re-escapes raw newlines before parsing. So the two shapes that make a fence uncopyable are normalized away by design. It printed 225 json/jsonc fence(s), 225 parsed, 0 UNPARSED on this tree.

Population reading, taken here for the record: 22 of 199 json fences under content/docs are rejected by JSON.parse (control: the same parser rejects a trailing-comma literal, so the count is a reading). Several are deliberate — elision markers and // Bad: counter-examples — which is precisely why deciding the class is a triage call and not a drive-by widening of this PR. Reported for filing; #9941 is not addressed here either.

Verification

Gates re-run as the last action before the push, on the committed tree, git status --porcelain and git diff HEAD both empty at 847e4eea8:

gate exit
check:doc-types 0 — 227 docs, 1503 blocks, 1146 type literals
check:doc-fences 0
check:doc-example-ids 0 — 414 references resolve
check:doc-snippets 0 — a real verdict, not PRECONDITION NOT MET: the closure was built first (turbo run build $(node scripts/check-doc-snippet-types.mjs --build-filter) --concurrency=2, 35/35), then 672 of 672 blocks judged, 0 failed
check:doc-examples 0 — same built tree; had answered exit 2 before the build, recorded then as not-a-verdict
check:doc-example-readers 0
check:prompt-keys 0
docs:check-links 0
check:control-bytes 0 — 8116 tracked text files
check:spec-symbols 0 — reads every page under content/docs/**
check:new-line-citations 0
check:docs-route-closure 0
check:doc-expression-carriage 0 (report-only census)

Tests that read this page, run from the repo root: pnpm exec vitest run packages/components/src/__tests__/guide-schema-rendering-data-context-8021.test.tsx scripts/__tests__/check-doc-component-types.test.ts — 2 files, 132 tests passed.

Changeset: none owed, decided by running the gate rather than from memory. node scripts/check-changeset-presence.mjs — "1 file(s) changed, 0 of them published source of a package the release covers, 0 of them a manifest whose published contract moved … no changeset is owed."

Ablation, proving the link gate really judges the new in-page anchor (the Code Splitting reference is a new link, so its green needed to be a reading). Mutation and restore both proved by object hash against the HEAD blob, ⛔ never by an exit code, with the mutation script refusing on an anchor miss and restoring from a trap:

HEAD blob   = c79d152981943f7cb72d2d12160d31f973899c6e
on-disk pre = c79d152981943f7cb72d2d12160d31f973899c6e
MUTATE -> removed text grep -c = 0 · injected text grep -c = 1 · hash = 4ef714ff4394cccd1548e93b18d73be48cb8323d
  gate on MUTATED tree: exit 1
  "[anchor] content/docs/guide/schema-rendering.md:363 -> #no-such-heading-on-this-page"
RESTORE (git checkout HEAD -- ABSOLUTE_PATH)
  on-disk post-restore hash = c79d152981943f7cb72d2d12160d31f973899c6e  equals HEAD blob? YES
  injected grep -c = 0 · original grep -c = 1 · git diff HEAD empty? YES
  gate on RESTORED tree: exit 0

Repository-wide scans (pnpm lint, the full pnpm test) are CI's run, not owed here; this diff touches no JavaScript or TypeScript source.

Acceptance notes

Seen while measuring, ⛔ not filed and ⛔ not repaired here:

  • noted, not filed — the tabs renderer reads item.content with a tolerant fallback to a cast item.body. It is unreachable through the published face, which strips body off an item before the renderer sees it, so it only fires on a document that was never parsed. Successor who touches it: the next change to TabsSchema's item shape. Contract-first says a fix belongs on the producer side, ⛔ not in the consumer's fallback, and the producer here is already correct.
  • noted, not filed — the sibling Memoization subsection on this page asserts "the renderer automatically memoizes components". No measurement of that was taken in this act, in either direction; it is named so the next reader knows it is unmeasured rather than checked. Successor who touches it: whoever takes the json-fence class below, since it is the same page.

Generated by Claude Code

…chema-rendering guide

The Performance Optimization section taught a `tabs` node whose every key but
`type` was undeclared, under the sentence "Large schemas are automatically
optimized". Both halves were wrong, and the second decided the repair.

Measured against the BUILT `TabsSchema`, the published node is refused with
`invalid_type` at path `["items"]` — "expected array, received undefined" —
while a well-formed `tabs` node parses green through the same instrument. The
fence was also tagged `json` while containing a `/* … */` JavaScript comment,
so a reader hit a parse error before reaching the schema at all.

Whether anything lazy-loads tab bodies had never been measured. It does not:
`lazyLoad` is declared on zero of the schemas the `zod` entry point exports
(the same probe finds `defaultValue` on 17, so the zero is a reading). Its one
real home is `PerformanceConfig`, the argument type of `usePerformance`, where
it is resolved into the returned config and never branched on — its sibling
`debounceMs` is the contrast, lifted into a local and handed to `setTimeout` —
and no caller in the repository reads it back. The `tabs` renderer maps `items`
twice unconditionally, for the triggers and for the panels, and uses neither
`lazy` nor `Suspense`.

So the promise is removed rather than respelled: correcting the keys while
leaving the sentence would have been the same defect with better spelling. A
correct `tabs` node stays at the address the wrong one occupied, labelled as
reference rather than as an optimization, together with the two failure modes
an author actually meets — a missing `value` / `label` / `content` is refused,
a surviving `title` / `body` is silently dropped into an empty panel, and
`body` / `children` on the node are refused by name.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq
@github-actions

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 2 pending changeset(s) describe a file this change touches

Their bodies publish verbatim into the CHANGELOG at the next release, so this is a request to re-read them against your diff — addressed here because you are the one seat that can answer it without re-deriving anything.

⛔ Nothing here blocks, and nothing here is a verdict on your change. This gate exits 0, is not a required context, and judges name resolution, never meaning: it asked whether a pending body names a file you touched. "Is this sentence still true?" is the one question it will not answer, and the one you are being asked to answer.

.changeset/8284-content-channel-per-component.md

  • names content/docs/guide/schema-rendering.md → content/docs/guide/schema-rendering.md — edited by this change

    Migration. Nothing that renders today stops rendering: a document authoring the channel its renderer reads is unchanged, and a document authoring the other one rendered an empty element before and is now refused instead. The repo-wide census found five documents in this state — packages/react/README.md, content/docs/guide/expressions.md, two blocks in content/docs/guide/schema-rendering.md and packages/components/TESTING.md — every one of them a form or container authoring body; all five are corrected in this change. If your own metadata authors the refused channel on one of these twelve node types, the component was already drawing nothing there; rename the key to the one in the table.

.changeset/9308-data-root-unbound-from-adapter.md

  • names content/docs/guide/schema-rendering.md → content/docs/guide/schema-rendering.md — edited by this change

    The Data Context passages of content/docs/guide/schema-rendering.md and packages/react/README.md teach the scope channel accordingly.

Read the paragraph, not the line: both false halves of the objectui#8617 claim sat in one paragraph, and correcting either alone would have left it asserting the same wrong thing.

If a claim did go false, correct the body. That is precedented and prose-only, frontmatter untouched; check-changeset-overwrite.mjs will report the correction as its own case 2 ("correcting a declaration on purpose … legitimate"), which is the intended shape — one gate asks for the read, the other records the write.

Not covered, stated so nobody reads this as more: a born-false claim that spells no line address at all (objectui#9495 coordinated one by ORDINAL — "a grep finds that member first" — and deciding that means reading what the sentence means), a claim spelled as a symbol or a package rather than a backticked file name, and a file named ambiguously.

Compared the checked-out tree with 0c2eb5eee (merge-base with origin/main): 1 file(s) changed outside .changeset/, read against 1225 pending declaration(s) that publish a body (1787 pending in total). · run

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

Labels

None yet

Projects

None yet

2 participants