Latest article
Does TypeScript Have Dependent Types? Model Literal-Driven Constraints
TypeScript can correlate properties and return types with literal inputs, but those patterns are not general dependencies on runtime values.
Types / boundaries / better code
A blog about TypeScript in production software, focused on the practical context of using the language in real applications.
Latest article
TypeScript can correlate properties and return types with literal inputs, but those patterns are not general dependencies on runtime values.
Publish and protect package APIs
Put usage guidance beside public declarations, leave types in TypeScript, and check how the comments read in editor help and generated reference pages.
Publish and protect package APIs
Use a library entry point’s exports to predict which declarations TypeDoc will represent, then check the result and its extracted comments.
Choose runtime structure and behavior
Use `for...of` when each operation must finish before the next starts; use `Promise.all` for independent operations, while accounting for its rejection behavior.
Publish and protect package APIs
Build a CommonJS-only TypeScript library, package its JavaScript and declarations, and check both entry points from a separate consumer.
Choose runtime structure and behavior
Choose the language around the service’s defining dependencies, then account for runtime validation, contract ownership, and the cost of operating another service.
Choose runtime structure and behavior
Use a class when callers need independently changing state; use a module to group operations and control what other files can import.
Validate inputs and enforce contracts
Define one user-update contract for a handler and client, then check actual request and response data before trusting its types.
Model data and type relationships
Use Pick to select fields from a type, Extract to retain matching union members, and Extract before Pick when the fields belong to only one variant.
Configure, migrate, and verify projects
Use `tsx watch` for a repeatable development command, then run type checking and compiled JavaScript as separate checks.
Keep the next useful detail within reach.
Follow via RSS