Library / SDK
octanejs/octane avatar
octanejs/octane

Octane: A React-API UI Framework That Compiles Away the Virtual DOM

Project brief: React s programming model, compiled. The successor to Inferno, carrying its performance-first goal forward:.

1,393 stars52 forksTypeScriptMIT

At a glance

What is it?
Octane, the successor to Inferno, offers a React-compatible programming model with a compiler that emits direct DOM code. It targets developers who want React's ergonomics without the virtual DOM overhead, but its narrow scope and young ecosystem demand scrutiny.
Who is it for?
Adopt Octane if you are a React developer who wants the familiar hooks and JSX model but needs faster initial render and smaller runtime, and you can accept a framework that deliberately omits class components, Server Components, and synthetic events. Do not adopt it if you depend on those React features or if your team is not ready for a compiler-based workflow and a young ecosystem.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What Octane Solves and Who It Is For

Octane addresses a specific pain: React's runtime overhead from the virtual DOM and the manual bookkeeping of dependency arrays and rules of hooks. It is built for developers who already know the React API and want to keep that mental model, but who also want compiled output that touches the DOM directly. The README positions it as the successor to Inferno, carrying forward a performance-first goal. The target user is a front-end engineer in an existing React codebase who is frustrated by re-render costs or the ceremony of useEffect dependencies, and who is willing to adopt a compiler toolchain to eliminate those costs. It is not for beginners or for teams that rely on the full breadth of React's ecosystem, because Octane deliberately narrows the platform.

The Compilation Mechanism: From JSX to Direct DOM

The core mechanism is a compiler that transforms components written in JSX or the extended .tsrx dialect into direct DOM manipulation code. There is no virtual DOM at runtime. Instead, the compiler generates a render path that updates the real DOM directly, and a keyed reconciler based on the longest increasing subsequence (LIS) keeps the runtime overhead minimal when lists change. The README explains that components re-render like React, but the compiled path avoids the intermediate virtual tree. The compiler also handles dependency derivation: when you omit the array from useEffect or useMemo, it analyzes the closure to see what it actually captures, including stable setters, dispatchers, refs, and state getters. This is a compile-time analysis, not a runtime proxy. The result is that the developer writes the closure, not the dependency list, which is a significant shift from React's explicit array requirement.

The .tsrx Dialect and Template Directives

Standard JSX works in .tsx files, but Octane introduces .tsrx as a spiritual successor to JSX. This dialect adds template directives that compile to keyed fast paths: @if, @for, @switch, and @try. The @for directive is particularly important because it solves a hook limitation: hooks inside a plain JS loop are a compile error, since each iteration would share a single call-site slot. Instead, @for gives each item its own hook state. There is also an @{ ... } shorthand that puts setup logic next to the output, reducing the distance between state and markup. The README shows a counter example using this shorthand. Mixing .tsx and .tsrx in one app is allowed, and imports can cross the boundary. A VS Code plugin provides syntax highlighting, diagnostics, navigation, and completions for .tsrx files, which is essential because the dialect is not standard JSX.

Getting Started: Commands and Configuration

The README gives concrete steps to run Octane. Scaffold a new project with npm create octane my-app, then cd my-app and npm run dev. The --template spa flag creates a client-only app; --template fullstack adds routing, streaming SSR, hydration, and a production build. Leaving the flag off prompts interactively. For an existing project, the CLI can wire things up: pnpm dlx @octanejs/cli init configures the TypeScript settings that .tsrx needs. Manual setup requires pnpm add octane @octanejs/vite-plugin, then adding the octane plugin to vite.config.ts. The main entry point uses createRoot from octane and renders a component. The README also mentions Rspack and Rsbuild support, but the Vite example is the primary path. Node.js 22.22.2 or newer is required for the published packages, which is a notable system requirement.

Runtime Features: Events, Refs, and State

Octane uses real delegated DOM events, not a synthetic system. Controlled form components follow React's value and checked semantics, but they fire onInput per edit and native onChange on commit. Refs are plain props and can be a callback, an object, or even an array like ref={[a, b]}. The README emphasizes that there is no synthetic layer second-guessing the browser. State management is React-like: useState and useReducer return a third element, getState, which lets a delayed callback read the latest value instead of a stale closure. There is also useLinkedState, which resets or adjusts local state when an input changes, without an effect or a state update during render. Promises in render are safe without a cache() wrapper: creations feeding use() are memoized at their declarations, and independent requests start together. These are concrete runtime behaviors that differ from React, and they are documented as deliberate choices.

