Skip to main content

Framework Typescript

Framework Code

Concepts and techniques for generic framework and library code.

Conditional Types

Many TypeScript utility types use conditional types, often with mapped types.

type ReplaceNumberPropertiesWithNull<T> = {
[K in keyof T]: T[K] extends number ? null : T[K];
};

Questions

Which engineering decision related to this topic has the highest switching cost once made — and how do you make it well with incomplete information?

  • At what scale or complexity level does the right answer to this topic change significantly?
  • How does the introduction of AI-native workflows change the conventional wisdom about this technology?
  • Which anti-pattern in this area is most commonly introduced by developers who know enough to be dangerous but not enough to know what they don't know?