-
New Apr 13, 2025
Deploying TypeScript: recent advances and possible future directions
In this blog post we look at: The current best practice for deploying library packages: .js, .js.map, .d.ts, .d.ts.map, .ts Recent new developments in compiling and deploying TypeScript:...
-
New Apr 12, 2025
Ideas for making TypeScript better at testing types
In this blog post, we examine how we can test types in TypeScript: First, we look at the library asserttt and the CLI tool ts-expect-error. Then, we consider which functionality could be built into...
-
New Mar 28, 2025
Could JavaScript have synchronous await?
In JavaScript, code has color: It is either synchronous or asynchronous. In this blog post, we explore: The problems caused by that How to fix them via synchronous await The two downsides that pre...
-
New Mar 11, 2025
A closer look at the details behind the Go port of the TypeScript compiler
Today’s announcement by Microsoft: [...] we’ve begun work on a native port of the TypeScript compiler and tools. The native implementation will drastically improve editor startup, reduce most bu...
-
New Mar 4, 2025
Unions and intersections of object types in TypeScript
In this blog post, we explore what unions and intersections of object types can be used for in Ty...
-
New Mar 2, 2025
My sales pitch for TypeScript
Roughly, TypeScript is JavaScript plus type information. The latter is removed before TypeScript code is executed by JavaScript engines. Therefore, writing and deploying TypeScript is more work. Is th...
-
New Feb 27, 2025
What is TypeScript? An overview for JavaScript programmers
Read this blog post if you are a JavaScript programmer and want to get a rough idea of what using TypeScript is like (think first step before learning more details). You’ll get answers to the fo...
-
New Feb 25, 2025
Simple TypeScript playgrounds via node --watch
Now that Node.js has built-in support for TypeScript, we can use it as the foundation of simple playgrounds that let us interactively explore TypeScript code....
-
New Feb 24, 2025
Testing types in TypeScript
In this blog post, we explore how we can test that complicated TypeScript types work as expected. To do that, we need assertions at the type level and other to...
-
New Feb 23, 2025
The unexpected way in which conditional types constrain type variables in TypeScript
The TypeScript handbook makes an interesting statement: “Often, the checks in a conditional type will provide us with some new information. Just like narrowing with type guards can give us a more...
-
New Feb 19, 2025
The bottom type never in TypeScript
In this blog post, we look at the special TypeScript type never which, roughly, is the type of things that never happen. As we’ll see, it has a surprising number of applications....
-
New Feb 17, 2025
Array type notations: T[] vs. Array<T> in TypeScript
In this blog post, we explore two equivalent notations for Arrays in TypeScript: T[] and Array<T>. I prefer the latter and will explain why....
-
New Feb 17, 2025
Symbols in TypeScript
In this blog post, we examine how TypeScript handles JavaScript symbols at the type level. If you want to refresh your knowledge of JavaScript symbols, you can check out chapter “Symbols” of...
-
New Feb 15, 2025
Conditional types in TypeScript
A conditional type in TypeScript is an if-then-else expression: Its result is either one of two branches – which one depends on a condition. That is especially useful in generic types. Conditional ty...
-
New Feb 14, 2025
Mapped types in TypeScript
A mapped type is a loop over keys that produces an object or tuple type and looks as follows: {[PropKey in PropKeyUnion]: PropValue} In this blog post, we examine how mapped types work...
-
New Feb 10, 2025
TypeScript: extracting parts of compound types via infer
In this blog post, we explore how we can extract parts of compound types via the infer keyword. It helps if you are loosely familiar with conditional types. You can check out chapter “Conditional t...
-
New Feb 9, 2025
TypeDoc: testing code examples in doc comments
TypeDoc now lets us refer to parts of other files via {@includeCode}. In this blog post, I explain how that works and why it’s useful....
-
New Feb 8, 2025
TypeScript: the satisfies operator
TypeScript’s satisfies operator lets us check the type of a value (mostly) without influencing it. In this blog post, we examine how exactly it works and where it’s useful....
-
New Feb 6, 2025
Read-only accessibility in TypeScript
In this blog post, we look at how can make things “read-only” in TypeScript – mainly via the keyword re...
-
New Feb 4, 2025
Tutorial: publishing ESM-based npm packages with TypeScript
During the last two years, ESM support in TypeScript, Node.js and browsers has made a lot of progress. In this blog post, I explain my modern setup that is relatively simple – compared to what we ha...
-
New Jan 29, 2025
Computing with tuple types in TypeScript
JavaScript’s Arrays are so flexible that TypeScript provides two different kinds of types for handling them: Array types for arbitrary-length sequences of values that all have the same type – e.g.: A...
-
New Jan 24, 2025
Template literal types in TypeScript: parsing during type checking and more
In this blog post, we take a closer look at template literal types in TypeScript: While their syntax is similar to JavaScript’s template literals, they operate at the type level. Their use cases in...
-
New Jan 21, 2025
ECMAScript proposal: RegExp escaping
The ECMAScript proposal “RegExp escaping” (by Jordan Harband and Kevin Gibbons) specifies a function RegExp.escape() that, given a string text, creates an escaped version that matches text – if interp...
-
New Jan 19, 2025
TypeScript enums: use cases and alternatives
In this blog post, we take a closer look at TypeScript enums: How do they work? What are their use cases? What are the alternatives if we don’t want to use them? The blog post concludes w...
-
New Jan 15, 2025
A guide to tsconfig.json
I never felt confident about my tsconfig.json. To change that, I went through the official documentation, collected all common options, and documented them in this blog post: This knowledge will...
-
New Jan 10, 2025
ECMAScript feature: regular expression pattern modifiers
Traditionally, we could only apply regular expression flags such as i (for ignoring case) to all of a regular expression. The ECMAScript feature “Regular Expressio...
-
New Jan 9, 2025
ECMAScript feature: import attributes
The ECMAScript feature “Import Attributes” (by Sven Sauleau, Daniel Ehrenberg, Myles Borins, Dan Clark and Nicolò Ribaudo) helps with importing artifacts other than JavaScript modules. In this blo...
-
New Jan 8, 2025
Node’s new built-in support for TypeScript
Starting with v23.6.0, Node.js supports TypeScript without any flags. This blog post explains how it works and what to look out for....
-
New Jan 1, 2025
WebAssembly as an ecosystem for programming languages
In this blog post, we look at how WebAssembly has become an ecosystem for many programming languages and what technologies enable th...