Streaming SSR, Hydration, and Deferred Hydration

Octane includes streaming server-side rendering with out-of-order Suspense flushing over Node or web streams. It also supports buffered and static rendering. A key feature is deferred hydration: the <Hydrate> component keeps server HTML visible but inert until it is worth activating, and it splits its children into their own chunk by default. This is a performance optimization for reducing time-to-interactive on large pages. Additionally, behavior-only roots allow attaching abortable behavior and delegated native events to server-rendered markup without taking reconciliation ownership. This is useful for integrating with externally owned DOM, such as a CMS or a separately streamed page. The README claims byte-stable hydration, which means the client-side rendering matches the server output exactly, avoiding mismatches. These features are aimed at production apps, but they add complexity to the runtime and build setup.

React Interoperability and the Strong Mode Option

Octane provides two-way interoperability with real React. ReactCompat renders actual React components inside an Octane app, and OctaneCompat adds Octane components to a React app. Both are available from octane/react. The README specifies that ReactCompat requires React and React DOM 19.2+ in the React 19 series. This is a pragmatic bridge for gradual migration. Another distinctive feature is Strong mode: adding "use strong" to a module enables optional immutable render snapshots. This asserts pure renders, catches detectable violations, and lets production memoization condition every user-authored render call shape on its witnessed inputs. This is a compile-time enforcement of purity, which is stronger than React's runtime checks. It is an opt-in feature, which is good because it may reject code that is not strictly pure.

Limitations and the Wrong Tool Cases

Octane deliberately excludes several React features: no class components, no Server Components, and no synthetic event system. The README calls these choices, not gaps, and points to a Differences from React document. This means a team that relies on class lifecycle methods or the React event system's cross-browser normalization will need to adapt. The compiler dependency is another limitation: you cannot use Octane without a build step that includes the Vite plugin or equivalent. The .tsrx dialect requires editor tooling, and the VS Code plugin is the only one mentioned. The project is young: the latest release is 0.1.49, which signals pre-1.0 instability. The README mentions a large behavioral suite and a react-parity coverage report, but it does not guarantee full React compatibility. The runtime is narrow, so if you need a feature outside that narrow scope, you will hit a wall. Also, the requirement for Node.js 22.22.2+ may be a constraint in some environments.

Alternatives and How They Differ

The most direct alternative is React itself, especially React 19 with its compiler optimizations. React still uses a virtual DOM, but the React compiler can memoize components automatically, reducing re-renders. The difference is that React's compiler is an optimization layer over the existing runtime, not a replacement for the virtual DOM. Octane compiles away the virtual DOM entirely, which can lead to smaller runtime and faster initial render, but it also means you lose React's ecosystem compatibility. Another alternative is Svelte, which also compiles to direct DOM updates, but it uses a different syntax and reactivity model (no hooks). Svelte's approach is closer to Octane in performance goals, but it requires learning a new component syntax, whereas Octane keeps the React API. If you want to stay in the React ecosystem, React with the compiler is a safer bet. If you want compiled performance and are open to a new syntax, Svelte is a mature option. Octane sits in between, offering React's API with Svelte-like compilation, but with a smaller community and less maturity.

Maintenance, Upgrade Cost, and License

Octane is MIT-licensed, which is permissive and allows commercial use without restriction. The project is actively maintained, with the last push and release on 2026-08-28, and multiple packages released in tandem: octane, create-octane, and @octanejs/zustand. The frequent releases (0.1.49) indicate a fast-moving API. Upgrade cost is a concern: pre-1.0, breaking changes are likely. The README does not provide a migration guide, but the CLI init command suggests it can update configuration. The maintenance burden includes keeping up with the compiler and the .tsrx tooling. The react-parity report is generated, which helps track compatibility, but it is not a guarantee of stability. For a production project, you should pin versions and review the changelog before each upgrade. The license is a positive, but the young version number is a risk factor.

Editorial conclusion

Adopt Octane if you are a React developer who wants the familiar hooks and JSX model but needs faster initial render and smaller runtime, and you can accept a framework that deliberately omits class components, Server Components, and synthetic events. Do not adopt it if you depend on those React features or if your team is not ready for a compiler-based workflow and a young ecosystem. Before committing, verify the react-parity coverage report for the specific hooks and patterns you use, test your existing React components through ReactCompat, and check whether the .tsrx tooling in your editor meets your needs. The project is under active development with frequent releases, but it is not yet a stable 1.0, so plan for API changes.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Community notes

Community notes