
The CSS :has() Selector: A Practical Guide
How the :has() pseudo-class finally gives CSS a parent selector, and the patterns, pitfalls and performance trade-offs that come with it.
Tags
26 articles · Page 1 of 3

How the :has() pseudo-class finally gives CSS a parent selector, and the patterns, pitfalls and performance trade-offs that come with it.

Why unknown is the type-safe replacement for any, and the narrowing patterns that make it practical in real code.

Use TypeScript template literal types to encode event names, route patterns and permission sets in the type system — no runtime checks, no string drift.

Soft deletes look like a simple safety net, but they silently corrupt your schema, poison your queries, and break your constraints — here's what to use instead.

The satisfies operator validates that a value matches a type while preserving literal inference — why that distinction matters and where to apply it.

Replace Node's stringly-typed EventEmitter with a generic typed alternative that catches event name typos and payload mismatches at compile time.

N+1 is not an ORM problem — implement the DataLoader batching pattern in TypeScript to collapse redundant fetches across any source, microservices included.

Eliminate a whole class of runtime bugs by teaching TypeScript the difference between a UserId and an OrderId — even when both are strings underneath.

Stop bolting middleware onto frameworks and start building type-safe, composable pipeline primitives you can test in isolation and reason about at a glance.

TypeScript's type system stops at compile time — Zod closes the gap by validating data at the runtime boundaries where it actually matters.

Server Actions bring form handling and mutations back to the server in Next.js — how to use them well, what to avoid and which patterns actually scale.

Move beyond try-catch soup: discriminated unions, Result types, and error boundaries that make TypeScript codebases more reliable and maintainable.