Purpose: A curated, example‑driven curriculum to teach & learn elite TypeScript engineering practices. Every unit: concise explanation + minimal, high‑signal examples + stretch ideas.
Philosophy:
- Type safety as a design tool, not ceremony
- Prefer precise, intention‑revealing types over broad any/unknown
- Model invariants in types first, then implement
- Measure type performance when complexity grows
- Leverage generics + inference to remove duplication
Learning Style:
- Read the short concept explanation
- Study minimal examples (copy into playground or run
pnpm dev
later once added) - Attempt the practice prompts (TBD) before viewing solutions
- Refactor for clarity + performance
Directory Structure (incrementally filled):
chapters/
01-core-mastery/
02-in-practice/
03-frontend-excellence/
04-backend-infra/
05-interviews-systems/
Covers mapped, conditional, infer, template literal types, distributivity, variance.
See: chapters/01-core-mastery/unit-01-advanced-types/README.md
Deep dive into built-ins + crafting powerful reusable helpers.
Control inference, contextual typing, exhaustiveness, branded types.
Purpose of each strict flag, layering configs for monorepos, performance impacts.
Complexity patterns, avoiding exponential conditional types, benchmarking tools.
- Type-Safe APIs (REST, GraphQL, contract-first)
- Error Handling (Result/Either, discriminated unions, ergonomics)
- Event / Pub-Sub Patterns (typed channels, CQRS hints)
- Typed Config & Environment (runtime validation + compile-time safety)
- Type-Safe Testing (Vitest + assertion type guards + zod + tsd style checks)
- React Strict Typing (generic components, polymorphic as prop)
- Hooks & Context Patterns (context factories, avoiding undefined)
- State Management (Redux Toolkit, Zustand, signal patterns, exhaustive actions)
- UI Library Interop (augmenting module types, Tailwind IntelliSense, shadcn challenges)
- Type-Safe Forms (React Hook Form + Zod inference pipeline)
- Node Patterns (DI, clean architecture boundaries)
- Type-Safe DB Layer (Prisma, Drizzle, repository abstractions)
- Async & Concurrency (workers, queues, cancellation tokens)
- CI/CD & Monorepos (project references, solution style tsconfigs)
- Observability (typed logs, metrics contracts, trace contexts)
- DSA with Strong Typing (generic data structures, phantom types)
- System Design Mock (schema -> contracts -> impl)
- Code Smells & Refactors (anti-pattern fixes via types)
- Advanced Paradigms (FP, OOP, DDD blended in TS)
- Final Project (spec → contracts → generators → implementation)
- Explore Chapter 1 Unit 1 first.
- Run examples (will add runnable harness in
src/
soon). - Add your own variants under
playground/
and keep strict mode ON.
- Populate each unit with exercises & test-driven type challenges.
- Add scripts to run type performance benchmarks.
Contributions Welcome (Guidelines TBD).