feat(build): emit checked component refs

Generate ComponentRef constants for component-scoped APIs, include global component refs only when global_exports(true) is enabled, and document/use the checked component token.

req: component/003
This commit is contained in:
slhx agent
2026-05-26 00:35:59 +02:00
parent a421865852
commit efabd3ff66
5 changed files with 73 additions and 6 deletions
+10 -2
View File
@@ -1,7 +1,7 @@
use slhx_core::{
event, navigate, redirect, replace, Atom, AtomSnapshot, AtomState, BuildFingerprint,
CssClass, CssClasses, Effect, EffectBatch, Form, Handle, IntoEffect, KeyedSlot, NavigateMode,
Payload, ResourceKind, SafeHtml, ScopeKey, Slot,
ComponentRef, CssClass, CssClasses, Effect, EffectBatch, Form, Handle, IntoEffect, KeyedSlot,
NavigateMode, 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 component_refs_format_generated_component_names() {
// req: component/003
let component = ComponentRef::new("todo_list");
assert_eq!(component.as_str(), "todo_list");
assert_eq!(component.to_string(), "todo_list");
}
#[test]
fn generated_handles_format_for_hemplate_dynamic_handle_attrs() {
// req: public_api/001 req: public_api/002