3 ms·
Can someone tell me why this page needs 13MB of resources to display?
by srk_hn 4y ago
Can someone tell me why this page needs 13MB of resources to display?
- fabian2k 4y agoIt's even more for me, it looks to me like the embedded React sandboxes are essentially full React apps in development mode. So none of the usual optimizations for size are active, and you get the full devel-mode bundle for several React applications on this page.
- MH15 4y agoMy guess is for the code editors and associated transpiler. The demos allow you to edit the code in JSX, requiring the tooling. Kinda impressive imo.
- quickthrower2 4y agoThis page doesn't know if it is an app or blog post then! Maybe it should lazy load those resources?
- neon_electro 4y agoHere are the top requests by file size from the page, screenshotted since I couldn't easily copy/paste: https://imgur.com/N1ANEIb https://imgur.com/N1ANEIb Would love to better understand why the site is pulling in the Babel transpiler in production? Edit: siblings know more than me, thank you siblings!
- rajangdavis 4y agoWhen I checked it was 46MB! Looking at the network tab, it seems to be making a bunch of extra requests for the same assets. I know that Vercel/Next.js will lazily load in certain JS chunks but there seems to be some mechanism that is loading a ton of stuff up front. Edit: from other comments in this thread, it's the sandbox code, really crazy how much overhead that adds to the page!
- AtlasBarfed 4y agoNow that is how you start a flame war in the most subtle way possible.