11# NullReact: Compiler-First Reactive UI Engine
22
3- ** Blazing-fast. Zero-runtime. Rust-powered JSX compiler for fine-grained, DOM-first reactivity .**
3+ ** Zero-runtime. Rust-powered. JSX-in, reactive JavaScript out .**
44
55---
66
7- ## Why NullReact?
7+ ## Why NullReact
88
9- - ** Compiler-First** — Transforms JSX into direct DOM operations at build time.
10- - ** No Virtual DOM** — Uses signals and reactive graphs, not diffing engines.
11- - ** Minimal Runtime (<1KB)** — Optional runtime for hydration and scheduling.
12- - ** Rust-Powered** — Fast, parallel, and memory-safe compilation.
13- - ** JSX-Compatible** — Familiar syntax, radically improved performance.
9+ NullReact is not a framework — it’s a ** reactivity compiler** . It transforms standard JSX into ** fine-grained reactive JavaScript** without any virtual DOM, and with an optional runtime footprint of under 1KB.
10+
11+ - ** Compiler-First** — All reactivity is handled at build time, not runtime.
12+ - ** No Virtual DOM** — Updates are precise and direct; no diffing or reconciliation.
13+ - ** Minimal Runtime (<1KB)** — Optional runtime handles hydration, batching, and effects.
14+ - ** Rust-Powered** — Fast, parallel compilation with full memory safety.
15+ - ** JSX-Compatible** — Familiar syntax, radically faster output.
1416
1517---
1618
@@ -26,22 +28,22 @@ nullreact/
2628│ │ ├── signals.rs # Core signal system: batching, effects
2729│ │ ├── bench.rs # Performance test suite
2830│ │ └── runtime.js # Shared runtime hooks
29- │ ├── Cargo.toml # Rust config
30- │ └── Makefile # Build, test, bench commands
31+ │ ├── Cargo.toml # Rust project config
32+ │ └── Makefile # Build, test, benchmark commands
3133│
3234├── runtime/ # Lightweight DOM runtime (optional)
3335│ ├── dist/
3436│ │ └── runtime.js # Compiled ESM runtime
35- │ ├── signals.js # JS-based signal fallback
36- │ ├── dom.js # DOM insert/update/delete
37+ │ ├── signals.js # Signal system in JavaScript
38+ │ ├── dom.js # DOM operations ( insert/update/remove)
3739│ └── index.js # Runtime entrypoint
3840│
39- ├── examples/ # JSX demos ( compiled via CLI)
41+ ├── examples/ # JSX demos compiled by CLI
4042│ ├── 1m-signals.jsx
4143│ ├── 10k-filter.jsx
4244│ └── ui-benchmark.jsx
4345│
44- ├── website/ # Playground & dev UI
46+ ├── website/ # Playground and demo UI
4547│ ├── public/playground.html
4648│ ├── src/index.ts
4749│ └── vite.config.ts
@@ -62,61 +64,65 @@ cd compiler
6264cargo build --release
6365```
6466
65- ### 2. Compile JSX
67+ ### 2. Compile JSX to Reactive JS
6668
6769``` bash
6870./target/release/nullreact examples/10k-filter.jsx -o dist/
6971```
7072
7173### 3. Run in the Browser
7274
73- Use output JS with ` runtime/index.js ` in any HTML page. See ` /website ` for example.
75+ Use the output JavaScript with ` runtime/index.js ` inside an HTML page.
76+ Example: ` website/playground.html ` .
7477
7578---
7679
7780## Benchmarks
7881
79- | Example | NullReact | React |
80- | ------------------| ----------------| ---------------|
81- | 1M Signals | ~ 19ms | ❌ crashes |
82- | 10k Filter Updates| ~ 6ms | ~ 180ms |
83- | UI Update Latency | ~ 0.8ms | ~ 22ms |
84- | Runtime Payload | <1KB | ~ 43KB |
82+ Measured on real devices using raw DOM operations.
83+
84+ | Example | NullReact | React |
85+ | --------------------| ------------------| --------------|
86+ | 1M Signals | ~ 19 ms | Crashes |
87+ | 10K Filter Updates | ~ 6 ms | ~ 180 ms |
88+ | UI Update Latency | ~ 0.8 ms | ~ 22 ms |
89+ | Runtime Size | <1 KB | ~ 43 KB |
90+
91+ To run all benchmarks:
8592
86- Run:
8793``` bash
8894make bench
8995```
9096
9197---
9298
93- ## Architecture Overview
99+ ## Architecture
94100
95- - ** Compile-Time Reactivity ** — JSX is parsed and lowered into reactive primitives .
96- - ** Signals as Dataflow ** — Fine-grained updates without components .
97- - ** Minimal Runtime ** — Just hydration, effects, and scheduling .
98- - ** No Dependencies ** — Pure ESM + Rust output .
101+ - ** JSX Compiler ** — Parses and transforms JSX to reactive instructions .
102+ - ** Signal Graph ** — Updates are tracked and scheduled precisely .
103+ - ** Code Emitter ** — Outputs pure JavaScript; runtime optional .
104+ - ** Runtime ** — Handles hydration, batching, and effect flushing (if needed) .
99105
100106---
101107
102- ## Tech Stack
108+ ## Technology Stack
103109
104- - 🦀 ** Rust** – Compiler core , CLI, AST transform
105- - 🧠 ** Signals** – Fine-grained reactivity model
106- - 🧩 ** JavaScript** – Output-ready , no build tools needed
107- - 🧼 ** No VDOM ** – No diffing, just direct DOM updates
110+ - ** Rust** — Compiler backend , CLI, AST handling.
111+ - ** Signals** — Low-level reactivity system (in both Rust and JS).
112+ - ** JavaScript** — ESM-compatible output , no framework required.
113+ - ** No Babel, No React, No Overhead ** — Just direct DOM instructions.
108114
109115---
110116
111- ## Contributing & Benchmarks
117+ ## Contributing & Testing
112118
113- Run performance tests across examples :
119+ To test and compare performance :
114120
115121``` bash
116122make bench
117123```
118124
119- Compare results with React, Solid, Preact using included demos .
125+ You can modify or add new JSX files inside ` examples/ ` and compile them using the CLI tool .
120126
121127---
122128
@@ -130,4 +136,4 @@ Email: pawanpediredla
130136
131137## License
132138
133- MIT © 2025 — Use it. Break it. Ship it .
139+ MIT License — Free to use, fork, and contribute .
0 commit comments