logoalt Hacker News

nicce04/01/20252 repliesview on HN

To be honest, I am very confused with this benchmark. It is misleading.

What is the actually size of the production build portion only for that button part? Because I think that the ShadCN button source code is not equal in size for the button that client downloads in production environment. Especially if you have SSR.


Replies

hombre_fatal04/01/2025

If you look at the demo, all of the payload comes from react and the tailwindcss classes that the shadcn button refers to.

It's dishonest to call this the payload of "one shadcn button" since it's basically all react/tailwindcss fixed cost and not literally a shadcn button.

But still, that's a decently broad demo to fit in a small payload, so the exaggeration kinda takes away from that.

The main thing I care about in client development is the state management solution since that's where most of the complexity comes from, and it's what makes or breaks an approach. In React, I use MobX which I see as the holy grail.

Whether Nue is nice to use or not for me is gonna come down to how nice this is to work with: https://nuejs.org/docs/interactivity.html

show 1 reply
programmarchy04/01/2025

Seems like you should be correct. A shadcn button is just react, tailwind, and @radix/react-slot. But if you simply create a new shadcn Next.js template (i.e. pnpm dlx shadcn@latest init) and add a button, the "First Load JS" is ~100kB. Maybe you could blame that on Next.js bloat and we should also compare it to a Vite setup, but it's still surprising.

show 1 reply