Performance Issues with Large Data in window.history.state

TL;DR: Storing full collection data in window.history.state is expensive (serialization time, retained memory, and browser size limits). Prefer storing cursors/params and keep large data in an in-memory cache keyed by URL; use sessionStorage/IndexedDB if persistence is required. I’ve found an interesting issue with the Shopify Hydrogen component because it saves all nodes on a page in window.history.state as you can see in this line. For the particular website I am working with at the moment, the collection page has quite a bunch of data. When I tested, showing about 100 products on the page meant having ~8MB for the serialized version of the object using JSON.stringify. Deserialized structures also incur engine overhead (object headers, indices). The Pagination component from Shopify that we use does many things, but what I want to emphasize is that it saves the collection data in window.history.state: ...

September 18, 2025 · 4 min

My Bun Migration Story: From CI to Local Development

My Experience with Bun I’ve been using Bun for a while now. The first time I’ve heard about it I thought it was cool that it uses JavaScriptCore instead of V8 and that I could use it as a drop-in replacement for npm install. As a web developer working on Shopify Hydrogen apps, I ended up just staying with the project defaults, which meant npm. Moving CI to Bun However, as we added more steps to our CI, like additional lint rules, I noticed the pipeline slowed down significantly. In particular, I observed that our dependent steps spent substantial time on the installation phase. Due to that, a year or so ago I decided to experiment with Bun on our CI for all our steps, including deployment. ...

September 13, 2025 · 3 min