Live data from Hacker News

Etsy Moves from React to Preact

github.com

1–10 of 71 posts

Re: Etsy Moves from React to Preact

#3
> We ran into an error which took us 2 days to track down to a library, and you may find the same.

Fun times! Preact is React until it isn't. No reason to assume that won't happen again, by the way.

Once upon a time I had some people who wanted to include Preact because it's so small/dependencies/etc. Then they bitched because it wasn't React. Ay yi yi.

Re: Etsy Moves from React to Preact

#4
I agree, I don't think there is a compelling reason to use react instead of react.

Every time I migrated a client most engineers didn't even notice and you just saved shipping a heavy bundle.

Compatibility is really good, most third party components work and the few which don't are covered by alternative implementations.

Re: Etsy Moves from React to Preact

#5
> One important piece of context is that Etsy currently has two major product stacks. For buyer-facing pages, we use PHP server-based rendering with jQuery/vanilla JS on the client to stitch things together. For our seller-facing pages and many of our internal tools, we use React-rendered SPAs with minimal server-based HTML rendering, receiving data from the same PHP server-side stack.

The unreasonable effectiveness of PHP

[EDIT] Just to add content to foster actual on-topic discussion —- is it likely that Etsy will be the only ones taking this off-ramp from React proper? Seems like the v15 -> v16 jump is onerous

Re: Etsy Moves from React to Preact

#8

> One important piece of context is that Etsy currently has two major product stacks. For buyer-facing pages, we use PHP server-based rendering with jQuery/vanilla JS on the client to stitch things together. For our seller-facing pages and many of our internal tools, we use React-rendered SPAs with minimal server-based HTML rendering, receiving data from the same PHP server-side stack. The unreasonable effectiveness…

I imagine the client facing pages are very sensitive to seo/crawling so that's why they go for server side rendering

Re: Etsy Moves from React to Preact

#9
post #6

Does anyone know how to get off Angular?

The only way is rewriting the front-end in a different framework. If you can, you probably should do it all at once.

If doing it all at once is too much work, you can look at web components as a technology to have both in the same page. Angular elements allows wrapping angular code and putting it inside another framework. Angular also makes it easy to embed web components into its pages, so you could rewrite piece by piece in a framework that supports creating web components, like vue.

The real challenge with the piece by piece approach is managing data flow and component lifecycle across the frameworks, and doing that requires codebase-specific solutions.

Re: Etsy Moves from React to Preact

#10
One thing I don't understand about the JS ecosystem in general is the focus on minified size. This article does the same thing: preact is 6k or so whereas react is 36k.

This comparison seems entirely pointless when the first page load downloads multiple megabytes of assets and, additionally, a lot of users would have React in their browser cache anyway.

Post reply on HN