
Debouncing and Throttling in React the Right Way
Why naive useEffect timers leak, how to build a reusable useDebounce hook, and how to clean up debounce and throttle on unmount in React.
Blog
Articles on Next.js, React, TypeScript, and modern web app architecture — performance, SEO, and real-world frontend engineering patterns.
64 articles

Why naive useEffect timers leak, how to build a reusable useDebounce hook, and how to clean up debounce and throttle on unmount in React.

Two architectures for shipping less JavaScript — RSC's server-render boundary versus the islands model in Astro and Qwik — and how to choose.

How TanStack Router gives you typed params, validated search state, and route loaders — and why file-based routing beats hand-wiring the tree.

Valibot ships a schema in about 1.3 kB while Zod carries roughly 13 kB — here is why the modular pipe design tree-shakes and Zod's method chaining does not.

Heavy CPU work freezes React at 0fps. Here is how I move it to a Web Worker with Comlink, when a worker beats a server call, and how to hold 60fps.

Zod 4 rewrote the validation core for speed, added a 1.9 KB tree-shakable mini build, and reshaped error handling — here is what changed and how to migrate.

How to generate a unique Open Graph image for every blog post at request time using Next.js ImageResponse and Satori, without shipping a design tool.

How to wire React Hook Form to a Zod resolver, share one schema between client and server, and get clean, type-safe error handling for free.

An honest comparison of Zustand and Redux Toolkit for React apps in 2026 - boilerplate, devtools, bundle size, and why server state usually belongs in TanStack Query instead of either one.

Use streaming SSR and React Suspense in Next.js to ship pages that feel instant, with loading.tsx, granular boundaries, and parallel data fetching that kills request waterfalls.

A field guide to fixing Interaction to Next Paint by breaking up long tasks, yielding to the main thread, and measuring real-user responsiveness.

Why the shadcn/ui own-your-code model beats a component dependency, and how Radix primitives plus Tailwind tokens scale into a real design system.

Combine TanStack Query with React Server Components: prefetch on the server, hydrate on the client, and stop shipping duplicate requests.

A practical tour of React 19's use() hook and Actions: how useActionState and useOptimistic replace manual loading, error, and pending state boilerplate.

Most real-time features only push data one way. Here is when Server-Sent Events beat WebSockets in Next.js, and how to stream them from a route handler.

Partial Prerendering lets a single route ship a prebuilt static shell instantly while personalized, request-time content streams into Suspense boundaries in parallel.

A developer's technical SEO checklist from shipping a bilingual Next.js site: canonical strategy, bidirectional hreflang, structured data, and sitemaps that work.

Inside the next/image pipeline: how srcset gets generated, how AVIF and WebP are negotiated, where the optimizer cache lives, and the misuse that wastes it all.

How to build a color, spacing, and typography token system in Tailwind v4 that turns a full rebrand into a one-line change instead of a two-week grep.

FOUT, FOIT, subsetting, variable fonts and what next/font really does under the hood — a practical guide to making web fonts fast instead of a render tax.

What actually runs where in React Server Components: the module-graph boundary, the serialization wall, and a four-step rule for when to add use client.

Server Actions kill API-route boilerplate, but they are public POST endpoints. My production playbook for forms, Zod validation, and the security footguns.

A practical guide to achieving perfect Lighthouse scores on a Next.js landing page — from LCP to CLS to INP.

Beyond the tutorials: a battle-tested folder structure and tsconfig setup for TypeScript projects that scale without becoming a maze.

How I translate Figma designs into production-ready Next.js components without losing fidelity or wasting time on guesswork.

A first-hand guide to setting up next-intl in a Next.js App Router project — covering routing, server components, client components, and the gotchas I hit in production.

A battle-tested folder structure for Next.js 15 App Router projects that scales from side project to production SaaS.

A realistic day-by-day roadmap for solo developers to ship a working SaaS product with auth, payments, and email in one month.

How to wire NestJS, Prisma, and class-validator together so TypeScript type errors catch bugs before they reach production.

A practical checklist covering Next.js Metadata API, Core Web Vitals, JSON-LD structured data, sitemaps, and i18n SEO in one place.

