This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(components): name box in the div deprecation guidance, on all four surfaces - #8622
Merged
Merged
Conversation
…our surfaces The `div` migration guidance recommended `card` / `flex` / `container` / `stack` / `grid` for the plain-wrapper case. Measured through the real `SchemaRenderer` on a node carrying an authored `className`, every one of those changes the rendered result — each injects classes of its own, `card` also moves the children into an extra `CardContent` element, and four of the five read `children` only, so a node authoring `body` loses its content silently at an unchanged element count. `box` (objectui#3965) is the one class-transparent swap and the guidance never named it. Deprecation guidance is followed literally, so the old text manufactured exactly the conversions objectui#3965 measured and rejected. All four surfaces move together: the console notice, the machine-readable `deprecated.replacement`, `content/docs/components/basic/div.mdx`, and the `components-basic-div` catalog category (a new `use-box-instead` fixture, the div -> box before/after the migration guide was missing). `box` is not unconditionally drop-in either — it too reads `children` only — and the new text says so rather than selling it as one. objectui#4000 recorded this wording as byte-for-byte invariant; that is re-ruled here deliberately, and the two pins holding those bytes move with it. `div-guidance-names-box.test.tsx` pins the guidance against the MEASUREMENT rather than against a name: the drop-in set is measured through the renderers, the plain-wrapper bullet must offer exactly that set, all four surfaces must offer the same alternatives, the retired sentences must be absent, and span's guidance must not have been swept in. `span` is untouched: `box` is block-level and the inline replacement story did not change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
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
|
os-justin
marked this pull request as ready for review
September 8, 2026 17:44
os-justin
enabled auto-merge
September 8, 2026 17:45
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 8, 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 free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #6877
The judged call, stated first
objectui#4000 recorded the
divmigration guidance as "byte-for-byte what it was". This PR re-rules that wording deliberately. The pin was right while the guidance was merely incomplete; it became false whenboxlanded (objectui#3965 / PR #6878), because every replacement the old text named is measured non-drop-in and the one that is drop-in was never mentioned. The two pins that held those bytes (div-deprecation-provenance,div-deprecation-warn-once) move with the text, and their comments now record why.Re-verified the not-drop-in measurement before rewriting around it
Measured on this branch through the real
SchemaRenderer, one node carrying an authoredclassNameplus one text child.divis the baseline:bodydiv(baseline)boxcardrounded-lg border bg-card text-card-foreground shadow-smflexflex flex-row justify-start items-start gap-1.5 sm:gap-2containerw-full max-w-xl mx-auto p-2 sm:p-3 md:p-4stackflex flex-col justify-start items-stretch gap-1.5 sm:gap-2gridgrid grid-cols-2 gap-4So the card's premise holds in full: all five named replacements change the rendered result, and four of the five drop
bodycontent silently, at an unchanged element count.boxis the one class-transparent swap.boxis not unconditionally drop-in either — it also readschildrenonly. The new guidance says so instead of selling it as one. Trading one false recommendation for another would have been worse than leaving the old text alone.The four surfaces, moved in one stroke
packages/components/src/renderers/basic/div.tsx;deprecated.replacementon the same registration;content/docs/components/basic/div.mdx— callout, a new plain-wrapper migration section, and thebody-to-childrencaveat;components-basic-divcatalog category — a newuse-box-insteadfixture, the div-to-box before/after the guide was missing (index regenerated with the repo's own generator;NODE_CENSUSinlayout-dom-leak-5574updated for the 2 box + 2 text nodes it adds).All three prose surfaces now name
boxfirst for the mechanical swap, keepcard/flex/container/stack/gridfor the cases where their layout is actually wanted, and state thebodymove.The new pin answers the discriminating question
A pin asserting only "the notice mentions
box" passes on a notice that mentionsboxand still recommends every non-drop-in replacement unchanged. Sodiv-guidance-names-box.test.tsxpins the measurement and the agreement, never the presence of a word:box;box;Red-leg evidence (every mutation proved on disk by blob hash, every restore proved by an empty
git diff HEAD)expected [ 'card', 'flex', 'grid' ] to include 'box')boxbut keepcontainer/stack/gridin the wrapper bulletexpected [ 'box', 'container', 'grid', 'stack' ] to deeply equal [ 'box' ]); the four-surface case stays green, which is exactly why this case existsboxto both of span's statementsexpected [ 'badge', 'box', 'text' ] to deeply equal [ 'badge', 'text' ]); objectui#6823 GREEN and everytoContainpin on span's notice GREEN — only thetoEqualon span's declaration reddens, so the notice half of that sweep is covered here and nowhere elseexpected [] to have a length of 1, via its per-type header filter), and so does the new pin. Reporting this because the dispatch asked: #6823 does catch the constant-notice mutation.Verification
pnpm exec vitest run packages/components/— 245 files / 2260 tests passedpnpm exec vitest run examples/schema-catalog/— 30 files / 2146 passed after theNODE_CENSUSupdate (it was the one red, and it is catalog authoring, not a renderer change)pnpm exec vitest run scripts/__tests__/catalog-index-regenerable-4633.test.ts— 6 passed (the generated index really is regenerable from the schemas dir)pnpm --filter @object-ui/components type-check,pnpm --filter @object-ui/example-schema-catalog type-check— both exit 0 after building each dependency closure. Confirmed the new test is really in the program:tsc -p tsconfig.test.json --listFilesnames it.eslinton every changed file — 0 errors (2 pre-existing warnings indiv.tsx, untouched lines)node scripts/check-control-bytes.mjs— OK, plus a manual control-byte scan of the changed files: no hitsnode scripts/check-changeset-presence.mjs, verdict line quoted verbatim:✅ 3 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s): .changeset/6877-div-guidance-names-box.md.A real
patchon@object-ui/components, not an empty frontmatter — a published package's source moved.check-changeset-no-major.mjs:✅ No changeset declares a major bump.check:doc-typesOK (188 files, every documented type registered),check:doc-fencesOK,check:doc-example-readersOKcheck:doc-examplesexits 2 on an unbuilt tree with "run the build first" — recorded as NOT MEASURED, not as a redThe mdx change is not inside a
plaintextfence, so objectui#5250 does not apply to it — but neither does any existing gate verify it:check-doc-component-typesreads type string literals in code blocks and my edit adds none, andcheck-doc-snippet-typescompilests/tsxonly. What does verify it is the new pin, which readsdiv.mdxoff disk and holds its callout to the same alternative set as the notice and the declaration, and asserts the migration guide really references the new fixture id.Scope
spanuntouched — separate judgement,boxis block-level. Asserted, not assumed (case 5 + leg R5).packages/core/src/registry/__tests__/component-deprecation-declaration.test.tsalso contains the old sentence and is deliberately not touched: it is aDIV_LIKEfixture registered on a privateRegistryinstance to test the reader, not a surface ofdiv's deprecation. A find-and-replace would have swept it in.🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Generated by Claude Code