Live data from Hacker News

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

jackfranklin.co.uk

141–150 of 279 posts

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

#141

React works well for simple, non-interactive components. Complex, interactive components are going to have state. Stateful components don't work so well in React. If you want to update props in a stateful component, the recommendation is to replace the component entirely by changing its key. At the point all of the benefits of React (preservation of selection, caret position, scroll position etc.) vanish. You might a…

This is categorically false. If you want to update props in a stateful component it is exactly the same - just pass new props. If you instead are talking about syncing props with state, there are ways to do this as well without changing the key, but this is considered an anti-pattern in the first place. This sounds more like bashing react without even knowing it very well in the first place.

> This is categorically false. If you want to update props in a stateful component it is exactly the same - just pass new props.

https://reactjs.org/blog/2018/06/07/you-probably-dont-need-d...

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

#142

Earlier quoted context omitted.

What's there to optimize? If you don't use state, it doesn't rerender. If you click a button to add another element for example, it does exactly that. If you have a reactive variable in your HTML and update it it rerenders that part only. What's there to optimize further?

Depending on the complexity of your computations and state, what you just described can basically become unusable. For example, an app I work on implements a spec which: - Models state as an arbitrary DAG - With arbitrarily deep dependency chains - Which may trigger dependent nodes based on only subsets of their state - Based on computations of arbitrary XPath expressions, sometimes containing non-native extensions;…

>what you just described can basically become unusable

Oh, so like every JS interface ever. :D

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

#143
post #84

Earlier quoted context omitted.

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…

I’m currently job searching and actually came across several mentions of jquery in job descriptions. It’s still alive!

Edit: 3,700,000 downloads per week on npm alone. That’s not a complete or perfect representation of usage, but that’s a significant number

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

#144
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…

> 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 is a classic red-herring argument from developers who have not built anything complex with vanilla js. You can build rich interactions with or without a framework, you’re just making different trade-offs (conventions, learning curve, flexibility, tooling). There is a much larger…

You call the argument a red herring, then name all the reasons people use a framework over vanilla js: conventions, learning curve, flexibility, tooling.

Sure, the browser apis are great and always getting better, but I don't see how that's a reason not to use the framework.

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

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

Or maybe it’s more like saying ICEs will be a ghost one day? EVs were once the path not taken…

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

#146
post #120

Earlier quoted context omitted.

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

What else do you need jQuery for? The most important parts are already included in the browser.

Honestly I bet a significant portion of the code I have maintained (and even some I’ve written) was reinventing a wheel someone didn’t know existed. Not even out of a desire to solve a problem, but simply not realizing it was done already.

I suspect people still reach for jquery for similar reasons. They know it makes complicated stuff work, it’s reliable, they don’t need to think about the specifics of the problems it solves… As a result, they’re less likely to discover that it’s no longer necessary in the first place. They’ll just keep using it.

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

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

I've worked on webapps that are part jquery, part classic angular, part react, and part angularjs.

My opinion of each of those parts has been primarily down to the developers, not the underlying choice of framework.

Things that work in production last.

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

#148

Earlier quoted context omitted.

And why was that a mistake?

IME marrying business logic so closely to presentation makes it very hard to change one without the other. Especially relevant for web apps, where you may want to re-use business logic for mobile apps, which becomes very difficult when they're tied to a react component. Also makes it harder to test. There's a great paper called "Naked Objects" which I'd recommend for anyone doing GUIs, but powerful idea I got from it…

Pawson's Naked Objects thesis is absolutely brilliant.

It proposes a complete approach of which not all of the parts will be useful for any given project, but it is -very- much worth reading even so.

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

#149

Earlier quoted context omitted.

Yeah agreed. The arc of learning seems to be… This is interesting -> this is the best thing in the world -> here’s how this could be better The “use the platform” people have been making this case for web components for at least 5 years now. The reality is WC will take off when and if they are a better alternative and even then they’ll need to be paired with some sort of framework. They may even make their way into R…

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

Then react + mobx also requires you to use mobx's browser tools to debug it.

Note: I say this as somebody who really rather loves react+mobx - but you're not wrong about the trade-off.

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

#150
post #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 comp…

What's the threshold for you, where something needs to be a web component?

Honestly I just like the idea of making my own HTML tags and being able to do more with markup.

Post reply on HN