A side-by-side comparison of TanStack Query and SWR for data fetching in Next.js — with real code examples for mutations, caching, and SSR.
How RUM gives you the actual performance numbers your users experience — and why Lighthouse scores alone are misleading.
A practical guide to Next.js image optimization — the formats, the config, and the real-world results from optimizing matthewswong.com.
A decision framework for choosing between ISR, SSR, and SSG in Next.js App Router — with real performance numbers and the configs I ship.
How connection pooling works, why your NestJS app will eventually exhaust PostgreSQL connections, and the PgBouncer config I run in production.
How tsvector and GIN indexes make PostgreSQL a capable search engine for small-to-medium datasets — and when you actually need Elasticsearch.
Why offset pagination falls apart on large datasets and how to implement cursor pagination in a NestJS API that stays fast at any page depth.
How to implement URI-based API versioning in NestJS without breaking existing clients — with the controller patterns and migration strategy I use.
An honest comparison of GraphQL and REST — adoption data, performance benchmarks, and the framework I use to choose between them.
How to set up @nestjs/swagger so your API documentation is generated from code and never goes stale — with the decorator patterns I use.
The rules for NEXT_PUBLIC_ vs server-only variables, how to validate at startup, and the secrets management setup I use in production.
How to set up Playwright for a Next.js app, write tests that don't break on every deploy, and run them in GitHub Actions CI.
How to audit Next.js apps for accessibility issues using axe-core and Playwright — with the workflow that catches 57% of WCAG violations automatically.
How to audit npm dependencies for vulnerabilities, manage update debt, and protect your project from supply chain attacks.
The complete security headers configuration for Next.js — CSP, HSTS, X-Frame-Options, and the nonce-based approach for inline scripts.
How to implement dark mode in Next.js with next-themes, avoid the dreaded flash of unstyled content, and persist user preferences correctly.
A data-driven comparison of Vitest and Jest for Next.js applications — with benchmarks, setup examples, and an honest guide to which testing framework you should choose in 2025.
How to use Storybook to document React components, create interactive showcases, and build a design system that stays in sync with your actual codebase.
Hard-won lessons from migrating a production Next.js app from Pages Router to App Router — what breaks, what shines, and what I'd do differently.
A pragmatic comparison of Tailwind CSS and CSS Modules — download stats, DX, performance, and when each approach actually wins.
A production-tested comparison of Prisma and TypeORM for NestJS applications — type safety, migrations, developer experience, and real npm download data.
A real comparison of NextAuth.js and Clerk for Next.js authentication — pricing, DX, features, and when each makes sense for your project.
A practical guide to WebSocket Gateways in NestJS with Socket.io — rooms, namespaces, Redis pub/sub for scaling, and JWT authentication.
How to implement secure, scalable file uploads to AWS S3 from Next.js using presigned URLs — no files passing through your server.
A practical comparison of Resend and Nodemailer for transactional email — deliverability, developer experience, pricing, and when to use each.
A direct comparison of Next.js Route Handlers and NestJS for backend development — when each is the right tool based on real production experience.
Why TypeScript strict mode belongs in every production codebase — the bugs it catches, the gotchas it surfaces, and how to enable it on a legacy project.
A practical guide to React Server Components in Next.js 15 — what they actually change, when to use them, and the patterns that make them powerful.
Practical Next.js middleware patterns for authentication guards, i18n locale detection, A/B testing, and security headers — with code and gotchas.
A practical comparison of Framer Motion and pure CSS animations — bundle size, performance, DX, and my real experience using both on matthewswong.com.
How to set up a production-ready Turborepo monorepo with Next.js frontend, NestJS backend, and shared TypeScript packages.
How to implement distributed rate limiting in NestJS using @nestjs/throttler and Redis — protecting your API from abuse at any scale.
A complete guide to error handling in Next.js App Router — error.tsx, not-found.tsx, global error boundaries, and patterns for production resilience.
Integrating BPJS Ketenagakerjaan and BPJS Kesehatan APIs into Indonesian HR and payroll systems — authentication, endpoints, error handling, and the undocumented gotchas.