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

div 的废弃警告会对 kind: 'html' tier 自己解析出的节点开火 —— 作者无法消除,且意味着 div 结构上退不掉 #4000

Closed

Description

@yinlianghui

发现于 #3965 的实施(PR #3998),不在该 PR 处理 —— 那一单改的是警告的去重和 catalog 内容,这一条是废弃本身的作用域问题。

现象

kind: 'html' 作者面(ADR-0080)把 JSX 标签名原样当成组件 type:

  • packages/sdui-parser/src/parse.ts:85 —— const node: SchemaElement = { type: tag, ...props }
  • packages/sdui-parser/src/index.ts:33 —— const allowedTags = new Set(Object.keys(manifest.components))
  • packages/components/src/renderers/layout/page.tsx:438-470 —— 白名单来自 ComponentRegistry.getKnownTypes(),裸 div 在内(所以 div 标签是合法的)
  • packages/components/src/renderers/basic/html-elements.tsx:15,36 —— 该模块的 TAGS 列表故意排除 div,注释写明「div / span / table / code / label 和语义分节标签已在别处注册」

于是一个 kind: 'html' 页面里写一个 div 标签 —— 完全合法、有意支持的写法 —— 编译出的就是 { "type": "div" },落到 basic/div.tsx 的废弃渲染器上,dev 构建下报一条「The div component is deprecated, use card / flex / container / stack / grid instead」。

作者对此无能为力:那几个替代类型没有一个是 html tier 里能写的等价标签,而且这条建议本身是给 JSON 作者面的。同族的 span 同理(basic/span.tsx)。

为什么归为 observation-class

参考位置

关联:#3965 / PR #3998(发现于此)

Activity

  1. os-zhuang commented on Aug 10, 2026

    @os-zhuang
    Contributor

    Finding-triage ruling: Escalate — finding to needs-user-decision.

    The div deprecation warning fires on nodes the kind:'html' tier's own parser produces (div.tsx warnDeprecatedOnce; html-elements.tsx deliberately excludes div; parse.ts maps the tag straight through), so authors cannot silence it and div is structurally unretirable — the warning's promise is false either way. This blocks the first half of #3965, and three candidate directions are documented in PR #3998.

    Question for the maintainer: which deprecation contract should div have — narrow the warning to authored nodes, bless div as permanent vocabulary, or actually retire it?

    Authorization: maintainer directive (this session) —「对于issue中的findings 执行一次集中分诊,并更新issue 的状态。」Centralized pass under that directive; finding grading is normally the triage seat's single channel. Round: objectstack#4949 finding-triage, 2026-08-10.
    Session: 01JaVVMrSxt7Tgi1uwEuDtH7


    Generated by Claude Code

  2. os-zhuang commented on Aug 10, 2026

    @os-zhuang
    Contributor

    Maintainer ruling (2026-08-10, directed in session session_01BPWqbmEFU8gJepBJTHESXd): split the warning by provenance.

    The deprecation warning exempts nodes emitted by the kind: 'html' tier's own parser (internal provenance the author cannot spell differently), and keeps firing for authored div. This makes the warning actionable again and unblocks the retirement path structurally. objectui#3965's example sweep is ordered after this lands.

    needs-user-decision → pm:queue.


    Generated by Claude Code

  3. self-assigned this
    on Aug 17, 2026
  4. yinlianghui commented on Aug 17, 2026

    @yinlianghui
    ContributorAuthor

    认领(objectui 车道分片 PM,会话 session_01GTRjn8xBqp75dk7kFupVRt,批次 17):branch claude/issue-4000-div-warning-provenance。

    按 2026-08-10 维护者裁定实施:废弃警告按 provenance 拆分 —— kind: 'html' tier 解析器自产节点(作者无法换拼写的内部来源)豁免,作者手写 div 继续告警;#3965 的示例清扫排在本卡落地之后。文件面:div 组件的 warnDeprecatedOnce 路径、html tier 解析(parse.ts / html-elements.tsx)的 provenance 标记。


    Generated by Claude Code

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions