TypeScript: Guides and Practical Know-how | Page 7 | mironsoft Blog
TypeScript
-
Nov 21, 2025
Packaging a TypeScript project into a Docker image without a multi-stage build ships the entire TypeScript compiler, every devDependency and the source tree straight into production. A clean multi-stage build separates compilation, dependency pruning and runtime into three distinct stages, noticeably reducing image size, attack surface and deployment time.
-
Nov 21, 2025
Routing in React has long been a source of runtime errors: wrong URL parameters, untyped search params, missing route guards. TanStack Router fixes this fundamentally through a fully type-safe routing system in which the TypeScript compiler catches every error in navigation, params and search params before the code ever reaches the browser.
-
Nov 20, 2025
An internal TypeScript package that gets imported inside the monorepo but suddenly throws type errors or loads the wrong runtime module when the application bundles almost always has the same root cause, a misconfigured exports field. Understanding the details of conditional exports and typesVersions avoids this class of bugs for good.
-
Nov 20, 2025
Building TypeScript projects with Webpack forces a core tradeoff: full type checking during the build or maximum compile speed. This article shows how ts-loader, babel-loader, and fork-ts-checker-webpack-plugin work together, how to structure a type-safe webpack.config.ts, and when switching to esbuild, swc, Vite, or Rspack actually pays off.
-
Nov 19, 2025
Publishing a TypeScript library is not just writing code, it is signing a contract with projects you do not control. Project structure, tsconfig.json, a dual format build and the exports field decide whether a TypeScript library works smoothly in every consumer setup or generates daily support tickets.
-
Nov 18, 2025
React 19 removes one of the framework's oldest special cases: ref can now be received directly as a regular prop, no forwardRef wrapper required. This article walks through the new pattern, how to migrate existing forwardRef components, TypeScript typing, and how both patterns coexist safely in a mixed codebase.
-
Nov 16, 2025
Hand written type guards with manual typeof and in checks drift apart easily whenever the underlying type changes, and they become a source of bugs in larger codebases. This article shows how to derive runtime type guards automatically from Zod schemas, with a generic guard factory, discriminated union guards, and a clear distinction between a type predicate and an assertion function.
-
Nov 13, 2025
Minified JavaScript without source maps turns every production error into a guessing game over cryptic line numbers. But shipping source maps publicly right next to the bundle exposes your commented TypeScript source to every visitor. Hidden source maps combined with a controlled upload to an error-tracking service solve this dilemma cleanly.
-
Nov 10, 2025
Debouncing with setTimeout is a pragmatic crutch, not a solution. useDeferredValue from React 18 defers expensive render work without a fixed time window, so the browser stays responsive while the result list updates in the background.
-
Nov 4, 2025
TypeScript compiles down to plain JavaScript, but it catches entire classes of mistakes at compile time, before they ever show up in a browser or on a server. Static types, reliable autocomplete, and safe refactoring noticeably change everyday development, but they come with a learning curve and an extra build step that does not pay off equally for every project.