Dev removes 7.2 KB of framework bloat, cuts first-paint JS from 11.2 KB to 1.2 KB
A developer building a browser-side file-conversion tool discovered that 64% of their first-paint JavaScript — about 7.2 KB — came from the Preact framework rather than their own product code. They had set an internal 20 KB size budget, but it was measured against a baseline that already included significant framework overhead, making the warning threshold misleading. After auditing the breakdown, the developer replaced the Preact-based island architecture with a build-time HTML render plus a lightweight vanilla runtime script. The change reduced first-paint JavaScript from 11.2 KB across five files to just 1.2 KB in a single file, completed in roughly one day. The author notes the harder follow-up task was ensuring the measurement tooling itself accurately reflected all script weight, including inline scripts previously invisible to their size checker.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in