TypeScript: Guides and Practical Know-how | Page 10 | mironsoft Blog
TypeScript
-
Aug 23, 2025
Anyone choosing runtime validation for TypeScript faces three very different philosophies: io-ts with a functional fp-ts ecosystem, Zod with a fluent, object oriented API and a broad ecosystem, and Valibot with a modular, tree-shakeable architecture for minimal bundle sizes. This article compares all three based on API style, error handling, bundle cost and migration effort, so the choice fits the project architecture instead of following a trend.
-
Aug 14, 2025
TypeScript checks types by their shape, not by their name. A UserId and an OrderId look identical to the compiler as long as both are declared as string, which means they can be swapped by accident. Branded types close exactly this gap by adding a nominal distinction on top of a structural type system, with zero runtime cost.
-
Aug 9, 2025
Loading data in React has always meant the same thing: useEffect, useState, a loading state, an error state, boilerplate. The use() hook from React 19 makes this declarative: a Promise goes in, the resolved value comes out, and Suspense takes care of the rest.
-
Aug 9, 2025
TypeScript 5.2 introduced using and await using, based on the TC39 proposal for Explicit Resource Management. Resources such as file handles, database connections, or locks are now released automatically and deterministically as soon as their scope is left.
-
Jul 30, 2025
Hand-written TypeScript interfaces for REST endpoints quietly go stale as the backend evolves, offering false type safety instead of real protection against runtime errors. This article shows how openapi-typescript and related tools generate TypeScript types and typed fetch clients directly from an OpenAPI specification, and how to wire that process reliably into build and CI pipelines.
-
Jul 24, 2025
Modeling application state with several independent boolean flags risks contradictory states at runtime, such as being loaded and failed at the same time. Discriminated unions solve this by giving TypeScript a shared tag field that automatically identifies the exact state, so impossible combinations are ruled out at compile time and the editor only suggests fields that are actually valid.
-
Jul 23, 2025
Off-the-shelf rule sets catch generic problems, but every mature codebase accumulates conventions that only a custom rule can enforce mechanically. This article walks through the anatomy of an ESLint rule, from syntactic and typed linting through fixer functions, testing with RuleTester, and wiring everything into an ESLint 9 flat config.
-
Jul 16, 2025
ECMAScript is evolving faster than ever. ES2024 and ES2025 bring features the community has been asking for for years: grouping data, better promise control, real date handling without libraries, and structured pattern matching. This article covers every important addition with concrete examples.
-
Jul 14, 2025
A plain validation function that only returns true or false discards the one piece of information it just gained through the check, and forces the rest of the code to repeat the same check at every other point. This article explains the parse, don't validate principle and shows, through refinement types, nested parsers, and practical TypeScript examples, how to permanently remove unknown states from a codebase instead of re-checking them over and over.
-
Jul 7, 2025
A year after a type decision, nobody on the team usually remembers why a specific generic constraint or a discriminated union was modeled exactly that way. A short Architecture Decision Record captures the reason, the alternatives and the consequences, so type decisions stay traceable instead of being re-guessed at every refactoring.