feat(runtime): lower generated runtime ids

req: wire/001

req: ts/001
This commit is contained in:
slhx agent
2026-05-10 23:04:45 +02:00
parent 9e0342951c
commit 79414fbb39
6 changed files with 208 additions and 22 deletions
+22
View File
@@ -40,6 +40,16 @@ fn runtime_exposes_page_swap_hooks() {
assert!(source.contains("location.href = href"));
}
#[test]
fn runtime_page_swaps_lowered_slot_ids() {
// req: wire/001
let source = slhx_js::RUNTIME_JS;
assert!(source.contains("function replaceLoweredSlots(scope, doc)"));
assert!(source.contains("doc.querySelectorAll(\"[data-sid], [data-slot-id]\")"));
assert!(source.contains("target.innerHTML = source.innerHTML"));
}
#[test]
fn runtime_keeps_form_field_targets_separate_from_error_targets() {
let source = slhx_js::RUNTIME_JS;
@@ -58,3 +68,15 @@ fn runtime_preflights_batches_before_applying_ops() {
assert!(source.contains("function canApplyOp(scope, op)"));
assert!(source.contains("for (const op of batch.ops) applyOp(scope, op)"));
}
#[test]
fn runtime_ships_typescript_definitions() {
let source = slhx_js::RUNTIME_D_TS;
assert!(source.contains("req: ts/001"));
assert!(source.contains("export interface EffectBatch"));
assert!(source.contains("fingerprint: bigint"));
assert!(source.contains("export type Effect ="));
assert!(source.contains("decodeBatch(buffer: ArrayBuffer): EffectBatch"));
assert!(source.contains("interface Window"));
}