Skip to content
NewProduct Q&A: shoppers ask on your product page and get your answers.See how it works
IdukkiIdukki
Embedding

Inside the widget speed program: cutting our embed JS by two thirds

A UGC widget lives on someone else’s storefront, so every kilobyte is borrowed. Here is what we cut and what we measured. Plus the new dashboard that shows what your shoppers’ browsers experienced.

Open your product page on a phone, on mobile data. Our widget loads beside your theme, your analytics and a dozen other scripts. Every kilobyte it adds comes out of your Core Web Vitals. We spent a sprint cutting it back. This is the ledger of what we found and what we changed.

In this article

An embedded widget is a guest. The storefront already carries a theme, analytics, a consent manager and a dozen other scripts. The merchant’s Core Web Vitals pay for all of it. We have always engineered against that budget. It is why the widget code-splits every gallery layout. But a deep audit this month found real waste left on the table. This piece walks through the ledger: every line item and the measured saving. Then come the two changes that matter more than the kilobytes.

The ledger: what we cut

ChangeBeforeAfter
Icon library replaced with generated inline SVGs13.9 KB + 1 requesttree-shaken, ~0
React runtime swapped for a compatible 4 KB core45.1 KB9.7 KB
Product modal loads only this session’s variants27.9 KB22.6 KB
Chunk files on the CDN148 files136 files
Critical chunks discovered late (extra round trip)4 chunks0
Measured on production builds, gzipped sizes. Items ship independently through August 2026.

Two items deserve a word. The icon change sounds trivial and is not. Our 87 icons pulled in a 40 KB vendor bundle. The actual path data was about 3 KB. So we generated our own components once and deleted the dependency. The modal change is about fairness across devices. A desktop shopper was downloading the mobile bottom-sheet. A Shopify store was downloading the WooCommerce panel. And everyone was downloading one customer’s demo dataset. Each variant now loads only where it can actually render.

JavaScript on the critical path, gzipped

  • Before the program
    ~122 KB
  • After the full program
    ~44 KB
  • Lite mode, to paint a grid
    ~4.5 KB
Measured on production builds, August 2026. Lite mode is opt-in.

The bigger win: loading nothing

Bundle size is the second-order problem. The first-order problem is loading code on pages that will never show content. Take a product page whose product has no tagged posts. It used to download the entire widget, mount it, find the empty response, and hide. The loader now remembers which galleries came back empty. It races first visits against the data response. It skips the bundle when there is nothing to paint. Galleries deep below the fold wait for an intersection observer. They no longer tax initial page load.

~4.5 KBJavaScript needed to paint a grid in the new opt-in lite modeLoader plus a self-contained renderer; the full app hydrates on first interaction or browser idle.

Want to go further? An experimental lite mode paints the grid from the data response alone. The interactive app arrives lazily afterwards. It is a flag on the embed div. It fails open in every path we could think of. The honest end state of a widget speed program is first pixels that cost almost nothing.

Mobile apps: a supported path, not a shrug

Customers kept asking whether the widget works inside their native apps. The truthful answer was “usually, with sharp edges”. WebViews silently drop window.open, so product taps did nothing. Some ship with storage disabled. Both edges are now handled. Every outbound tap goes through a single exit point. It can send a structured event to React Native, WKWebView or Android. No popup opens. Storage degrades gracefully. A diagnostic panel tells support exactly what that WebView allows. Add idk_appcheck=1 to any URL inside the app to open it. None of this changes anything for regular web embeds; the bridge is strictly opt-in.

Proof over promises: the Performance page

Lab benchmarks flatter everyone. The number that matters is what your shoppers’ browsers measured on your pages. So the widget now sends a small sampled beacon to a new Performance page. It covers time to first tile, data latency, LCP and layout shift. You see your own percentiles, the trend over time, and mobile against desktop. You also see how you compare with the fleet-wide benchmark across all Idukki widgets. When we say the widget got faster, you should be able to check.

#performance#widget#core-web-vitals#engineering

Continue reading

1 piece in this cluster

These long-form pieces on the Idukki blog link back to this article, go deeper on the cluster.

More from Rohin Aggarwal