writing · 11 posts

Notes from the build

Real problems from shipping Shopify apps, and exactly how I solved them — with the code.

Start here6 min read

Building a Shopify Discount App: Engineering Notes

A field guide to the engineering behind a Shopify discount app: Shopify Functions, theme app extensions, token-exchange auth, metafield-driven config, and storefront performance. Links to deep-dives on each problem we solved.

7 min read

A Storefront Cache That Won't Serve Stale Prices (Shopify, 2026)

Caching storefront widget data is easy to get wrong: cache too much and you show stale prices, cache too little and every page re-hits your proxy. Here is the sessionStorage model we use: cache the decision, recompute the number.

7 min read

Embedded Shopify Auth Without OAuth Redirects (Token Exchange, 2026)

Managed installation plus token exchange lets an embedded Shopify app authenticate every request with a session token and zero OAuth redirects. Here is the middleware, the single-retry client, and the cross-tenant pitfalls to avoid.

7 min read

Make a Storefront Widget Survive Any Merchant's Theme CSS (2026)

A storefront widget runs inside someone else's theme, where generic class names and CSS variables collide and element resets destroy your markup. Here are the isolation rules we use: prefixed classes, namespaced tokens, scoped reset, and SVG for icons.

7 min read

One Automatic Discount per Rule: A Shopify Functions Architecture (2026)

Merging every pricing rule into one app discount hides them from merchants and makes scheduling your job. Here is the one-discount-per-rule architecture we moved to, with Shopify Functions, combinesWith, and stale-GID recovery.

7 min read

Optimizing LCP in an Embedded Shopify Admin SPA (2026)

The fastest way to improve LCP in a React SPA embedded in Shopify Admin is to shrink the critical JavaScript path, not shard assets to a separate CDN. Here is the route code-split, vendor chunking, and deferral we shipped, and why domain sharding would have made it worse.

6 min read

Polaris Web Components Gotchas Nobody Documents (2026)

Four Polaris Web Components traps that cost us real debugging time in a Shopify embedded app: dead events inside s-modal, a Save Bar that never saves, inline stacks that wrap form fields, and container queries that silently fall back.

8 min read

Shrink Shopify Metafields: Store Numeric IDs, Not GIDs (2026)

Storing full Shopify GIDs in a JSON metafield bloats it past the size cap and slows the storefront. Here is the numeric-ID pattern we use to cut the payload ~3x while staying backward compatible.

11 min read

Stop Layout Shift in JS-Injected Shopify Widgets (2026 Guide)

JS-injected storefront widgets wreck Cumulative Layout Shift. Here is the SSR-gate plus skeleton-reserve pattern we use in a Shopify theme app extension to hydrate widgets with near-zero CLS.

6 min read

The Shopify Validation Function Config Path That Hid a Bug (2026)

A Shopify cart validation function read its config from input.cart.validation instead of input.validation, so it silently never enforced. Worse, the test fixture was shaped to match the bug. Here is the fix and the testing lesson.

6 min read

The Sticky-Column Trap: When position:fixed Renders Behind Everything

A position:fixed modal opened from inside a sticky two-column layout can render behind the other column. Here is why position:sticky creates the stacking context that traps it, and the two ways out.