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".

3

u/chucker23n Mar 30 '22

Sigh, it still needs 800 packages for Hello World.

Don't worry. Zero chance one of those has a major bug. Or turns malicious. :-)

-8

u/5tUp1dC3n50Rs41p Mar 30 '22

Yeah WTF are JavaScript developers doing as a community? Just write vanilla JS, ES6+ has everything you need. Just nobody bothered to try create their own micro-framework for the application. React is bloated hot fucking garbage. Anything requiring even 1 package for Hello World is garbage. All this shit you're creating is making products worldwide insecure. You're only signing your own job losses once your company gets absolutely fucked over when the cyber attacks start between Russia, China and the West.

7

u/neg_ersson Mar 30 '22

Sounds like a great idea if you're building the next big Hello World app.