Live data from Hacker News

If not React, then what?

infrequently.org

51–60 of 756 posts

Re: If not React, then what?

#51

Earlier quoted context omitted.

Yes, you the developer. I think that’s his point. The performance if react sites is another thing and that’s what the user cares about. It also doesn’t work on mobile. React native was worshipped and now is thrown out.

React is absolutely performant. A developer who makes a slow React site would make a slow site with something else.

They're a wide chasm between what one can make and what is led to making. React can lead to fast, responsive websites, though you'd be fighting against a current pulling you out to a bloated, buggy mess. There's a unique stench that comes from many react sites where everything is a skeleton screen, everything loads slowly, history rewriting is busted, there's no hotlinking, and scrolling is glitchy. Peek under the hood, it's almost always react. Facebook.com quality is the outlier, not the likely outcome.

Re: If not React, then what?

#52
post #30

Earlier quoted context omitted.

Were you using a ~$2000 laptop on a broadband connection?

Out of curiosity I checked on iPhone 14/4g and 2018 Intel MBP. I don't get what the point of these comments is ? If you're using RPI with a 2g connection you'll have a bad experience shopping at the site ? And somehow that's supposed to factor in to my tech stack decisions ?

Alex's position is that the average consumer is on a cheap Android phone, which has severe CPU weaknesses compared to any iPhone from the last ~five years: https://infrequently.org/2024/01/performance-inequality-gap-...

Software engineers tend not to experience the web on the same class of device as most of their users.

Re: If not React, then what?

#53
post #37

A fun thing about reading Alex is that you can tell he's had the same arguments over and over again for a decade now and he's frustrated with having to keep on making the same points and getting the exact same responses. Most of the people commenting on this piece won't have read this whole article (it's long, and internet attention spans are short). As a result, you'll find plenty of the comments here were exactly p…

Maybe because they start with this tldr:

> In short, nobody should start a new project in the 2020s based on React. Full stop.

Good arguments here but the dogma doesn't help.

Re: If not React, then what?

#55

> Frameworkism isn't delivering. Correct. The reason is not the frameworks but the languages. What is needed is a much more high-level and feature-powerful language. Just look at react. Passing down dependencies/values is a pain. So what did react do? It introduced contexts. Similar, other react addons try to solve this problem. But they all sacrifice type-safety in the process. They simply cannot solve this problem;…

The React team should have done their own language, rather than making it a framework/library. Then they could ensure the absence of side effects in rendering code, and had a better way of detecting updates. The knowledge about how to do this was already out there for many years before they started: https://en.wikipedia.org/wiki/Functional_reactive_programmin...

Re: If not React, then what?

#56
post #3

React is not even a framework, really. It is a great starting point for simpler sites. Honestly still one of the best solutions out there.

How do you define a framework if React is not one?

It is one of more clear examples of a framework:

- calls your code

- heavily affects how the code is written

- requires significant build configuration (could even be argued it is something more than a framework, but definitely not a library)

Re: If not React, then what?

#57
I think React is fine, especially when using it mainly for rendering, keeping async stuff out of the components as much as possible.

The React API is way nicer to construct DOM trees than using Fragments, creating and appending children elements, concatenating strings to produce HTML, etc.

Imagine being able to do this without importing any 3rd party code:

    const content = html`Hello world!`; // New API: html Tagged templates [1].

    console.log(content); 
    // Outputs: { type: 'h1', props: { id: 'hello' }, children: ['Hello world!'] }

    document.querySelector("#container").patch(content);  // New API: HTMLElement.patch.
I'm sure there are a few more details involved but it sounds like a relatively small addition to the current DOM APIs.

I’m not aware of any initiatives like this currently. WebComponents could also benefit, as building a DOM tree within a class extending HTMLElement is still cumbersome: the WebComponents API doesn't really add anything to simplify DOM handling, which is why libraries like Lit exist.

--

1: Inspired by https://github.com/developit/htm

Re: If not React, then what?

#58
post #37

A fun thing about reading Alex is that you can tell he's had the same arguments over and over again for a decade now and he's frustrated with having to keep on making the same points and getting the exact same responses. Most of the people commenting on this piece won't have read this whole article (it's long, and internet attention spans are short). As a result, you'll find plenty of the comments here were exactly p…

If you try something for a decade and it doesn't work, maybe a change in style is necessary! An article exceeding 20 pages doesn't sound like the best persuasion strategy.

Re: If not React, then what?

#59

The people who don't think React (or Vue) is important are the same ones who have never worked on a large project with lots of screen updates and state changes that absolutely cannot be avoided. React is still #1 in popularity, and the most crucial tool for almost any web developer (aside from using TypeScript, instead of plain JS which is also critical for large projects) React is reported to be used by 39.5% of dev…

WordPress relies on server-generated HTML and its admin interface is a fairly complex "app", especially once you factor in the plugin ecosystem. According to [1], it's used on 43.7% of all public websites. [1] https://w3techs.com/technologies/details/cm-wordpress

If every user input causes a page refresh, that's not an "app" that's a "website". If you don't have any executable code (i.e. Javascript), but just form submits, yeah I agree that's what most of the web is, and as you pointed out most of the web is websites not web apps.

Re: If not React, then what?

#60

Earlier quoted context omitted.

WordPress relies on server-generated HTML and its admin interface is a fairly complex "app", especially once you factor in the plugin ecosystem. According to [1], it's used on 43.7% of all public websites. [1] https://w3techs.com/technologies/details/cm-wordpress

If every user input causes a page refresh, that's not an "app" that's a "website". If you don't have any executable code (i.e. Javascript), but just form submits, yeah I agree that's what most of the web is, and as you pointed out most of the web is websites not web apps.

Have you explored cross-document view transitions? Would you classify something that uses those as an app or a site?

https://developer.chrome.com/docs/web-platform/view-transiti...

Post reply on HN