Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Variance and Assignability in TypeScript: Covariance, Contravariance and strictFunctionTypes
We look at the direction of assignability, covariance in return types, contravariance in parameters, strictFunctionTypes, method bivariance, the array soundness hole and in/out variance annotations.
Recursive Types in TypeScript: JSON, DeepReadonly and DeepPartial
We cover self-referencing types, a recursive JSON type, DeepReadonly and DeepPartial with their function and array pitfalls, recursive conditional types and the TS2589 limit with tail recursion.
Template Literal Types in TypeScript: Building Strings at the Type Level
We cover union products with template literal types, patterns like ${number}, the Uppercase and Capitalize intrinsics, deriving event names, generating keys with mapped types and parsing routes with infer.
Mapped Types in TypeScript: Producing a New Type from an Existing One
We cover mapped type syntax, how homomorphic mapped types carry readonly and ? modifiers, managing modifiers with + and -, key remapping with as, and filtering properties with never.
infer in TypeScript: Capturing Types Inside Conditional Types
We use infer to capture pieces of a matching type, write ReturnType, Parameters and Awaited ourselves, match tuple and string patterns, constrain infer and avoid the overload pitfall.
Conditional Types in TypeScript: Making Decisions at the Type Level
We look at the T extends U ? X : Y syntax, what extends means for assignability, distributive behavior over unions, turning it off with [T] and filtering unions with never, backed by real tsc output.
JavaScript's Next Features: TC39 Stages, Temporal and using
We learn how a feature passes TC39's stages into the language, how Temporal (PlainDate, ZonedDateTime, Duration) fixes Date's problems, and resource management with using, with notes on Safari support.
JavaScript Web Components: Custom Elements, Shadow DOM and Slots
We write our own HTML tag with customElements.define, learn the lifecycle callbacks and observedAttributes, and build a framework-free star rating component with Shadow DOM, template and slot.
Drawing with JavaScript Canvas: 2D Context, Animation and Pixel Data
We draw shapes, paths, gradients and text with the canvas 2D context, process images pixel by pixel, build an animation loop with requestAnimationFrame and fix blurriness on retina screens.
Files and Binary Data in JavaScript: File, Blob, ArrayBuffer and Typed Arrays
We take files from the user via input and drag and drop, read Blobs and Files, go down to bytes with ArrayBuffer, typed arrays and DataView, and learn ES2026's base64/hex methods and file downloads.
JavaScript Observer APIs: Intersection, Mutation and Resize Observer
We build lazy loading and infinite scroll with IntersectionObserver, watch DOM changes with MutationObserver and element size with ResizeObserver, and learn how to clean observers up properly.
JavaScript Web Workers: postMessage, Transferable Objects and Module Workers
We move heavy work off the main thread with Web Workers and learn postMessage and structured clone, single-file Blob URL workers, transferable objects, module workers and life without the DOM.