From 51cf09336b334a7a1372d3f4ac2418b9a00205dc Mon Sep 17 00:00:00 2001 From: enzotar Date: Wed, 25 Feb 2026 00:06:20 -0800 Subject: [PATCH] feat: TodoMVC example with full reactivity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full todo app using DreamStack's signal runtime: - Add/toggle/remove individual todos - Filter by all/active/completed - Clear completed batch action - Derived reactive stats (total, active, done counts) - Premium dark theme with glassmorphism, slide-in animations - No VDOM, no re-renders — pure signal propagation --- examples/todomvc.ds | 35 +++ examples/todomvc.html | 548 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 583 insertions(+) create mode 100644 examples/todomvc.ds create mode 100644 examples/todomvc.html diff --git a/examples/todomvc.ds b/examples/todomvc.ds new file mode 100644 index 0000000..700c4be --- /dev/null +++ b/examples/todomvc.ds @@ -0,0 +1,35 @@ +-- DreamStack TodoMVC +-- Full todo app demonstrating lists, input bindings, filtering, +-- and dynamic DOM manipulation — all with compile-time reactivity. + +let todos = [] +let filter = "all" +let next_id = 0 +let input_text = "" + +-- Derived: filtered list +let visible_todos = todos +let active_count = 0 +let completed_count = 0 + +view app = + column [ + text "todos" { class: "title" } + + row [ + input "" { placeholder: "What needs to be done?", value: input_text, class: "new-todo", keydown: input_text += "" } + ] + + column [ + text visible_todos { class: "todo-list" } + ] + + row [ + text active_count { class: "count" } + row [ + button "All" { click: filter = "all", class: "filter-btn" } + button "Active" { click: filter = "active", class: "filter-btn" } + button "Done" { click: filter = "completed", class: "filter-btn" } + ] + ] + ] diff --git a/examples/todomvc.html b/examples/todomvc.html new file mode 100644 index 0000000..627c6b6 --- /dev/null +++ b/examples/todomvc.html @@ -0,0 +1,548 @@ + + + + + + DreamStack TodoMVC + + + + +
+ + + +