Hacker News new | past | comments | ask | show | jobs | submit login

Create-react-app is deprecated? And the recommended replacement for SPAs is from the guy that makes Vue? What on earth?



It seems crazy, but it’s true. Also consider that Vite is a wrapper around 2 tools that are impressive in their own right: esbuild and rollup (and the latter was created by the guy who made svelte!)


It started out as one of his projects - an experiment to see if esbuild and native JS modules support in browsers could be used for development instead of webpack. It's become it's own project and has a large plugin ecosystem. The project doesn't involve vue, although it's the currently prescribed way to build vue projects now.


Vite is just an opinionated replacement for webpack, one of the biggest parts of create-react-app (which is obvious if you eject). This article's writer believes the out-of-the-box config for Vite is close enough to pre-eject CRA webpack config to be a drop in replacement.

You could stick with webpack. Its defaults have gotten better, even if CRA never quite aligned with that shift. (It is still slow and prone to config-related crankiness, but you don't need two thirds of what CRA ejected.)

So far in my own development, I find I generally prefer to use esbuild directly rather than the added weight of Vite and sometimes Vite feels like Create-React-App in that way that it obscures the power of the underlying components, though unlike Create-React-App Vite doesn't offer any sort of "eject" option. Vite adds some nice things like HMR support, but also now that browsers support script type="module" you can get nice dev experiences from unbundled modules without HMR and tools like esbuild/webpack become more of a "final pass" for Production rather than an always present development need. (Which is how Vite powers things like HMR, too, but you can do it by hand so easily now, I haven't yet been convinced to use Vite in a project.)





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: