hn.today

The AI cost of JavaScript frameworks

nolanlawson.com78 points47 comments
Screenshot of The AI cost of JavaScript frameworks

Framework choices in frontend development are often defended with intuition - claims that a tool is faster, easier for developers, or better suited to AI agents - rather than evidence. To test whether frameworks affect agent-driven development, Nolan Lawson had Claude Opus build the same modest Pokémon reference app in 12 setups, from Next.js and Nuxt to Hono with htmx and plain JavaScript. Each agent received the same feature specification and framework-specific tools where available; completed apps were checked against a conformance suite. Five runs were used per framework, except Angular, which failed to produce a working app twice. The experiment also tracked build cost, time, tokens, and Lighthouse performance and accessibility.

The clearest cost results put Hono+htmx, Astro, and Nuxt at the low end, with median builds of $2.67, $2.76, and $2.82; Angular, Gracile+Lit, and SvelteKit were most expensive. Astro was quickest at a median of 8.2 minutes, while Angular took 17.2 minutes and used the most tokens. Plain JavaScript did not outperform every framework, suggesting that some structure can help agents. However, results varied substantially between runs: agents sometimes failed to discover available tools or spent time exploring unfamiliar frameworks, and Lighthouse scores can fluctuate. The benchmark is limited to a small, content-focused app, and its performance measures tend to favor multipage applications over SPAs; it cannot establish which framework is best for larger or more interactive products.

Read on nolanlawson.com47 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.