Why We Built a One-Script Architecture
Twelve scripts on your page is twelve points of failure. Here is how we collapsed everything into 2kb.
Most marketing tech is bloated by accident. Each new vendor adds a script tag, a new HTTP request, a new parsing pass. After a few years your site has twelve scripts running and a Lighthouse score in the seventies.
The 2kb constraint
We set a hard limit: the entire client runtime must fit in 2kb gzipped. That ruled out jQuery, lodash, even most polyfills. Anything we couldn't ship in 2kb had to lazy-load, on demand.
What we shipped
A single script that lazy-loads widget code only when triggers fire. Median impact on Lighthouse score: zero. The full widget catalog is delivered as separate, cacheable, lazy-loaded modules — but the core runtime stays under 2kb gzipped.
What we didn't ship
jQuery. React. A bundler runtime. Polyfills for browsers we don't support. Sourcemaps in production. Each of these would have been easy to add. None of them respected the 2kb budget.
Get new posts in your inbox
A new piece each week. No spam, no bots.
Senior engineer at ClickMeMaybe. Builds the runtime, breaks the bytes. 2kb gzipped is the goal.
All posts by this author →Discussion is open to subscribers. Leave your email to get posts and join the thread.
Subscribe to commentThe Exit-Intent Conversion Playbook
Six exit-intent patterns that convert above 6% — and the three that quietly tank your bounce rate.
Sticky Bars vs. Popups: A Field Guide
Both have their place. Here's a brutal honest matrix for when to use each.
Targeting Rules That Actually Move Conversions
Geo + device + scroll depth — the underrated combo that 3x'd our newsletter signups.