Skip to main content
EXODRA

Imperative UI framework · no build step required

Plain TypeScript.
Near hand-written speed.

Components with state, effects and context at the cost of a template engine: mounts faster than Mikado, Solid and React, updates level with hand-rolled DOM code. Reactivity, keys, hydration and React’s API sit on top as plugins: take the ones a screen needs, leave the rest out of the bundle.

counter.ts
import {
EXO_PORT_EVENT, EXO_PORT_TEXT, composeExoMachine, createExoMachine, createExoSchema,
exoPorts, withExoHandlers, withExoTransitions, withExoWire,
} from '@exodra/core';
import { ExoDomBackend, withExoCompiler } from '@exodra/dom';
const CounterPorts = exoPorts({ COUNT: EXO_PORT_TEXT, INCREMENT: EXO_PORT_EVENT });
const CounterSchema = createExoSchema(CounterPorts, (b) => {
b.el('div', { class: 'counter' }, (div) => {
div.el('span', null, (span) => span.textPort(CounterPorts.COUNT));
div.el('button', { type: 'button' }, (button) => {
button.eventPort(CounterPorts.INCREMENT, 'click');
button.text('+1');
});
});
});
export const counterMachine = composeExoMachine(
createExoMachine(CounterSchema, { createInitialState: () => ({ count: 0 }) }),
(m) => withExoTransitions(m, {
increment: (c) => {
c.state.count += 1;
c.text(CounterPorts.COUNT, String(c.state.count));
},
}),
(m) => withExoWire(m, (c) => c.text(CounterPorts.COUNT, String(c.state.count))),
(m) => {
const { increment } = m.transitions;
return withExoHandlers(m, (on) => on(CounterPorts.INCREMENT, (c) => increment(c)));
},
);
export const { increment } = counterMachine.transitions;
withExoCompiler(new ExoDomBackend()).render(counterMachine, document.body);

The same machine, with its schema declared in JSX and compiled at build time, so the page ships no compiler:

counter.tsx
import { exoJsx } from '@exodra/jsx';
import {
composeExoMachine, createExoMachine, withExoHandlers, withExoTransitions, withExoWire,
} from '@exodra/core';
import type { TExoEventPort, TExoTextPort } from '@exodra/core';
import { ExoDomBackend, withExoBuiltSchemas } from '@exodra/dom';
const CounterSchema = exoJsx<{ COUNT: TExoTextPort; INCREMENT: TExoEventPort }>(($) => (
<div class="counter">
<span>{$.COUNT}</span>
<button type="button" onClick={$.INCREMENT}>+1</button>
</div>
));
const CounterPorts = CounterSchema.ports;
export const counterMachine = composeExoMachine(
createExoMachine(CounterSchema, { createInitialState: () => ({ count: 0 }) }),
(m) => withExoTransitions(m, {
increment: (c) => {
c.state.count += 1;
c.text(CounterPorts.COUNT, String(c.state.count));
},
}),
(m) => withExoWire(m, (c) => c.text(CounterPorts.COUNT, String(c.state.count))),
(m) => {
const { increment } = m.transitions;
return withExoHandlers(m, (on) => on(CounterPorts.INCREMENT, (c) => increment(c)));
},
);
export const { increment } = counterMachine.transitions;
withExoBuiltSchemas(new ExoDomBackend()).render(counterMachine, document.body);

What’s inside

An imperative engine, with the abstractions on top.

How it works

The counter above, in three steps.

01

Schema

once, when the module loads

Markup and its ports, declared with a function call. Every port gets its number here and keeps it.

count = span.textPort();
02

Machine

once per instance

Initial state and transitions. A transition fills ports by number: nothing is diffed, nothing is walked.

c.text(P.count, String(c.state.count));
03

Backend

wherever it runs

The same machine renders into the DOM, prints HTML on the server, adopts it on the client, or drives a terminal.

