Live data from Hacker News

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

jackfranklin.co.uk

11–20 of 279 posts

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

#11
> But the web platform isn't perfect, and I suspect most React developers have come across a situation where you’d love to be able to just tweak how your component is being rendered.

Honestly, I haven't. The only potential caveat I can think of is when you have some non-reactive legacy code you want to embed inside a React component... but even then React's escape hatches are more than sufficient.

If you're really worrying about when your component renders or re-renders it's probably because there are other issues with your app.

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

#12
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 which instead of being a straightforward thing now has to account for all the web component insanity.

Edit. There also so many thing wrong in the article that argh.

"We don't need React and dependencies"... and then talks about lit-html which is a small framework with custom syntax and constraints on how you can use tagged literals.

"Easily replaceable dependencies"... and again talks about lit-html which is a fully incompatible replacement for Polymer. I wonder how folks that used polymer (Youtube) feel about "easy replacements".

"Can't control rendering with React" and talks about Web Components which literally give you no control over when a component can be rendered, don't have lazy loading, cannot subclass SVG or embed partial SVG etc.

And so on and so on...

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

#13
post #9

My ad for web components: btw I used to use react

> Firstly, because some people on the internet like to get angry over opinions that may not match their own, I want to make clear what this blog post is not:

> It is not a call for everyone to immediately drop React and move to web components.

> It is not a blog post declaring React “dead”, or the wrong choice for every project.

> It is not a blog post declaring web components the best solution to all projects.

You might want to consider how well the phrase, "Haters gonna hate," applies to your comment.

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

#14
> 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.com/en-us/fluent-ui/web-components/in...).

In this single case they replaced a couple validation functions with attributes. Good to move that direction but if that's all you use React for then yeah, you might not miss it much.

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

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

> of the frameworks you dislike so much

This is totally uncalled for. He's not attacking you. He's explaining a tradeoff, very reasonably.

> I would even say that if this is not a core part of your product, you are simply wasting time and resources.

I find especially interesting that this phrase can be used to defend both sides of the argument. If you are building a highly rich application, chances are that using a framework for that is the right choice, agreed.

But.

Not all the apps being build out there need to be Very Rich Apps. There's indeed a lot of space for only-slightly-rich-but-mostly-static apps, despite the recent HN article.

And for those, introducing a framework is ... precisely, a waste of time and resources.

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

#16
post #15
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…

> of the frameworks you dislike so much This is totally uncalled for. He's not attacking you. He's explaining a tradeoff, very reasonably. > I would even say that if this is not a core part of your product, you are simply wasting time and resources. I find especially interesting that this phrase can be used to defend both sides of the argument. If you are building a highly rich application, chances are that using a f…

> This is totally uncalled for. He's not attacking you. He's explaining a tradeoff, very reasonably.

What? I don’t see how “dislike” would describe anything other than some kind of preference. I don’t see how it’s an attack.

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

#17
There's pointers here to interesting new things which I'll have to learn more about.

One of the core values for React for me is simply code structure - organising things into a hierarchy of elements seems to make sense - I found that hard to replicate when I once tried to build a vanilla js application.

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

#19
post #11

> But the web platform isn't perfect, and I suspect most React developers have come across a situation where you’d love to be able to just tweak how your component is being rendered. Honestly, I haven't. The only potential caveat I can think of is when you have some non-reactive legacy code you want to embed inside a React component... but even then React's escape hatches are more than sufficient. If you're really wo…

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.
Post reply on HN