TypeScript: Guides and Practical Know-how | Page 13 | mironsoft Blog
TypeScript
-
May 9, 2025
Autocompletion, red squiggly lines and Rename Symbol feel like built in editor magic. Behind them runs a separate, long lived process: the TypeScript Language Server. Understanding how tsserver detects projects, answers requests and handles memory lets you fix performance problems deliberately instead of just restarting the editor and hoping.
-
May 9, 2025
With the type Effect, Effect-TS surfaces what try-catch hides: which errors an operation can throw and which dependencies it needs to run. Both become part of the signature, not just a footnote in the documentation.
-
May 8, 2025
Arrays are mutable by default in JavaScript, which leads to subtle bugs in larger codebases whenever a function unintentionally changes an array it was handed. TypeScript's readonly arrays and readonly tuples provide a tool to rule out such mutations already at compile time.
-
May 4, 2025
TypeScript turns time-tested GoF patterns from object-oriented software design into tools with real compile-time guarantees. Combining Factory, Strategy, Observer, and Builder with discriminated unions, generic types, and exhaustiveness checks prevents entire classes of bugs that only surface at runtime in plain JavaScript, while producing more maintainable, better-tested architectures for checkout and headless commerce systems.
-
May 3, 2025
Growing a TypeScript codebase without watching compiler performance eventually means multi-minute build times and an editor tsserver that visibly stalls. Combinatorial type instantiation, oversized union types, and missing project references are the most common causes. This article shows hands-on how to diagnose slow builds with generateTrace, spot typical traps, and speed things up deliberately with project references and incremental builds.
-
May 2, 2025
A single conditional type checks a condition once. Recursive conditional types apply the same condition to themselves again and again until a base case is reached, turning nested objects, tuples, and strings into fully transformed types at compile time. Once you know the mechanics, the depth limit, and the tail recursion pattern, you can write DeepReadonly, tuple reverse, or recursive template literal types confidently on your own.
-
Apr 28, 2025
External DnD libraries solve problems that do not exist in many projects, while bringing along bundle size, learning overhead and dependencies of their own. The native HTML5 Drag and Drop API is entirely sufficient for sortable lists, file upload and simple drag interactions, wrapped in a custom hook under 100 lines of TypeScript.
-
Apr 21, 2025
Workspaces are the technical foundation without which no TypeScript monorepo works, yet the three major package managers resolve symlinks, hoisting and the workspace protocol differently, and these differences are the cause of many hard to trace import bugs.
-
Apr 19, 2025
Vite transpiles TypeScript at blazing speed during development via esbuild, but deliberately skips type-checking so Hot Module Replacement and dev server startup stay fast. This article shows how to bring type errors back into view with vite-plugin-checker, configure vite.config.ts cleanly, and set up a minimal Vite plus TypeScript project for admin widgets and frontend tools.
-
Apr 14, 2025
Statically typed frontends often trust handwritten interfaces blindly while the API underneath keeps evolving. TypeScript types generated from a single OpenAPI specification, combined with runtime validation through zod, close exactly that gap and keep backend and headless frontend in sync for good across Magento and PWA projects.