feat(build): emit checked param tokens

Generate ParamName constants for handle data parameters so public code can refer to checked param metadata instead of stringly typed names.

req: codegen/003
This commit is contained in:
slhx agent
2026-05-26 01:28:51 +02:00
parent 280464017b
commit ba3f40a3f0
4 changed files with 57 additions and 2 deletions
+9 -1
View File
@@ -1,7 +1,7 @@
use slhx_core::{
event, navigate, redirect, replace, Atom, AtomSnapshot, AtomState, BuildFingerprint,
ComponentRef, CssClass, CssClasses, Effect, EffectBatch, Form, Handle, IntoEffect, KeyedSlot,
NavigateMode, Payload, ResourceKind, SafeHtml, ScopeKey, Slot,
NavigateMode, ParamName, Payload, ResourceKind, SafeHtml, ScopeKey, Slot,
};
#[test]
@@ -93,6 +93,14 @@ fn slot_html_requires_explicit_safe_html() {
assert_eq!(payload, Payload::Html(String::from("<strong>ok</strong>")));
}
#[test]
fn param_names_format_generated_param_names() {
// req: codegen/003
let param = ParamName::new("todo_id");
assert_eq!(param.as_str(), "todo_id");
assert_eq!(param.to_string(), "todo_id");
}
#[test]
fn component_refs_format_generated_component_names() {
// req: component/003