fix(core): type slot render payloads

Tighten typed Slot::render and KeyedSlot append/prepend/replace helpers so callers pass the generated slot payload type, keeping explicit html/text escape hatches for deliberate conversions.

req: codegen/002

req: typed_id/001
This commit is contained in:
slhx agent
2026-05-26 00:12:45 +02:00
parent 5364135c5e
commit 814be5922a
3 changed files with 22 additions and 9 deletions
+5 -4
View File
@@ -11,9 +11,9 @@ fn effect_batch_wire_round_trips() {
let user = Atom::<String>::new(3);
let batch = (
count.text(2),
todos.append(7, "Buy milk"),
todos.replace(7, "Buy oat milk"),
count.render(2),
todos.append(7, String::from("Buy milk")),
todos.replace(7, String::from("Buy oat milk")),
user.set("Ada"),
navigate("/todos"),
event("toast", "Saved"),
@@ -31,7 +31,8 @@ fn effect_batch_wire_round_trips() {
#[test]
fn keyed_slot_replace_uses_scoped_resource_ref() {
let todos = KeyedSlot::<u64, String>::new(9);
let effect = todos.replace(12, "done");
// req: codegen/002
let effect = todos.replace(12, String::from("done"));
let Effect::Put { target, payload } = effect else {
panic!("expected Put");