withExoCompiler(new ExoDomBackend()) .render(counterMachine, document.body);

No compiler magic

What updates is the line you wrote.

Compiled frameworks decide at build time what to track and what to memoize, by rules you have to know and cannot see in your code. Break one and nothing fails: the screen just stops updating, or updates too often.

React Compiler

react.dev, React Compiler v1.0

Memoizes your code “based on its analysis and heuristics”. A future version may change how, and that can make a useEffect fire more or less often; the docs suggest pinning the exact compiler version.

npm install --save-exact babel-plugin-react-compiler

Svelte 5

svelte.dev, $effect

$effect tracks the values it reads synchronously. A value read after an await or inside a setTimeout is not tracked, and the effect never reruns for it.

await load(); console.log(count); // not tracked

Solid

docs.solidjs.com, props

Destructuring props “can break reactivity”: the destructured value is read once and does not update when the prop changes.

const { name } = props; // never updates

Exodra has nothing to decide. A schema is a function call, a transition writes a port by number when you call it, and the price of a list is the call you chose: a fixed list, a list by identity, or a keyed one. Nothing is inferred from your code: the JSX plugin compiles a declaration into its schema at build time and refuses, there and then, anything that is not markup, a module-level value or a port.

a transition
open: (c) => {
c.state.opened++;
c.text(CardPorts.TITLE, String(c.state.opened));
},

Transitions and ports, in the components guide →

Read, then hold

React reads before it subscribes.

A component reads the store while it renders. useSyncExternalStore subscribes later, in an effect, and after a first render, a transition, or an update from the network or a timer, that effect runs in a later task. Anything that commits in between sees data nobody holds yet: a store that collects unheld data drops it, and a request tied to it is cancelled and sent again when the subscription finally arrives. Tests rarely show it, because act() flushes those effects at once. Moving the work into render is not allowed either: React's rule is that components and hooks must be pure, so every data library designs around the gap.

react: read, then subscribe later
function Todo({ id }) {
const todo = useSyncExternalStore(
(notify) => store.hold(id, notify), // runs later, in an effect
() => store.get(id), // runs now, in render
);
return <li>{todo.title}</li>;
}
exodra: read and hold in one call
withOIMEffects(m, (effect) => {
effect((c) => {
const todo = c.state.slot.entity; // read, then held,
if (todo !== undefined) // in this same call
c.text(TodoRowPorts.TITLE, todo.title);
});
});

An Exodra effect has no render phase in front of it. It starts while the node is being built, in the same call stack, and the oimdb effect reads the data and holds what it read before it returns.

Rules nobody wrote in your code

Every one of these is in the official docs.

None of them is a bug report. Each is documented behaviour, and in each the program you wrote reads as correct: it runs twice, or once too few, or stops updating, and nothing is thrown.

React · Strict Mode

react.dev, Synchronizing with Effects

“In Strict Mode, React mounts components twice (in development only!) to stress-test your Effects.” Development and production run your effects a different number of times.

useEffect(() => { conn.connect(); }, []); // dev: connects twice, prod: once

React · useMemo

react.dev, useMemo

“Since useMemo is performance optimization, not a semantic guarantee, React may throw away the cached value if there is a specific reason to do that.” An effect that depends on the value re-fires when it does.

const options = useMemo(() => ({ roomId }), [roomId]); useEffect(connect, [options]); // may reconnect anyway

React · state

react.dev, State as a Snapshot

“Setting state only changes it for the next render.” Three increments in one handler add one.

setNumber(number + 1); setNumber(number + 1); setNumber(number + 1); // +1, not +3

React · fetching

react.dev, Synchronizing with Effects

Two requests from one effect can finish in either order, and the older answer can overwrite the newer one. The documented answer is an ignore flag you remember to write in every fetching effect.

let ignore = false; fetchBio(person).then((r) => { if (!ignore) setBio(r); }); return () => { ignore = true; };

Vue · reactive()

