Summary
When a boolean attribute (prefixed with ?) has a non-handlebars value (e.g., ?disabled="true", ?disabled="Hello {{name}}"), the Rust parser silently drops the attribute with no output and no error/warning. The template author gets no feedback that their attribute was ignored.
Current behavior
- <button ?disabled="true">Click renders Click (attribute silently lost)
- <input ?checked="Hello {{name}}"> renders (attribute silently lost)
- No warning or error is reported to the caller
Code path: process_boolean_attribute in crates/webui-parser/src/lib.rs returns Ok(false) when parse_boolean_condition returns None, and the caller in process_tag_attributes simply skips the attribute.
Expected behavior
The parser should report a warning/diagnostic when a boolean attribute has an invalid value (non-handlebars expression). This matches the Edge JS implementation which logs console.error("[btr] boolean attribute must only contain a value in handlebars") and continues parsing.
Proposed approach
- Add a ParserWarning enum to the parser crate
- Add a warnings: Vec field to HtmlParser
- Push a warning in process_boolean_attribute when the value is not a valid handlebars expression
- Thread warnings through BuildResult JsBuildResult (NAPI) and CLI stderr output so consumers can see them
- Expose warnings via FFI accessor for C ABI consumers
References
- Rust parser: crates/webui-parser/src/lib.rs (lines ~1118-1130)
- Edge JS equivalent: �dge_webui/packages/build/src/btr/generator.js (lines ~447-465)
- Existing tests that assert the silent drop: lib.rs lines ~2556-2582
Summary
When a boolean attribute (prefixed with ?) has a non-handlebars value (e.g., ?disabled="true", ?disabled="Hello {{name}}"), the Rust parser silently drops the attribute with no output and no error/warning. The template author gets no feedback that their attribute was ignored.
Current behavior
Code path: process_boolean_attribute in crates/webui-parser/src/lib.rs returns Ok(false) when parse_boolean_condition returns None, and the caller in process_tag_attributes simply skips the attribute.
Expected behavior
The parser should report a warning/diagnostic when a boolean attribute has an invalid value (non-handlebars expression). This matches the Edge JS implementation which logs console.error("[btr] boolean attribute must only contain a value in handlebars") and continues parsing.
Proposed approach
References