[compiler] A valueless `prop:` attribute is dropped silently by both compilers
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 36.2k
- Fork
- 1.1k
- Merge medio
- 10h 34m
- PR unite (30g)
- 364
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di solidjs/solid
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Forse già presa @itisrmk l’ha presa 6 giorni fa. Aperta1.x
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
[2.0] Event handlers fired synchronously from an effect (focus(), showModal()) inherit the effect's strict-read windowForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
`createRoot`'s dispose function keeps `fn` alive, so `<For>`/`<Index>` rows retain removed list itemsForse già presa @boombang l’ha presa 8 giorni fa. Aperta1.x
Difficoltà 4/5 1-2 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
source-cooperative/docs.source.coop#41 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Nimblesite/SharpLsp#468 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
solidjs-community/solid-primitives#1082 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno