TypeScript: Guides and Practical Know-how | Page 9 | mironsoft Blog
TypeScript
-
Sep 20, 2025
Anyone building forms in React 19 with React Hook Form will eventually need a schema validation library. Zod and Yup solve the same problem with different priorities: TypeScript-first versus an established JavaScript API. This article compares both across type inference, syntax, nested structures, and migration effort.
-
Sep 16, 2025
Prop drilling and global variables are signs of tight coupling. Custom Events offer a native DOM solution: components send events, others listen, without a direct reference to each other, without a framework, and with full TypeScript support.
-
Sep 15, 2025
Forcing document.querySelector results through as any or as HTMLInputElement wholesale throws away exactly the type safety TypeScript is supposed to provide. This article shows how to properly secure DOM elements, events, forms, and custom data attributes using the built-in lib.dom.d.ts types, real null checks, clean type guards, and typed event listeners, so the compiler catches real bugs instead of hiding them behind any.
-
Sep 12, 2025
TypeScript ships Partial, Pick, Omit, Record, and several other utility types as ready-made building blocks for type-safe data structures, so developers never have to manually duplicate or keep existing interfaces in sync. Applying these built-in type transformations deliberately cuts redundancy across API contracts, forms, and build scripts, and lets the compiler catch inconsistencies early, long before they surface in production.
-
Sep 9, 2025
Assertion functions let you declare runtime checks so the TypeScript compiler folds them into its control flow analysis. This article covers the asserts syntax, how it differs from classic type guards using is, and when writing your own assertion functions actually pays off in practice.
-
Sep 7, 2025
Hover info, an AST tree, version comparison, and shareable permalinks: the official Playground solves type puzzles faster than a local IDE.
-
Sep 6, 2025
Anyone who wanted to resolve a promise from the outside, from an event handler, a callback API, or some other asynchronous context, had to smuggle resolve and reject out of the constructor scope. Promise.withResolvers() solves this in a single line: { promise, resolve, reject } as a structured object, clear and without boilerplate.
-
Sep 6, 2025
Hono is built consistently on Web Standard APIs like Request and Response instead of Node specific types, so it runs unchanged on Cloudflare Workers, Deno, Bun and Node.js. Its built in RPC mode derives client types directly from the server definition, with no code generation or separate schema at all.
-
Sep 6, 2025
The wrong moduleResolution setting produces confusing cannot find module errors even though the code is actually correct. This article explains how TypeScript resolves import paths under node node16 and bundler why Vite and Webpack follow different rules than the plain tsc compiler and how to match the right strategy to your actual build tool.
-
Aug 23, 2025
PHP developers already know most TypeScript concepts, just under different names and with different guarantees. This article maps union types, interfaces, immutability, enums, and generics from the PHP world onto their TypeScript equivalents, shows exactly where nominal and structural typing diverge, and compares a typical value object line by line in both languages.