finds.dev← search

// the find

sokra/rawact

★ 2,509 · JavaScript · MIT · updated Feb 2019

[POC] A babel plugin which compiles React.js components into native DOM instructions to eliminate the need for the react library at runtime.

A Babel plugin from webpack's creator (sokra) that compiles React JSX into raw DOM instructions, eliminating the react/react-dom runtime entirely. The idea is Svelte's: pay the framework cost at build time instead of runtime. This is a 2019 proof of concept that was never taken further.

The bundle size reduction is real and dramatic — 4.3 KiB vs 115 KiB for a trivial counter component. The static/dynamic attribute split is genuinely clever: because the compiler knows which props are literals, the update path only diffs the parts that can actually change, whereas React diffs everything. The runtime shim mirrors the full React hooks API (useState, useEffect, useReducer, useContext, useRef, useMemo, memo, createContext), so existing code can drop it in without rewriting components. The README is unusually honest about what works and what doesn't.

Abandoned in February 2019 — React has shipped concurrent mode, automatic batching, useTransition, and the compiler since then; none of it is here. The feature list has obvious gaps: no `key` support for lists (a correctness problem, not a perf one), incomplete attribute handling, no `React.Children`, partial dynamic props. The approach hits a fundamental wall with concurrent rendering and Suspense — the README even acknowledges this and sketches a redesign it never implemented. With React's own compiler (react-compiler) now shipping, the use case this was exploring has a first-party answer.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →