Post

Happy to announce Octane – the successor to Inferno. React’s programming model, compiled. Hooks, Suspense and Actions, compiled ahead of time. No virtual DOM. No Rules of Hooks. No manually maintained dependency arrays. The compiler understands what your code. octanejs.dev

19 reposts143 likes

The dependency array removal is the part that actually changes the authoring experience. Curious how the compiler handles cases where the reactive closure captures a value that shouldn't trigger re-execution - does it infer stability from usage, or is there an escape hatch when it gets it wrong?

It does infer usage based off a few things. There's likely more wiggle room here. You can always opt to put them in manually if you want too. Any feedback on how we can make them better is highly valued as a github issue. :)

Good to know the manual override is still there. The inference approach sounds practical for the common cases, and having GitHub issues as the feedback path makes sense for surfacing the edge cases that come up in real usage.

conditional hooks are semantically a little different from React what do the hooks do if the branch isn't taken? does useEffect run its cleanup? does useState discard its state? etc

doesn't that violate declarativity? e.g. if I have if (shouldSubscribe) { useEffect(...) } and shouldSubscribe is true on first render but changes to false, clearly this subscription should be cleaned up

> "No manually maintained dependency arrays." For the React code I'm writing I feel like this is already the case. React compiler means effectively no useMemo and useCallback. And eslint React plugin auto fixes useEffect deps. And I find them useful to read explicitly when reviewing other code.

You can continue to write manual deps if you want, it's just that the eslint rule isn't smart enough to know what is stable and what is not in many cases.

Octane supports TSX and JSX, along with TSRX for even better DX and performance. It includes integrations for libraries such as TanStack, React Three Fiber, Lynx and StyleX, plus a compatibility layer for using Octane components inside existing React apps.

Nifty! Do you think there’s an option for an incremental path i.e. interop with an existing react app? Or too tricky with two schedulers etc?