Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does anybody else think it's extremely damning that a mature framework such as React still has no agreed up on way to start a project? One of React's initial selling points was that it was a library, not a framework! React is unopinionated! Etc. Perhaps some opinion might have been better, in hindsight.

How is `react new` not a thing?



I'm fine with having options, I just find it odd that Vite isn't recommended in the official doc. I mean, they talk about it but it's hidden at the end of a collapsed 500-word "deep dive" section following a list of recommended frameworks. I would personally recommend Vite to anyone learning React, it doesn't add features to React so you can actually just focus on learning React instead of learning at the same time some framework's APIs. I understand the benefits of going with Next.js, but I feel like I would be overwhelmed if I was learning React and had all those extra layers of features and concepts (SSR, SSG, CSR, ISR...) that come with Next.js thrown into my face.

It's like telling someone who wanna learn Python to start with Django.


It's the same story with Express as a web server framework for Node.

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.


Sorry to be obtuse, but it’s not damning at all because it’s a library, not a framework.


It's not a library. I think this would be a valid argument if it was an actual library.

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.


I’ll admit to using the words framework and library interchangeably when referring to React in my day to day, but what distinguishes React from frameworks to me is the fact it doesn’t tie itself to a particular rendering context, i.e. it is flexible and unopininated and relies on wrappers and rendering libraries to actually function.


Maybe not standard definition but I view a library as something that can be swapped out of a project with low-medium effort.

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.


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

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?


That's the entire downside of a tool being unopinionated. It's up to the community to decide how it wants to use that tool. And for the most part, the answer is turning to Next.js.


When a business decides to pick a tech, they look at following:

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"


I don't understand how any of that is related to why "react new" is not a thing.


Then let me iterate it more clearly. The reason "react new" is not a thing because from business perspective "react" is superior to "react new".

Hence newer projects are likely to pick react instead of solid/svelte


For posterity’s sake, they weren’t suggesting a new React, they were describing a missing official way to create a new app at the command line like “react new my-todo-app”


They had/have create-react-app ... though I don't want/agree with a lot of the config.

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.


To start a new react project, you just need to declare a root react-dom node and call its render method to get it to the regular DOM. It is so trivial any other way becomes more complicated, and it is up to you to have an opinion on how to build and serve it, or to stick with some popular bundle of opinions aka "framework". If you know how to cook - you can come up with an original and delicious dish, but anytime you can resort to frozen pizza.


It appears the layoffs affected the React team, and the once-standard way for starting a new framework-less project (CRA) isn't supported anymore.

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.


I don't think it's fair to blame CRA's state of disrepair on the layoffs. CRA has been barely maintained for years now and what releases it did receive were mostly to update its dependencies. CRA was created out of a need for a "blessed" starter but it feels like the hope was that it would spark competition so it could be replaced with something else.


I agree! I meant to say the layoffs were probably the final nail in the coffin for CRA. Honestly, I always disliked CRA, and I'm glad to see it go.


The existence of craco to deal with CRA being opinionated to a fault is both awesome (in that I <3 the craco devs for making it, especially given when I discovered it I was right on the verge of reinventing it in a fit of rage and they'd already done it better than I would have) and something of a demonstration that one can take opinionation too far such that it becomes evolutionarily maladaptive.


I'm glad it's this way. I'm opinionated. I couldn't live in a Rails-like ecosystem. If you want an opinionated framework, there are frameworks built on top of React. Choose the one that fits your opinions best.


It's a view library. You'd expect there to be one opinionated way to use it?

> `react new`

This is basically what create-react-app was, but the community came out with better options.




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

Search: