MoonBit Tutorial
Learn Luna's reactive primitives and server-side rendering with MoonBit.
What You'll Learn
| Section | Topic |
|---|---|
| Introduction | Basics, Signals, Effects, Memos |
| Reactivity | Batch updates, Untrack, Nested effects |
| Control Flow | Conditional rendering, Lists, Switch |
| Lifecycle | Mount, Cleanup |
| Islands | Server-side rendering for partial hydration |
Prerequisites
MoonBit basics (structs, functions, traits)
Understanding of reactive programming concepts
Tutorial Sections
Introduction
Basics - Your first Luna component
Signals - Reactive state
Effects - Side effects
Memos - Computed values
Reactivity
Batch Updates - Combine multiple updates
Untrack - Escape tracking
Nested Effects - Effect composition
Control Flow
Lifecycle
Islands Architecture
Islands Basics - Server-side island setup
Islands State - Passing state to client
Islands Triggers - Controlling hydration timing
Web Components - Shadow DOM islands
See Also
JavaScript Tutorial - Client-side hydration
MoonBit API Reference - API details