Hacker News new | ask | show | jobs
by srk_hn 1408 days ago
Can someone tell me why this page needs 13MB of resources to display?
5 comments

It'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.
My 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.
This page doesn't know if it is an app or blog post then! Maybe it should lazy load those resources?
Here are the top requests by file size from the page, screenshotted since I couldn't easily copy/paste: 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!

Now that is how you start a flame war in the most subtle way possible.
When 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!