1. Home
  2. Blog
  3. JavaScript & TypeScript

JavaScript & TypeScript

Modern JavaScript and TypeScript techniques, type safety patterns and end-to-end testing with Playwright.

Flat vector illustration of a tsconfig settings panel with a row of toggle switches, most switched on in black, while an orange-red magnifying glass highlights two extra switches that sit outside the main group and are still off
JavaScript & TypeScript 11 min read

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.

Flat vector illustration of a browser window with a busy main thread lane full of long task blocks, where one heavy gear-shaped block is lifted by a dashed arrow onto a separate background worker lane, leaving the main lane clear for a cursor click, with the moving block highlighted in orange-red
JavaScript & TypeScript 16 min read

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.

Flat vector illustration of a dark code panel sending messy data blocks through a rounded schema gate with an orange-red check shield, where only clean, neatly aligned blocks continue into a browser window
JavaScript & TypeScript 15 min read

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.

Flat vector illustration of a browser window and a dark code editor panel with request lines flowing between them through a central rounded relay card highlighted in orange, which answers each request with a stack of mock response cards instead of a distant server
JavaScript & TypeScript 20 min read

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.

Flat vector illustration of a browser window with dimmed page content behind a translucent backdrop, a centered white modal dialog card with an orange-red focus ring on its first field, a blank keyboard key linked to the close control, and a small dark code panel
JavaScript & TypeScript 15 min read

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.

Flat vector illustration of a dark code panel with one line underlined in orange-red, linked through an orange-red check badge to a light-gray checklist card, showing TypeScript satisfies validating a config object
JavaScript & TypeScript 11 min read

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.

Vector illustration of Playwright end-to-end testing catching a broken checkout flow before a client finds it
JavaScript & TypeScript 16 min read

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.

Vector illustration of exclusive UI state branches splitting from one status tag, representing TypeScript discriminated unions
JavaScript & TypeScript 13 min read

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.

Vector illustration of a network request being canceled mid-flight while a fresh request continues, representing AbortController and fetch cancellation
JavaScript & TypeScript 12 min read

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.

Up and down to move, Enter to go, Esc to close

Before you go

Planning a website launch?

Read the checks I run before any site goes live: speed, SEO, forms, accessibility and backups.

Read the launch checklist Ask on WhatsApp