Skip to content

finding(types): two competing SchemaNode declarations — core's interface vs types' union #4580

Description

@yinlianghui

Filed by the PM from PR #4578's accepted report (the dev's ready text, per the #4548 ruling's after-landing sequencing).

packages/core/src/types/index.ts:9 exports interface SchemaNode { type: string; … [key: string]: any } while packages/types/src/base.ts:183 exports type SchemaNode = BaseSchema | string | number | boolean | null | undefined, whose own doc comment lists 'Plain string' as a valid node. Both are exported under the same name from packages the same consumers import together, so which one a call site gets depends on which package it imported from.

Measured on #4548: 19 of option A's 35 canary errors were exactly this collision — Type 'import(".../packages/types/dist/base").SchemaNode' is not assignable to type 'import(".../packages/core/dist/types/index").SchemaNode'. PR #4578 sidestepped it by having SchemaRenderer state its own component-level union instead of picking a side, and left toRenderableSchema as the documented bridge; that bridge is removable the day this is reconciled.

Observation-class for triage. Refs #4548, PR #4578.


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions