Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[compiler] A valueless `prop:` attribute is dropped silently by both compilers

Chiusa
#4,180 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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:x as prop:x={true}, consistent with plain attributes; or
  • make it a compile error ("prop:x needs 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di solidjs/solid

Tutte le issue di solidjs/solid

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.