13ns hook overhead
use() compile-time substitution via vite-plugin-flexium drops per-call cost to ~13ns. Runtime path is ~550ns. Hooks API stays identical.
A fine-grained reactive UI framework with hooks-style API. Compile-time signal substitution drops per-call overhead to ~13ns. 12 KB gzipped. Works with Vite.
import { use } from 'flexium/core'
function Counter() {
const [count, setCount] = use(0)
return (
<button onclick={() => setCount(c => c + 1)}>
{count}
</button>
)
}npm create flexium@latest my-app
cd my-app && npm run devOr add to an existing app:
npm install flexium| Flexium 0.18 | React 19 | |
|---|---|---|
| Hook overhead | 13 ns (compile-time) / 550 ns (runtime) | 200–1,000 ns |
| Base client bundle | 12.56 KB gz | ~45 KB gz (react + react-dom) |
| Re-render model | Signal-targeted DOM patch | Virtual DOM diff |
| 1k row mount (Chrome) | 4.23 ms | ~50–100 ms |
| Cross-platform | Web DOM + Canvas + SSR | Web DOM (Native via separate stack) |
| Bundle includes router | flexium/router (no extra) | react-router-dom (~10 KB extra) |
→ See the examples for working code that exercises each capability, or showcase for real apps.
flexium/core — Signals (use, createSignal, createComputed, createEffect), Context, Useable.
flexium/dom — JSX runtime (f), render, Suspense, ErrorBoundary, Portal, lazy.
flexium/router — Client-side router: <Routes>, <Route>, <Outlet>, <Link>, useRouter.
flexium/css — Atomic CSS-in-JS with build-time extraction.
flexium/jsx-runtime — Standard JSX runtime, works with Vite/esbuild out of the box.
flexium-canvas — Declarative canvas primitives (<DrawRect>, <DrawCircle>, <DrawText>, etc.)flexium-ui — Layout primitives (<Column>, <Row>, <Center>, <Spacer>, <Portal>)vite-plugin-flexium — JSX transform + compile-time optimizations (Phase 7 substitution)eslint-plugin-flexium — Linting rules for signal correctnesscreate-flexium — Project scaffolding (npm create flexium@latest)use() 5 overloads stable across 0.17.x and 0.18.x. New capabilities ship as additive APIs (e.g., createSignal) without breaking the existing hooks surface.