JavaScript & TypeScript
Modern JavaScript and TypeScript techniques, type safety patterns and end-to-end testing with Playwright.
TypeScript Strict Mode: What It Turns On and the Flags It Still Misses
TypeScript strict mode turns on nine checks, and since TypeScript 6.0 it’s on by default. Here’s what each strict flag catches, the extras it skips like noUncheckedIndexedAccess and exactOptionalPropertyTypes, how to migrate an older codebase one flag at a time, and how to confirm your real config with tsc –showConfig.
Web Workers: How to Move Heavy JavaScript Off the Main Thread
Long JavaScript tasks block clicks and hurt INP. Here’s how I move heavy work into a Web Worker: creating a module worker, postMessage and structured clone costs, transferring ArrayBuffers, error handling, bundler setup, and when scheduler.yield() is the better fit.
Zod Validation in TypeScript: Check API Data at Runtime Before It Breaks Your UI
TypeScript types vanish at runtime, so a bad API response can still crash your UI. How to use Zod validation with safeParse for API data, forms and env vars, plus the coercion gotcha.
Mock Service Worker (MSW): API Mocking for Tests and Local Development
How I use Mock Service Worker to mock APIs at the network level: Vitest setup, realistic handlers, five UI states to test, and browser mocking in dev.
The HTML dialog Element: Accessible Modals Without a Modal Library
How I replace custom modal libraries with the native HTML dialog element: showModal(), ::backdrop, form method=dialog and a focus checklist.
TypeScript satisfies Operator: Type-Safe Config Without Losing Inference
Type annotations quietly widen your config objects. Learn how the TypeScript satisfies operator and as const give you strict checks and precise inferred types, with real patterns and common mistakes.
Playwright Testing in 2026: Catch Broken User Flows Before Clients Do
Learn Playwright end-to-end testing in 2026: role-based locators, web-first assertions, auth storage state, API seeding, traces, and CI that catches broken user flows before clients do.
TypeScript Discriminated Unions in 2026: Make Impossible UI States Unrepresentable
Learn TypeScript discriminated unions in 2026 — model UI state machines, narrow with switch, exhaustiveness via never, and stop shipping impossible loading/error/success combinations.
AbortController in 2026: Cancel Fetch Requests Before They Waste Bandwidth
Learn AbortController in 2026 — cancel fetch requests, race timeouts with AbortSignal.timeout, wire React cleanup, and stop wasted bandwidth from stale async work.