How is `react new` not a thing?
How is `react new` not a thing?
It's like telling someone who wanna learn Python to start with Django.
I've always felt that the biggest problem with the Javascript ecosystem is that it's entirely too preoccupied with syntax. Remember CoffeeScript!? Some of the most influential forces in the community can waste entire years bikeshedding some syntactic thing that is mostly a matter of personal aesthetics. And this trickles down to the grunts trying to ship a product.
It's a fundamental drawback to Javascripts other strengths. And that's the reason it's so easy to find Express apps that are hot garbage. It's one of the most enduring myths that If you know Javascript, you can write a Node app.
It only works because software has been such an economically productive force, that having thousands of professionals spending weeks deciding whether semicolons are good or bad, or fighting their webpack configs, or migrating for loops to array methods... whatever... it still makes money at the end of the day.
jquery was a library. React is a framework because you're passing in code to React, which it then uses to do things like render components and respond to state changes.
React misleadingly called itself a library to distinguish itself from more batteries-included frameworks like Angular.
If I build an app on React, there's not much chance I'm ever going to swap it out for anything else, thus it's a framework.
If I use Twilio's JS library for sending SMS and then decide to swap to a different vendor (or a different library for the Twilio API) that's fairly easy with the right design.
Preact exists though? And literally emulates React's API. It even has a guide for aliasing the Preact module as React with your bundler so your app wouldn't need any code changes. Can a framework do that?
1. Longevity
2. Market share
3. Developer supply
4. Third party support. (Ecosystem)
5. Technically mature and advanced
Among those criteria react excels at first four. And is good enough for the fifth.
So, most business will pick react. Depending on the local environment, some may pick angular for those same reason.
All newer, better technologies will be evaluated afterwards and only if react and angular prove to be too troublesome for the business's current needs.
This is why "react new" is not a thing. This sentiment is echoed almost weekly basis. Recent threads were under title "React is holding me hostage"
Hence newer projects are likely to pick react instead of solid/svelte
It's a library, less of a framework. For frameworks, you can bring together your own, or use next.js etc. For that matter, getting started with react/jsx and vite.js or parcel are easy enough.
The ecosystem is confusing, but I'd argue it's still quite straightforward to start a new project: either use one of Vite's basic React templates or Next if you want an opinionated framework.
> `react new`
This is basically what create-react-app was, but the community came out with better options.