The useEffect hook has subtleties that isn’t obvious at a first glance. For instance, passing callback functions as dependencies to useEffect (that may or may not change on each render depending on the consumer of the component) bit me multiple times.
-
Show this thread
-
Moving on to Next.js. It really helped a lot to quickly get us going (great job
@timneutkens,@rauchg, et al!). I did however put a bit too much trust into getting solid performance right out-of-the-box.1 reply 1 retweet 28 likesShow this thread -
Even though we were doing a lot of things right (server side rendering, http/2, using a CDN, efficient caching, aggressive code splitting, etc.), we were just getting a moderate ~55 points in Lighthouse.
4 replies 1 retweet 33 likesShow this thread -
It was especially the time-to-interactive metrics that was causing issues. Was this what
@slightlylate has been talking about all this time?2 replies 1 retweet 23 likesShow this thread -
I started testing different ideas and there were mainly three things that had a large impact: 1. Moving from React to Preact (+10 points) 2. Carefully optimizing the chunks emitted by Webpack (+15 points) 3. Removing the ads on our landing pages on mobile devices (+15 points)
13 replies 14 retweets 129 likesShow this thread -
Doing this (together with some other smaller things) we ended up with ~98 points in overall performance in Lighthouse.
1 reply 1 retweet 42 likesShow this thread -
It’s worth mentioning that a lot of the things I tested didn’t work out. For instance, removing the custom fonts barely did any difference at all. Make sure you test and validate your changes one-by-one in isolation to understand their impact!
3 replies 2 retweets 75 likesShow this thread -
Thanks for coming to my TED talk
8 replies 1 retweet 173 likesShow this thread -
Replying to @PeterssonJesper @dan_abramov and
Since you're being uncharacteristically public about what it took to get to good (thank you!), is it possible to share roughly how long it took to build vs. fix perf?
1 reply 0 retweets 4 likes -
Replying to @slightlylate @dan_abramov and
Building the site took several months and we did most of the hard-to-change infrastructure things upfront. Fixing the last couple of low hanging fruits (the ones mentioned in this thread) I did over the weekend.
2 replies 0 retweets 3 likes
Thank you! Were you running LH locally? Via Google-hosted instance? Via http://webpagetest.org/easy ? I ask because LH isn't very good about isolating the effects of underlying HW yet.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.