How Reactra works
Reactra is a compiler. Understanding what it does at build time explains why the runtime is so small.
The pipeline
Section titled “The pipeline”Your DSL source goes through a multi-pass pipeline: it’s preprocessed into valid TSX,
parsed, the reactive graph is extracted, and finally React 19 code is emitted. The
output uses only standard React APIs — React.use, useTransition,
useSyncExternalStore — never useContext for the framework’s own wiring.
Fine-grained reactivity, no VDOM swap
Section titled “Fine-grained reactivity, no VDOM swap”Reactra doesn’t replace React’s rendering. It compiles your state/derived/store
reads into precise subscriptions, so a component re-renders only when something it
actually reads changes — including per-field store subscriptions.
The emission contract
Section titled “The emission contract”The compiled file is ordinary React. That’s the whole point: your devtools, types, and debugger work on the output, and you can eject. The Why Reactra pages show the compiled output for real features.