vuejs.org, Reactivity Fundamentals

“When we destructure a reactive object’s primitive type property into local variables, or when we pass that property into a function, we will lose the reactivity connection.”

const state = reactive({ count: 0 }); let { count } = state; count++; // state.count is still 0

Svelte 5 · $state.raw

svelte.dev, $state

“State declared with $state.raw cannot be mutated; it can only be reassigned.” A mutation is accepted, and the screen does not change.

let person = $state.raw({ age: 49 }); person.age += 1; // no update

Solid · components

docs.solidjs.com, Components

“A Solid component is only run once, when it is first rendered into the DOM.” A branch written as an early return is decided once, for good.

if (!props.user) return <Login />; return <p>Hi {props.user.name}</p>;

Angular · NG0100

angular.dev, NG0100

“Angular only throws this error in development mode.” A binding that changed after its check is reported while you develop, and is quiet in production.

ngAfterViewInit() { this.title = "loaded"; // NG0100 in dev only }

Next.js 15 · fetch

nextjs.org, Upgrading to version 15

“fetch requests are no longer cached by default.” The same line was cached in 14 and is not in 15.

await fetch('https://…'); // 14: cached, 15: not

Somebody else's DOM

A translator rewrites your page. Who fixes it?

Google Translate and the browser’s own translator move text into a <font> of their own. React can then crash with Failed to execute 'removeChild' on 'Node'. The issue was closed in 2018 with “I don’t think we can fix this in React without making legitimate mistakes hard to find, or making performance worse for common cases”, and no release since lists a fix. What a React app can do is patch the browser’s Node.prototype for every library on the page.

In Exodra, how text reaches the DOM is a plugin. The default bundle, withExoDefaults, already re-checks the element on every write: the page keeps updating, and the translator's <font> is replaced by the new text. If your page needs a different policy, say keeping the <font> and writing into it, you write a writer and compose it: no fork, no patch to the platform, nothing from us.

react: patch the platform
// the workaround from the React team, issue #11538
const removeChild = Node.prototype.removeChild;
Node.prototype.removeChild = function (child) {
if (child.parentNode !== this) {
console.error('Cannot remove a child from a different parent',
child, this);
return child;
}
return removeChild.apply(this, arguments);
};
exodra: compose your own writer
const translatedText: TExoDomSetter = (el, value) => {
const font = el.firstElementChild; // the translator's <font>
(font ?? el).textContent = String(value ?? '');
};
const backend = composeExoPlugins(withExoCompiler(new ExoDomBackend()), {
writers: (next: TExoWritersApi): TExoWritersApi => ({
name: 'translated text over ' + next.name,
attr: (name, proto, kind, at) => next.attr(name, proto, kind, at),
markupCarries: (name, proto) => next.markupCarries(name, proto),
text: () => translatedText,
}),
});

Writers and the packs that ship, in the plugins guide →

Our rules

Exodra has rules too. They fail out loud.

A schema is one root element, and markup the HTML parser would rearrange — a <div> inside a <p>, a <tr> straight inside a <table> — is refused, because the server's page and the browser's would come out as two different trees. Each refusal is an error with a code, thrown when the schema compiles, never a screen that quietly stops updating.

And none of them is part of the language. The compiler is a plugin, a backend compiles the same declaration by its own rules, and a children port holds an element that anything else built — a chart library's canvas, a template engine's clone:

an element Exodra did not make
c.appendChild(
ChartPorts.BODY,
c.foreign({ createDom: (self) => exoForeignNode(self, chartCanvas) }),
);

Benchmarks

A framework at the cost of a template engine.

Components, state and effects, and reactive when a screen wants it: @exodra/computed derives ports from fields, and effects subscribe to your own data layer. Each axis below runs the frameworks beside hand-rolled code with no framework in it; the distance to that code is what the abstraction costs, and every figure names the recording it came from.

<30%headroom left above Exodra at mountingfor any framework, measured against hand-written DOM callsWhat the floor says →
1.54×faster than Mikado on mount0.480 against 0.740 ms per appThe mount table →
1.00×of hand-written diff code when a list grows and shrinks6.0938 against 6.0938 µs per change, rows matched by identityLists by identity →

Replacing a 200-row list with a shuffle of it.

Rows are matched by the identity of their data, so a row that survives is the same element it was.

1.14× faster than sinuousms / 30 reconciles, median · .gate/reconcile.rec1.json
Exodra1.18
sinuous1.35
Solid2.01
React4.71
stage0, hand-rolled, no framework1.56

Production builds of React 19, Solid 1.9 and eight more libraries, each through its own idiomatic API. Lower is better. Full benchmark and methodology →

React

React code, rendered faster than React.*

This is a React app. It runs on Exodra as written.

counter.tsx
import { useState } from 'react';
import { createRoot } from 'react-dom/client';
function Counter() {
const [n, setN] = useState(0);
return <button onClick={() => setN(n + 1)}>clicked {n}</button>;
}
createRoot(document.getElementById('root')!).render(<Counter />);

Alias react and react-dom to @exodra/react-compat and the app runs on Exodra machines, with no virtual DOM in between. Add @exodra/babel-plugin-schema/react to the build and it mounts and updates faster than React itself.

* Through the compiler. It takes your JSX and code that is already compiled to jsx() or createElement calls, so React libraries from npm go through it as they are. Without it, updates are still ahead of React; mounting is level.

No ecosystem tax.

The React libraries you already use run on it unchanged. Each one below is tested on Exodra and on React with the same assertions, with every release.

  • react-router
  • TanStack Query
  • SWR
  • Zustand
  • Jotai
  • React Redux
  • React Hook Form
  • Formik
  • Framer Motion
  • Headless UI
  • Radix Dialog
  • Emotion
  • styled-components
  • react-i18next
  • react-window

With zustand and react-query doing the updates.

200 rows, each reading a zustand selector and a react-query query; every round writes 40 counts to the store and 40 labels to the query cache.

1.47× faster than React 19ms / 20 rounds, median · .gate/react-libraries.second-2026-11-01.json
React code on Exodra, compiled4.70
React code on Exodra, no compiler5.10
React 196.90

Plugins

Composed, not configured.

A plugin is a set of functions that each receive what a backend method does now and return what it does next. This one wraps on, the method that attaches every handler, and stamps a data-testid on the element it attaches to, named after the port: every compiled schema carries its port names, so the plugin is handed nothing.

withExoTestIds.js
import { composeExoPlugins } from '@exodra/core';
const stamp = (next) =>
function (port, handler, subject) {
next.call(this, port, handler, subject);
const name = this.schema.portNames[port.index];
if (name !== null) this.portNode(port).setAttribute('data-testid', name);
};
export function withExoTestIds(backend) {
composeExoPlugins(backend, { on: stamp });
if (backend.hydrateSurface) composeExoPlugins(backend.hydrateSurface, { on: stamp });
return backend;
}

Compose it in the test build and leave it out of production. There is no flag to check at runtime: in production the method was never wrapped, so it never runs.

app.js
const backend = withExoCompiler(new ExoDomBackend());
export const app = import.meta.env.MODE === 'test' ? withExoTestIds(backend) : backend;
app.render(counterMachine, root);
// <button data-testid="INCREMENT">+1</button>

Start imperative. Add what you need.

Install @exodra/core and @exodra/dom, declare a schema in plain TypeScript, and render it. Reach for reactivity, JSX or React’s API when a screen asks for it.

Recommended together with

CNStra

Decides what happens and in what order.

OIMDB

Holds the data, and hands back the same entity object until it changes, so a list row keeps its identity without a key.

Exodra puts it on the screen. One line flushes OIMDB at the end of every CNStra turn:

cns.addDrainListener(() => db.flush());Lists and identity →