How I migrated a large Next.js project from Tailwind CSS v3 to v4
A practical walkthrough of the Tailwind CSS v4 migration in Next.js: CSS-based config, dropped utilities, PostCSS changes, and rough edges I hit in production.
Tag
Web performance techniques for Next.js and Sanity — Core Web Vitals, LCP, INP, bundle size, and edge caching strategies.
20 posts
A practical walkthrough of the Tailwind CSS v4 migration in Next.js: CSS-based config, dropped utilities, PostCSS changes, and rough edges I hit in production.
Deep dive into advanced GROQ queries in Sanity: inline joins, coalesce, conditional projections, and array flattening with real payload sizes measured.
An honest look at Next.js partial prerendering PPR in production — what it solves, where it breaks, and which page patterns benefit most.
A step-by-step walkthrough of Next.js bundle size analysis and reduction: finding large imports, fixing vendor chunks, and trimming icon libraries.
Using Sanity's auto=format with next/image correctly avoids double-encoding and wasted bytes. Here is the exact setup I use in production.
A practical walkthrough of Next.js bundle size analysis using @next/bundle-analyzer, with before/after numbers from a real project.
Step-by-step guide to Mux video in Next.js and Sanity CMS: plugin setup, direct uploads, signed playback URLs, and poster images for fast LCP.
A practical guide to wiring up Vercel Analytics and Speed Insights for real-user Core Web Vitals monitoring in Next.js, with a workflow for catching regressions fast.
A practical Next.js App Router tutorial guide for 2026. Covers layouts, route groups, Server Components, data fetching, and the metadata API.
A step-by-step approach to identifying orphaned schemas, measuring Studio bundle impact, and safely removing dead document types without breaking production.
A pattern for projecting only the fields your Next.js components actually render, using GROQ coalesce and select operators to prune unused blocks.
A pattern for structuring Sanity references and GROQ projections that eliminates query waterfalls in server components, cutting fetch latency by 200–400 ms.
Cut LQIP overhead on Sanity + Next.js sites from 48 kB to under 5 kB. The production pattern, with the exact GROQ and Image component code.
A singleton pattern for i18n navigation that keeps GROQ queries fast and avoids embedding nav arrays in every document fetch.
Denormalising references and embedding common fields in Sanity schemas cuts server component render time by 40–60%. Here's the pattern I ship.
Combining Next.js Partial Prerendering, edge runtime, and selective Sanity queries to hit sub-200ms TTFB on content-heavy pages without stale data.
Portable Text blocks can bloat client bundles. Here's how I defer serializers with dynamic imports and RSC boundaries to keep marketing pages under 80 kB.
INP is responsiveness. Learn how to find long tasks, profile React re-renders, reduce main-thread work, and ship fast interactions consistently.
LCP is usually one big image. Here’s how to identify the true LCP element, reduce TTFB, ship the right image bytes, and consistently hit <2.5s on real devices.
Core Web Vitals affect rankings, conversions, and perceived quality. Here’s what each metric means, target thresholds, how to measure, and the fixes that move the needle.