test(components): assert the deprecation notice and deprecated.replacement name the same alternatives - #6867
Merged
Conversation
…cement` agree Since #6674 a deprecated type states its migration guidance twice — the console notice string literal in the renderer, and the machine-readable `deprecated.replacement` on its registration, transcribed from the notice by hand. Nothing held them together, so a reword of either left the other stale, and the stale copy is the one an automated gate reads and repeats to authors. Unlike the type-level cases of this class there is no `tsc` to notice. One case per renderer extracts the double-quoted type names from each side — the notice's guidance bullets, and the declaration's replacement line — and asserts set equality. No guidance text is restated in the test: a third copy of the sentence is the defect one layer up. The four byte-for-byte pins from #4000 are untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013hfmP9hoMd3dJwTh85J4yB
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-sam
marked this pull request as ready for review
August 30, 2026 07:52
This was referenced Aug 30, 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 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 #6823
Since #6674 a deprecated type states its migration guidance twice — the console notice string literal in the renderer, and the machine-readable
deprecated.replacementon the same file's registration, transcribed from the notice by hand. Nothing held them together, so a reword of either left the other stale, and the stale one is the copy an automated gate reads and repeats to authors. Unlike the type-level executions of this class (#4580 / #6067 / #5671 / #5893) there is notscto notice one string literal drifting from another.Shape: (a) assert the agreement — triage's ruling, not re-litigated
Triage ruled (2026-08-29) for the assertion over converging the two texts, and this PR does exactly that. The notice wording is pinned byte-for-byte by four existing tests, and those pins are themselves #4000's ruling that the guidance is "byte-for-byte what it was" — converging would trade one ruled invariant for another. No pin is touched; all four are green in the run below.
The stop condition in the triage comment did not trigger: the assertion restates no guidance text at all, so it never became a third copy of the sentence.
What the assertion actually compares
packages/components/src/__tests__/deprecation-guidance-agreement.test.tsx, one case per renderer (div,span):Two deliberate boundaries:
surfaces/ theisHtmlTierNodeexemption) is finding(registry): component deprecation is not declared anywhere machine-readable — the only statements of it are a console.warn literal and a human label, so no gate can ask "is this type deprecated?" #6674's, already pinned to itself in the two provenance tests, and out of scope per the card. Reading past the bullets is how this file would acquire a coupling to text that is not its business — so it mechanically cannot.Three control assertions keep the comparison from passing while measuring nothing: exactly one notice was emitted, the notice really carries bullet guidance, and the declaration's extracted name set is non-empty (an empty-vs-empty equality would otherwise be green while saying nothing).
Verification — all at
accc457, on a clean treeRe-derived on the shipped tree, not the card's branch. The card was measured on
claude/issue-6674-registry-deprecation-declaration@eb852a052; base here isorigin/main@30266cf9a, with #6822 / #6834 / #6841 / #6851 all landed. The symbols and paths the card names are unchanged, and the two statements still agree — the new cases are green on arrival, which is why the ablation below is the load-bearing evidence rather than the green.Ablation — the drift protection is real. Three legs, each mutated on disk with the anchor's occurrence count checked (
injected-count=1 removed-count=0; a zero-hit edit would have reported a no-op instead of a pass), restored from atrapon EXIT/INT/TERM with absolute paths, and each restore proven by comparing the file'sgit hash-objectagainst its HEAD blob plus an emptygit diff HEAD:divdeclaration renames one alternative ("grid"indeprecated.replacement)1 failed | 1 passeddivnotice renames the same alternative in its guidance bullet1 failed | 1 passedspandeclaration renames one alternative ("badge")1 failed | 1 passed2 passedEvery leg failed on the intended line (the set-equality assertion), and in each the other renderer's case stayed green, so attribution is exact. No rebuild leg is needed and none is claimed: the root vitest config aliases
@object-ui/*to each package'ssrc/, and the test imports the renderers relatively (../renderers), so nothing in these runs resolves throughdist/.Suites and gates (exit codes captured before any pipe; verdicts quoted from each gate's own output):
pnpm exec vitest run packages/components/ --maxWorkers=2— 216 files / 1995 tests passed, which is every*.test.ts(x)in the package (216 by count) and includes all fourdiv的废弃警告会对kind: 'html'tier 自己解析出的节点开火 —— 作者无法消除,且意味着div结构上退不掉 #4000 pins.pnpm --filter @object-ui/components run type-check(tsc --noEmit && tsc -p tsconfig.test.json) — exit 0.--listFilesconfirms the new file is a program input, so this covers it rather than merely passing beside it.node scripts/check-changeset-presence.mjs— "Every one of them has an EMPTY frontmatter — declared as releasing nothing, which is the explicit exemption and a complete answer to this gate."node scripts/check-changeset-fixed.mjs,node scripts/check-changeset-no-major.mjs,node scripts/check-control-bytes.mjs,node scripts/check-vi-mock-specifiers.mjs— all exit 0 on their own verdict lines.Lint, and the narrowing declared.
pnpm exec eslint . --format jsonfrompackages/components— 433 files, 0 errors, 934 warnings, the package's standing baseline; the new file contributes 0 of each. This is the whole eslint surface the diff can affect, on three pieces of evidence: the population comes from eslint's own config resolution rather than a guess about which files count; the file count is read from the--format jsonoutput; andeslint.config.jsdeclares noparserOptions.project/projectService, so type-aware linting is off and a new file cannot move any untouched file's verdict. The repo-wideturbo run lintis CI's run.Release
Test-only, no published behaviour changes:
.changeset/6823-deprecation-guidance-agreement.mdcarries an empty frontmatter, the exemptioncheck-changeset-presencenames explicitly. Noskip-changesetlabel — in this repo that label is read by nothing.Session: https://claude.ai/code/session_013hfmP9hoMd3dJwTh85J4yB
Generated by Claude Code
Generated by Claude Code