fix(react-doctor): clear architecture structure warnings#344
Conversation
|
Preview ready · pr-344-ui-registry
Inspect
|
bntvllnt
left a comment
There was a problem hiding this comment.
Review — 1 blocking finding (REQUEST_CHANGES not submitted because GitHub blocks self-review verdicts)
BLOCKING
Verdict: request changes / not safe to merge yet.
- C1 —
BlogCardstill violates the repo component export contract.- Evidence:
packages/ui/src/components/blog-card/blog-card.tsx:93-95andapps/registry/registry/default/blog-card/blog-card.tsx:93-95now replace the alias with a wrapper function, but neither export isReact.forwardRef(...)and neither setsBlogCard.displayName. - Why it matters: this was the specific R9-class issue I needed to re-check.
docs/agents/RULES.mdR9 anddocs/agents/COMPONENTS.mdrequire every named component export to useforwardRefand setdisplayName; changing the alias to a plain wrapper keeps the named export outside that contract and drops ref passthrough for consumers using the legacy name. - Fix: implement
BlogCardas a realReact.forwardRefwrapper aroundContentCard, setBlogCard.displayName = "BlogCard", and keep the registry copy in sync with the package source.
- Evidence:
WARN
- Local registry touched-file lint currently fails on changed registry files (
apps/registry/lib/jsonld.ts,apps/registry/lib/stats.ts,apps/registry/types/registry.ts) after validation bootstrap. Some diagnostics appear to be broader existing lint/style debt, so I am not treating them as the primary blocker here, but the PR body should not imply all local validation was independently re-run by this reviewer.
VERIFIED CLEAN
- PR metadata is live and coherent: open, non-draft,
fix/269-architecture->main,Closes #269, 10 changed files matching the reviewed diff. - The react-doctor architecture target is green locally:
pnpm doctorexited 0. BlogCardno longer uses the previous direct alias (export const BlogCard = ContentCard), and both package source and registry copy match the same wrapper shape.- GitHub checks are green/neutral on the reviewed head: 12 passing checks plus the neutral superseded legacy preview check.
VALIDATION
- Reviewed head:
ee3d20e9bfc36849f0bcc8b47644bd6d3fb47a3a. - Ran:
git diff --check origin/main...HEAD— pass. - Ran:
pnpm doctor— pass. - Ran with temporary worktree
node_modulessymlinks from/home/ubuntu/ui:pnpm --filter @vllnt/ui test:once -- blog-card— pass. - Ran with the same validation bootstrap:
pnpm --filter @vllnt/ui exec eslint src/components/blog-card/blog-card.tsx src/components/blog-card/blog-card.test.tsx— pass. - Ran with the same validation bootstrap:
pnpm --filter @vllnt/ui-registry exec eslint lib/jsonld.ts lib/og-templates.ts lib/og.ts lib/schemas.ts lib/stats.ts types/registry.ts registry/default/blog-card/blog-card.tsx— fails on registry lint/style diagnostics; see warning above. - Not run locally: full
pnpm build/pnpm test:once; relied on current GitHub checks for full-suite signal.
|
|
||
| // Keep BlogCard as an alias for backward compatibility | ||
| export const BlogCard = ContentCard; | ||
| export function BlogCard(props: ContentCardProps) { |
There was a problem hiding this comment.
Blocking: this still does not resolve the R9 component-export contract. BlogCard is now a named wrapper component, but it is not React.forwardRef(...) and has no BlogCard.displayName. Please make the compatibility export a real forwardRef wrapper, set the displayName, and keep the registry copy in sync.
|
|
||
| // Keep BlogCard as an alias for backward compatibility | ||
| export const BlogCard = ContentCard; | ||
| export function BlogCard(props: ContentCardProps) { |
There was a problem hiding this comment.
Same blocker in the registry copy: the generated/example component still exports BlogCard as a plain function with no forwardRef or displayName. Once the package source is corrected, regenerate/sync this copy so consumers do not get a different contract.
Closes #269
Summary
Validation
Notes