orbitrs

Crates.ioorbitrs
lib.rsorbitrs
version0.1.10
created_at2025-05-21 13:20:52.536428+00
updated_at2025-05-21 18:07:48.943013+00
descriptionCore UI framework for the Orbit ecosystem - provides the rendering engine, component model, and framework APIs
homepage
repositoryhttps://github.com/orbitrs/orbitrs
max_upload_size
id1683383
size269,785
Akash Shah (itsalfredakku)

documentation

README

Orbit Framework

๐ŸŒŒ Overview

Orbit is a Rust-first, cross-platform UI framework that enables building Web, Native, and Embedded applications from a unified, single-source component format: .orbit. Inspired by frameworks like Razor, Vue, and Blazor, Orbit combines declarative markup with Rust logic for high-performance, flexible, and maintainable UI development.


๐Ÿ’ก Vision & Philosophy

Vision

Build once, run anywhere โ€” combining Rustโ€™s power with an intuitive component model.

Philosophy

  • Rust-Centric: Harness Rustโ€™s safety, speed, and concurrency at the core.
  • Unified Components: Combine markup, style, and Rust logic seamlessly in .orbit files.
  • Platform Agnostic: Target browsers (WASM), desktops, and embedded systems with one framework.
  • Developer Experience: Prioritize live reloading, type safety, and clear developer tooling.

๐Ÿ“ฆ Orbit File Structure & Naming Conventions

Orbit uses a flexible file naming convention to support simple to advanced workflows.

File Name Purpose
example.orbit Core component file mixing markup and Rust logic
example.orbit.rs Optional Rust logic extension/shared file
example.orbit.html Optional raw HTML fragment
example.orbit.css Optional raw CSS styling
example.orbit.js Optional raw JavaScript (interop, utilities)

This encourages modular development while maintaining the ability to have everything in a single file for simplicity.


๐ŸŽฏ Core Goals

  • โœ… Unified single-source UI components with Rust integration
  • โœ… Cross-platform support: Web (WASM), Native (WGPU), Embedded
  • โœ… Syntax inspired by Blazor/Vue but fully Rust-native
  • โœ… Support for CSR, SSR, and Hydration for flexible rendering modes
  • โœ… Powerful developer tooling: CLI, hot reloading, static type checks

๐Ÿ–ฅ๏ธ Renderer Backends: Hybrid Approach

Orbit uses a hybrid rendering architecture that combines the strengths of both Skia and WGPU:

Feature Skia (Standard UI) WGPU (Advanced UI)
High-quality 2D UI โœ… Native vector graphics โš ๏ธ Requires abstraction
Hardware-accelerated 3D โŒ Not supported โœ… Native support
Custom shaders โš ๏ธ Limited support โœ… Full control
Future game engine path โŒ Not suitable โœ… Fully extensible
WASM support โœ… Stable and production-ready โš ๏ธ Experimental but evolving
Performance for UI โœ… Optimized for 2D โš ๏ธ Overhead for simple UI

Our Hybrid Solution: Orbit leverages both rendering backends through a unified abstraction:

  • Skia for standard UI components where vector quality and WASM stability are critical
  • WGPU for advanced UI with 3D elements, custom shaders, and game engine capabilities

This approach allows Orbit to excel across different application domains while maintaining a consistent API for developers.


๐Ÿ›ฃ๏ธ Roadmap & Milestones

๐Ÿšฉ Milestone 1: MVP (v0.1)

  • .orbit parser (template + style + Rust blocks)
  • Template-to-Rust code compiler
  • Orbiton CLI: new, build, dev commands
  • Skia-based renderer for standard UI components
  • WASM runtime support

๐Ÿšฉ Milestone 2: Hybrid Renderer Architecture (v0.3)

  • Introduce RendererBackend trait abstraction
  • Develop WGPU renderer for advanced UI scenarios
  • Implement renderer compositor for combining outputs
  • Add heuristics for automatic renderer selection
  • Define component metadata for renderer preferences

๐Ÿšฉ Milestone 3: Advanced Rendering Capabilities (v1.0+)

  • Optimize coordination between renderers
  • Seamless transitions between 2D and 3D content
  • Scene graph, lighting, camera, and 3D controls
  • Integration with Rust game engines (Bevy, etc.)
  • Enable hybrid rendering modes (SSR, CSR, hydration)

๐Ÿšฉ Milestone 4: Ecosystem & Developer Experience (v1.x)

  • Orbit Playground (online editor)
  • OrbitKit component library with renderer-specific optimizations
  • Orbiton plugin architecture
  • Comprehensive documentation and tutorials

๐Ÿงช Development Strategy

  • Language: Rust
  • Syntax: HTML-like markup with embedded Rust expressions
  • Renderers:
    • Skia for standard UI components (2D, text, forms)
    • WGPU for advanced UI elements (3D, shaders, animations)
  • Renderer Selection: Automatic based on component needs, with manual override
  • Build Tools: Custom transpiler with cargo integration
  • CLI: Orbiton for project management, build, and dev server
  • Extensibility: Modular architecture allowing new backends (embedded, mobile)

๐Ÿ“‚ Project Structure

orbit/
โ”œโ”€โ”€ core/             # Runtime core: state, events, reactivity
โ”œโ”€โ”€ parser/           # Orbit file parser and AST
โ”œโ”€โ”€ renderer/         # Renderer implementations
โ”‚   โ”œโ”€โ”€ common/       # Shared renderer abstractions
โ”‚   โ”œโ”€โ”€ skia/         # Skia renderer for standard UI
โ”‚   โ”œโ”€โ”€ wgpu/         # WGPU renderer for advanced UI
โ”‚   โ””โ”€โ”€ compositor/   # Renderer output compositor
โ”œโ”€โ”€ cli/              # Orbiton CLI
โ”œโ”€โ”€ examples/         # Sample apps and demos
โ”œโ”€โ”€ docs/             # Documentation
โ””โ”€โ”€ orbit-spec.md     # Syntax and semantics specification

๐Ÿ”ฎ Future Considerations

  • Orbit Inspector: DevTools for component state & renderer visualization
  • Declarative Animation System: High-level, unified API for Skia and WGPU animations
  • Advanced Theming Engine: Dynamic themes, custom theme creation, design token integration
  • Embedded targets: no_std with optimized Skia/WGPU backends
  • Renderer-specific performance optimizations and benchmarking tools
  • Orbit Studio: WYSIWYG GUI Builder with renderer preview options
  • Additional rendering backends: Vello, WebGPU native, Vulkan, Metal
  • Runtime renderer switching based on performance metrics
  • Precompiled .orbit to WASM packages for easy npm distribution

๐Ÿ“ข Final Notes

Orbit is more than a UI frameworkโ€”it's a Rust-native UI ecosystem designed for high performance, safety, and developer joy. By embracing a hybrid approach with both Skia and WGPU, Orbit provides the best tools for each use case while maintaining a unified APIโ€”creating the foundation for the next generation of Rust apps across web, desktop, embedded, and beyond.

The Orbit has begun. ๐Ÿ›ฐ๏ธ

Commit count: 160

cargo fmt