My primary use case: drop a webpack stats file → see why exactly that specific huge file is bundled.
4) web-vitals-report.web.app builds a Core Web Vitals report based on your Google Analytics data (but you need to send CWV data into GA explicitly).
Haven’t had a chance to use it yet (don’t collect CWV data with GA), but should be a great helpful tool for some clients.
5) Also, datastudiohelp.com/core-web-vital… explains how to get a Core Web Vitals report in Google Data Studio. (It’s actually quick! Just clone a template and change the url.)
Unlike with the previous tool, you don’t need to collect any data yourself! The report uses CrUX data.
6) usehooks.com/useWhyDidYouUp… is a React hook that prints why a specific component rerendered. Just copy and paste it! Perfect for debugging runtime performance of a single component 💅
7) meowni.ca/font-style-mat… (yet another tool by @notwaldorf!) lets you find a fallback font that matches your custom font as closely as possible.
If you ever had a high CLS score because the layout jumped after a custom font loaded, this is for you.
(Oh, and shameless plug: in addition to these tools above, I also have a GitHub list with 50+ webpack performance tools and plugins: github.com/iamakulov/awes…)
8) glyphhanger, which makes fonts smaller by removing any characters your page doesn’t need (and more). And it’s a one-line command!
Gah I’m really excited about <Suspense> and hydration in React 18.
With React 16-17, `.hydrate()` is often the most expensive JS call in the whole app. You start hydrating the app – and the page freezes for, like, a second:
In React 18, `.hydrate()` is still expensive by default.
But! If you wrap parts of the app (or the whole app) with <Suspense>, React will take these parts – and instead of hydrating them in one go, will hydrate them in chunks, 5-10 ms at a time:
Under the hood, React uses performance.now() and isInputPending() APIs to check how long rendering takes. If rendering takes more than 5-50 ms, or if isInputPending() returns `true`, React pauses rendering and yields to the browser.
Spotify is an Electron app, meaning we can use Chrome DevTools to profile it. To enable Chrome DevTools in Spotify, I install `spicetify` and run `spicetify enable-devtools`.
Yay!
Now, let’s go to Chrome DevTools → Performance → Record, switch between playlists a couple times, and stop the recording. This is what we’ll get ↓