Language:
- each item in list -> template (reactive list rendering)
- each/in tokens in lexer, Expr::Each in AST
- Reactive forEach codegen with scope push/pop
- Container trailing props: column [...] { variant: card }
CLI:
- dreamstack init [name] - scaffold new project
- Generates app.ds, components/, dreamstack.json
- 4 starter components (button, card, badge, input)
Registry expanded to 11 components:
- NEW: progress, alert, separator, toggle, avatar
- All embedded via include_str!
CSS: progress bar, avatar, separator, alert variants,
toggle switch, stat values (230+ lines design system)
Examples:
- each-demo.ds: list rendering demo
- dashboard.ds: glassmorphism cards with container variant
17 lines
391 B
Text
17 lines
391 B
Text
-- Each Loop Demo
|
|
-- Demonstrates list rendering with each ... in ... -> syntax
|
|
|
|
let todos = ["Buy groceries", "Write DreamStack docs", "Ship v1.0", "Deploy to prod"]
|
|
|
|
view main = column [
|
|
text "📋 Todo List" { variant: "title" }
|
|
text "4 items" { variant: "subtitle" }
|
|
|
|
each todo in todos ->
|
|
row [
|
|
text "•"
|
|
text todo
|
|
]
|
|
|
|
button "Done" { variant: "primary" }
|
|
]
|