[compiler] A valueless `prop:` attribute is dropped silently by both compilers
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
调研方向
Read packages/compiler/src/dom/attrs.rs, especially classify_plan, and compare it with the Babel plugin's handling of valueless namespaced attributes. Reproduce with the JSX examples in the issue using generate: "dom"; determine the intended behavior for prop: and whether other namespaces share it. Done means both compilers consistently treat the bare attribute as true or report a compile error.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
A prop: attribute with no value (<el prop:active />) compiles to nothing: no property write and no warning. @solidjs/babel-plugin and @solidjs/compiler behave the same way.
This is deliberate. classify_plan in packages/compiler/src/dom/attrs.rs returns PlanDisposition::Skip for PlanValue::None on prop:, with the comment "Babel wraps valueless namespaced attributes into empty expression containers, which are then skipped." The Rust compiler's transform returns only { code, map }, so it has no way to report a diagnostic.
Your Example Website or App
Minimal repro inline below. Real-world occurrence: https://github.com/openclaw/openclaw/pull/169182
Steps to Reproduce the Bug or Issue
Compile with either compiler (generate: "dom"):
export const A = () => <x-term prop:active />;
export const B = () => <x-term prop:active={true} />;
export const C = () => <x-term active />;
Output (identical from both compilers, trimmed):
var _tmpl$ = _$template(`<x-term>`, 1),
_tmpl$2 = _$template(`<x-term active>`, 1);
export const A = () => (() => { var _el$ = _tmpl$(); /* nothing */ return _el$; })();
export const B = () => (() => { var _el$2 = _tmpl$(); _el$2.active = true; return _el$2; })();
export const C = () => (() => { var _el$3 = _tmpl$2(); return _el$3; })();
Expected behavior
In JSX, a bare attribute means true, and Solid follows that for plain attributes (C). Either:
- treat
prop:xasprop:x={true}, consistent with plain attributes; or - make it a compile error ("
prop:xneeds a value").
Either way, change both compilers together. The same question probably applies to other namespaced attributes that have no value.
Screenshots or Videos
No response
Platform
- OS: macOS (Darwin 25.5)
- Browser: n/a (reproduced in Node v24.18.0 with vitest, importing source)
- Version: solid
next@ b0ad1df50 (2026-10-20, after 2.0.0-rc.16)
Additional context
In OpenClaw's Solid 2 migration, a bare prop:active made the Control UI terminal side panel open blank. It also turned checks-ui-e2e red for every PR until it was found: https://github.com/openclaw/openclaw/pull/169182
- 主要语言
- TypeScript
- 星标
- 36.1k
- 派生
- 1.1k
- 平均合并
- 11 小时 17 分钟
- 30 天内合并 PR
- 371
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid 的其他 Issue
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14可能已有人在做 @itisrmk 于 4 天前认领。 未关闭1.x
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
[2.0] The MIGRATION.md replacement for `from()` keeps the upstream subscription after dispose; add a subscription helper可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
`createRoot`'s dispose function keeps `fn` alive, so `<For>`/`<Index>` rows retain removed list items可能已有人在做 @boombang 于 6 天前认领。 未关闭1.x
难度 4/5 1-2 天 新手友好度 45/100
维护者通常 1 天内回复
-
signals: a landing reveals a held write its stale reader re-derives onto a new flight (U-5, D-9)未关闭
难度 5/5 一周以上 新手友好度 12/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
phivk/rubiks-lab#33 ·
维护者通常 1 天内回复
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be edited可能已有人在做 @ManyaJain111 今天认领。 未关闭bug enhancement possible-duplicate
难度 2/5 1-3 小时 新手友好度 77/100
AOSSIE-Org/PictoPy#1637 · 4 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
chaitin/MonkeyCode#1437 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area:cards enhancement migration ready-for-agent
难度 2/5 1-3 小时 新手友好度 70/100
fil-donadoni/tolaria#6309 ·
维护者通常 1 天内回复