Live data from Hacker News

Etsy Moves from React to Preact

github.com

11–20 of 71 posts

Re: Etsy Moves from React to Preact

#11

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.

I’ve migrated from react to react and it was a breeze

Re: Etsy Moves from React to Preact

#12

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.

No post body was provided.

Re: Etsy Moves from React to Preact

#13

> 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

In theory it shouldn't matter but you can SSR with React if that's important.

Re: Etsy Moves from React to Preact

#14

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.

You optimize what you measure

Re: Etsy Moves from React to Preact

#16

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

> The unreasonable effectiveness of PHP

It's feels almost as if... PHP was made for this web stuff. What a lucky coincidence!

Re: Etsy Moves from React to Preact

#17
post #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…

I've helped teams move from Angular to web components. It's much easier than any other alternative. The data flow just works in Angular 2, though sometimes requires a directive in Angular 1.

Re: Etsy Moves from React to Preact

#18

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.

Speaking from building both react and Preact sites serving millions of customers - the difference is noticeable when you add everything up.

Minification or not, starting with a 6x bundle size puts you in a precarious position to have to care more about how it grows over time adding other assets.

Downloading, parsing and then executing a larger bundle size will impact performance and we've been able to see time to interactive impact conversion on e-commerce sites. However you are right that there are many other factors at play here that will make the site better and I think the post misses the point about "bundle size".

The important differentiation for us with Preact is two things: native support for web components, and a significantly faster library when it comes to transformations and dealing with vdom - see here https://rawgit.com/krausest/js-framework-benchmark/master/we...

On your comment about browser cache, also true but it really depends - if you haven't appropriately split out your bundle then returning users will probably be redownloading react again and again with app updates. Also new users are super important because if you are trying to get new traffic you care about their experience not just returning users.

Re: Etsy Moves from React to Preact

#19

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.

> the first page load ... a lot of users would have React in their browser cache anyway

Not on the first load. If you mean that it will be cached from other sites through the same CDN, then that's also unfortunately not true anymore since cache partitioning [1].

[1] https://www.peakhour.io/blog/cache-partitioning-firefox-chro...

Re: Etsy Moves from React to Preact

#20

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.

As sibling comments mention, cache partitioning means there's no way for react to be shared, but even without cache partitioning react apps are usually bundled into 1 file with all the dependencies inlined, which stops caching from being useful across sites anyway.
Post reply on HN