r/programming • • Mar 29 '22

React 18 released!

https://reactjs.org/blog/2022/03/29/react-v18.html
749 Upvotes

183 comments sorted by

View all comments

12

u/[deleted] Mar 30 '22

[removed] — view removed comment

9

u/acemarke Mar 30 '22

Nitpicking a bit, but this statement isn't correct.

You only need two packages for a "hello world" app: The platform-agnostic react package, and the platform-specific renderer (ie react-dom):

https://beta.reactjs.org/learn/add-react-to-a-website#step-2-add-the-script-tags

What it sounds like you're referring to is the Create-React-App build tool, which does install several hundred NPM packages because it includes Webpack, Jest, and ESLint out of the box, and those have hundreds of transitive deps. That's a completely separate thing from the React library itself.

CRA also isn't the only way to set up a React app. For example, creating a project with Vite "only" installs about 60-ish packages, because it uses ESBuild and Rollup to compile and bundle instead of Webpack+Babel, and it also doesn't include Jest or ESLint by default.

So, sure, I wish CRA and the rest of the JS ecosystem had fewer dependencies. But, it's important to distinguish between "the library" and "the build tools often used to create projects".