Article may be outdated

This article is 2 days old. Some details may have changed since publication.

Hacker News·2 min read·medium

Vidact – a compiler that turns React into direct DOM operations

M
mohebifar
AI Summary

Vidact is a new compiler that transforms React components into direct DOM operations, eliminating the need for a Virtual DOM or a React runtime in the final bundle. It aims to improve performance by removing the render loop and tree diffing process entirely.

Why it matters

This approach challenges the standard React architecture, potentially offering significant performance gains for web applications by reducing bundle size and execution overhead.

Dive DeeperCreate a free account to unlock

Vidact compiles your function components and hooks into direct DOM operations. No Virtual DOM, no re-renders, no React in the bundle.

Read the docs Every example below is ordinary React, compiled by Vidact and running on 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.

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologybusiness

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in