Live data from Hacker News

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

jackfranklin.co.uk

91–100 of 279 posts

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

#91

Really enjoyed this article. Web components seem promising, I played around with them a bit but I found it difficult dealing with global styling (ie, how do I make my component have the same colour scheme as everything else?). Probably worth looking into again. I also concur with the author about lit-html. It does one thing and does it really well, easy to understand, and no transpiling needed. Can't recommend it eno…

I've come to the conclusion that web components (with or without shadow roots) are not the best "elementary particle" to build a webapp out of. Most of the time you want simple divs and sometimes you want custom-tag. The important thing is to have a setup where you can quickly promote a component into a web component proper. I think solid.js has a nice solution this, where you just call a function that wraps the component into a web compoent and registers a tag for it.

One issue I have with lit is that it just forces you to turn everything into a web component instead of a carefully deliberated choice.

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

#92
post #45

It’s bizarre to see the author waxing poetic about the small size of lit-html when it’s actually no smaller than Preact.

FWIW preact is 4kb minzipped (+ 700 bytes for htm package templating) while lit-html is 3.3kb minzipped.

Author also talks a lot about the issues with losing control of the component model when using preact

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

#93
post #72
post #69

Earlier quoted context omitted.

> There is a huge amount of man-hours poured into making these frameworks work correctly under any condition. The path is littered with the ghosts of frameworks past. Don't let the current efforts or trends convince you that we're done with this process. React will be a ghost one day.

That's like saying I should use a steam engine today because the electric motor will be superseded someday.

I said no such thing.

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

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

> jQuery has faded into the background, no longer interesting.

It’s a mature, stable technology, still in wide use - and not really a competitor with react. That you claim it’s “no longer interesting” says more about your own preferences and ironically makes it sound that you are personally interested in the newest shiny fads - so I’m confused, what is your objection to react then?

Angular isn’t exactly dead - and is a more apt comparison.

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

#95
Whenever I see a few internal apps made with React/Vue, they would miss super basic features such as highlight-able text or canonical permalinks.

It got me thinking, why these frameworks make simple things difficult?

Note that I am a backend/infra engineer (but I am able to build complex web app using jQuery back in the old days.) so I may be missing something here.

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

#96

> Was this slightly more work than using a library from npm? > I'd definitely recommend using a library for this, and we settled on lit-html (link to library from npm) This article is mostly about switching from React to Lit. You can use modern web APIs (like FormData) with React, FormData's not a replacement for state management. You can use Web Components with React, the way Fluent UI does ( https://docs.microsoft.…

> This article is mostly about switching from React to Lit.

I'll freely admit I'm a backend guy and don't know much about JavaScript frameworks, but the author emphasizes they didn't use Lit, just lit-html, and for the same reasons they didn't use React.

Is lit-html really such a huge portion of Lit that you disagree with their own assessment of what they've done?

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

#97
post #93
post #72

Earlier quoted context omitted.

That's like saying I should use a steam engine today because the electric motor will be superseded someday.

I said no such thing.

You implied it. What you should have alluded to is that it is necessary to use technologies today that won’t necessarily be in use in the future, merely as a stepping stone to get us to the next destination, where we will use a new but still temporary technology.

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

#98

Earlier quoted context omitted.

React very much feels like its own platform to me - having its own browser tools to debug it is a dead giveaway.

I think it feels that way because it’s a bit of a paradigm shift in terms of the way we think about building user interfaces, but the reality is its just javascript running in a browser. I’ve been writing react over 10 years and used to devtools just a handful of times. They’re by no means necessary. I used to use an extension for jQuery to quickly find css selectors. Nobody was saying we weren’t using the platform t…

Yes react is an odd one to me. I prefer to program in a somewhat functional matter - separating pure code from things that mutate state, or render things to the screen. React pushes me away from that, instead encouraging me to mix state, rendering and templates all in the same part of the code, though they do provide a functional facade.

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

#99

Earlier quoted context omitted.

The only case I have is I love to use D3 for vis. But the thing is it's trivial to embed D3 into a react component and either let react handle rendering via svg or honestly just let D3 take over the DOM in that component. I do this all the time and it works very well.

Does d3 have a typescript wrapper?

As in a wrapper with an API more geared towards statically typed usage? Or just type definitions for the existing D3 APIs? The former is really uncommon (or at least not a particularly commonly idiom), but the latter is typically a quick search for @types/${packageName}. If that’s what you’re after, I was curious and saved you a search, because it would be quite surprising to me if something as popular as D3 was missing type defs: https://www.npmjs.com/package/@types/d3

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

#100
post #97
post #93

Earlier quoted context omitted.

I said no such thing.

You implied it. What you should have alluded to is that it is necessary to use technologies today that won’t necessarily be in use in the future, merely as a stepping stone to get us to the next destination, where we will use a new but still temporary technology.

I think op was suggesting someday we’d be on hoverboard or something
Post reply on HN