← Back to Tech Radar
Hacker News tech

Vidact – a compiler that turns React into direct DOM operations

Trending on Hacker News: Vidact – a compiler that turns React into direct DOM operations (39 points / 18 comments, via vidact.dev)

In one line

Vidact compiles React components into direct DOM code. No Virtual DOM, no React runtime.

Opening excerpt

Vidact reads your function components at build time and writes the DOM code for them. The component body runs once, at mount. A setState call after that reaches only the text nodes and attributes that read that state.

npx vidact my-app Beta. Vidact compiles a documented subset of React 19 and refuses the rest at build time.

Every example below is ordinary React, compiled by Vidact and mounted into this page.

import { useState } from ‘react’ export function Counter () { const [ count , setCount ] = useState ( 0 ) return ( < div > < button onClick = {() => setCount (count + 1 )}> Increment </ button > < output >Count: {count}</ output > </ div > ) } Result Increment Count: 0 Component calls 1 DOM mutations 0 Tree diffs 0 Counted live by a MutationObserver watching this demo.

(Excerpted from the original; full article via the source link below.)

This story hit the Hacker News front page today (39 points / 18 comments, via vidact.dev). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.

Source: Hacker News

Related Services