Menu

Why Luna?

Luna is not just another JavaScript framework. It's a fundamentally different approach to building web UIs, born from frustration with existing solutions.

The Problem with Existing Frameworks

  • React - Too large. The runtime overhead is unacceptable for performance-critical applications.

  • Qwik / Solid - Compile-time expansion gets in the way. The magic makes debugging harder.

  • No WebComponents-first framework - Existing frameworks treat Web Components as second-class citizens.

Luna addresses these gaps directly.

Design Philosophy

So Small That Compile-Time Optimization Is Unnecessary

FrameworkBundle Size
Luna~6.7 KB
Preact~20 KB
Solid~7 KB
Vue 3~33 KB
React~42 KB

Luna is intentionally minimal. When your framework is this small, you don't need sophisticated compile-time optimizations to achieve good performance. The overhead is already negligible.

WebComponents First (World's First SSR + Hydration)

Luna is the first framework to support WebComponents SSR + Hydration.

  • Native browser standards over framework abstractions

  • Shadow DOM for style encapsulation

  • Declarative Shadow DOM for server rendering

  • Islands that work with any framework

Runtime Performance That Matters

ScenarioLunaReact
100ร—100 DOM shooting game60 FPS12 FPS

Fine-grained reactivity without Virtual DOM diffing delivers 5x better performance in real-world scenarios.

Written in MoonBit

Luna is written in MoonBit - a language designed for cloud and edge computing.

AspectJavaScript FrameworksLuna (MoonBit)
Type SafetyRuntime errorsCompile-time errors
SSR PerformanceV8 overheadNative speed
Bundle SizeFramework + AppOptimized output
Dead CodeTree-shakingGuaranteed elimination

Fine-Grained Reactivity

Unlike Virtual DOM frameworks, Luna updates only what changed - at the DOM node level.

Virtual DOM: State โ†’ Create Tree โ†’ Diff โ†’ Patch (O(n))
Luna:        Signal โ†’ Direct DOM Update (O(1))

Islands + Fine-Grained

Luna combines Islands Architecture with fine-grained reactivity:

  • Partial hydration - Only interactive parts load JavaScript

  • Minimal runtime - ~3KB loader

  • Fast updates - Direct DOM manipulation within islands

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Your Application                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Sol SSG (SSG)          โ”‚  Sol (SSR Framework)                 โ”‚
โ”‚  Static docs sites    โ”‚  Full-stack apps with islands        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                       Luna (Core)                            โ”‚
โ”‚           Signals, Islands, Hydration, Components            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                      MoonBit / JavaScript                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