hypen-server
Rust server SDK for building Hypen applications.
Hypen is a declarative UI language and reactive runtime for building cross-platform applications. This SDK provides a type-safe, idiomatic Rust API for defining stateful modules, handling actions, managing routing, and discovering components.
Quick Start
use *;
use ;
let module = new
.state
.ui
.
.
.build;
Action Handling
Actions always take a type parameter for the payload and a string name. Use () for actions with no payload.
// No payload
.
// Typed payload (just needs #[derive(Deserialize)])
.
// Raw JSON access
.
Routing
let app = builder
.route
.route
.components_dir
.build;
app.navigate;
Features
- Typed state with automatic JSON diffing and path-based change detection
- Typed action payloads via
serde::Deserialize(no custom traits needed) - Lifecycle hooks:
on_created,on_destroyed - URL router with pattern matching and parameter extraction
- Component discovery from
.hypenfiles on the filesystem - Cross-module communication via
GlobalContextandEventEmitter - Patch-based rendering compatible with all Hypen renderers (DOM, Canvas, iOS, Android)
License
MIT