feat(api): streamline generated app authoring
Move the canonical examples toward generated component-root helpers, typed form decoding, async/state handler registration, and derive-driven app/component registry wiring. Tighten requirements and diagnostics for the server-first, selectorless authoring path. Verified with cargo run -p slhx-xtask -- test, cargo check --workspace, redgate list, redgate refs, redgate health --strict, and git diff --check. req: canonical/001 req: canonical/003 req: canonical/004 req: dx/002 req: derive_app/001 req: component/003 req: form/004 req: axum_integration/003
This commit is contained in:
@@ -28,6 +28,16 @@ fn effect_batch_wire_round_trips() {
|
||||
assert!(decoded.is_compatible());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn optional_effects_compose_into_batches() {
|
||||
// req: component/005 req: public_api/003
|
||||
let count = Slot::<u32>::new(1);
|
||||
let batch = (Some(count.text(2)), Option::<Effect>::None).into_batch(BuildFingerprint(42));
|
||||
|
||||
assert_eq!(batch.ops.len(), 1);
|
||||
assert_eq!(batch.ops[0], count.text(2));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keyed_slot_replace_uses_scoped_resource_ref() {
|
||||
let todos = KeyedSlot::<u64, String>::new(9);
|
||||
@@ -142,7 +152,10 @@ fn generated_css_classes_join_for_hemplate_dynamic_class_attrs() {
|
||||
assert_eq!(classes.as_str(), "work-card is-selected");
|
||||
assert_eq!(classes.to_string(), "work-card is-selected");
|
||||
assert_eq!(CARD.with(SELECTED).as_str(), "work-card is-selected");
|
||||
assert_eq!(CARD.with_if(true, SELECTED).as_str(), "work-card is-selected");
|
||||
assert_eq!(
|
||||
CARD.with_if(true, SELECTED).as_str(),
|
||||
"work-card is-selected"
|
||||
);
|
||||
assert_eq!(CARD.with_if(false, SELECTED).as_str(), "work-card");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user