Live data from Hacker News

Why I don't miss React: a story about using the platform

jackfranklin.co.uk

81–90 of 279 posts

Re: Why I don't miss React: a story about using the platform

#81
post #56

Earlier quoted context omitted.

> Web Components is it's slower than React or other vDOM implementations > To re-render, you have to manipulate the innerHTML--usually replacing the string every update "Usually" is relative, I guess, but nothing's stopping you from using the imperative DOM APIs to update the component's contents; I daresay this would be the typical thing to do. These APIs will be just as performant as anything else out there. What y…

If you're using a framework like lit-html as the author recommends, it will replace the string every update. Most people will prefer that way since it's more ergonomic and similar to React. You could do imperative DOM updates, but that'd be like going back in time to jQuery.

This simply isn't true. Tagged template literals are not string concatenation. Also any "thin layer" of tooling on top of vanilla web components (like Lit) is entirely capable of passing complex objects as props. String-only "props" are only the case for literal HTML attributes in your source HTML—and even then you can embed JSON in an attribute and get a real parsed object within the component.

Re: Why I don't miss React: a story about using the platform

#82
post #78
post #73

Earlier quoted context omitted.

That’s a pretty funny stance. The library has a gigantic developer share and is supported by a tech giant. A world where React isn’t used and remembered is one where the web isn’t based on the same primitive. The idea of a thin layer on top of JS offering composition is not complex, and the execution by react is still trend setting. Remember when they introduced hooks and now tons of libraries have the same thing? Th…

> The library has a gigantic developer share.. So did jQuery, and that google framework used to create Gmail, what was it called? Oh yeah, nobody cares anymore because they're irrelevant in 2022.

And jQuery is still used in lots of places without any problems AFAIK.

Even if the React development team would stop the framework will for sure be around for a couple more years and receive at least security patches.

Re: Why I don't miss React: a story about using the platform

#83
post #8

If all you need is a couple of basic forms and some basic interaction, you can do it all with vanilla JS but let's not kid ourselves. This will not allow you to build very rich apps without implementing a significant chunk of the frameworks you dislike so much. In fact, I would even say that if this is not a core part of your product, you are simply wasting time and resources. There is a huge amount of man-hours pour…

> without implementing a significant chunk of the frameworks

In my experience, it hasn't seemed all that significant. These frameworks are absurdly general and cover a range of use cases and deployment methods that most people don't use. I just need the kitchen sink, not everything else.

So far, just using custom elements and a small wrapper around the element, I've not been struggling to create the features I need or would otherwise miss.

Re: Why I don't miss React: a story about using the platform

#84
post #78

Earlier quoted context omitted.

> The library has a gigantic developer share.. So did jQuery, and that google framework used to create Gmail, what was it called? Oh yeah, nobody cares anymore because they're irrelevant in 2022.

And jQuery is still used in lots of places without any problems AFAIK. Even if the React development team would stop the framework will for sure be around for a couple more years and receive at least security patches.

jQuery has faded into the background, no longer interesting.

React has too many sharp edges, it'll only be here until something shinier supercedes it.

Re: Why I don't miss React: a story about using the platform

#85

Everything on the web "uses the platform". There's no other way to get content into the browser. Web Components are just a part of that platform, and very badly designed at that. A lot of the platform around them now exists only to patch holes in them (like form participation) and to solve the problems they introduced. And since they are now a part of the platform, they poison everything like upcoming CSS scoping whi…

> talks about lit-html which is a fully incompatible replacement for Polymer.

lit-html is completely different from web components and not meant to replace Polymer. lit-html is a library that just handles rendering and lit-element, which is meant to replace polymer uses lit-html as its renderer to make web coponents.

Re: Why I don't miss React: a story about using the platform

#87
post #46

lit-html is great although at $DAYJOB we ran into some issues with missing linting on them. We now use a JSX renderer that emits plain HTML strings. You get all the ergonomics, the IDE assistance of checking for typos in your attributes, ensuring your closing tags line up, and webpack can flatten it back to plain HTML at compile-time for no run-time __jsx / React.createElement() calls.

Not sure if you're aware of it, or saying it's missing features, but lit-analyzer adds compile-time linting and type checking while lit-plugin provides IDE integration of the tool

Re: Why I don't miss React: a story about using the platform

#88
post #78
post #73

Earlier quoted context omitted.

That’s a pretty funny stance. The library has a gigantic developer share and is supported by a tech giant. A world where React isn’t used and remembered is one where the web isn’t based on the same primitive. The idea of a thin layer on top of JS offering composition is not complex, and the execution by react is still trend setting. Remember when they introduced hooks and now tons of libraries have the same thing? Th…

> The library has a gigantic developer share.. So did jQuery, and that google framework used to create Gmail, what was it called? Oh yeah, nobody cares anymore because they're irrelevant in 2022.

> jQuery

I still see it on resumes today.

> that google framework

Seriously, Google stuff is infamous for being smothered by Google itself, what's your point

> nobody cares anymore

Literally the only non-Google example you could think of is still popular. But jQuery wasn't a graceful idea with a strong implementation, it was a wrapper to alleviate the pain of browser APIs. React is a wrapper to alleviate the pain of JS. Thus my original claim: "[a] world where React isn’t used and remembered is one where the web isn’t based on the same primitives". I don't see that happening soon.

Re: Why I don't miss React: a story about using the platform

#89
post #84

Earlier quoted context omitted.

And jQuery is still used in lots of places without any problems AFAIK. Even if the React development team would stop the framework will for sure be around for a couple more years and receive at least security patches.

jQuery has faded into the background, no longer interesting. React has too many sharp edges, it'll only be here until something shinier supercedes it.

What sharp edges? (This is an honest, curious question.)

I don't find many sharp edges in day-to-day React work. I say this having once been a very strong proponent of framework-less frontends, before trying Vue, then Svelte, and then settling on React.

Re: Why I don't miss React: a story about using the platform

#90
post #51

The section about trusting dependencies, the scenario where they go away, version churn etc doesn't resonate with me in regards to react. I don't know any project in JS-land that is more serious about semver, backwards compatibility and reliable upgrades than react. If facebook dropped the project tomorrow, Vercel alone could probably continue to maintain it well.

Not only that, but so many strong engineering orgs build on React that I can't imagine it degrading very soon. Even if the top contributors left, Facebook imploded, and Airbnb disappeared, I'm quite certain there would be a crowdsourced effort to rescue and maintain the framework.
Post reply on HN