frontend // stack
Typed contracts between content, components, and APIs.
Every Astro component, content schema, and API client shares one typed contract. Refactors propagate at compile time instead of failing silently in production.
Use everywhere we write frontend code; strict by default, pragmatic at the edges.
why we use it
(01) Content you can trust
Storyblok schemas generate types (Sanity supported the same way), so a renamed CMS field breaks the build instead of rendering a blank page.
(02) Refactors without fear
Renaming a prop or reshaping an API response surfaces every call site instantly across hundred-component estates.
(03) Fewer 3am pages
Null checks and exhaustive unions catch the edge cases that untyped JavaScript ships to users as white screens.
scope
(01) Strict mode with shared content and API types
(02) Generated CMS types checked in CI
(03) Exhaustive state handling for interactive islands
(04) Editor autocomplete that matches production contracts
tradeoffs
Our default versus the common alternative, stated honestly.
| dimension | 2sh | traditional |
|---|---|---|
| Correctness | Compile-time guarantees across content and components | Runtime errors discovered by visitors |
| Refactoring | Rename once, fix everywhere the compiler points | Find-and-replace across untyped templates |
| Onboarding | Types document intent better than wiki pages | Tribal knowledge of what each prop accepts |
| When not strict | Escape hatches at third-party boundaries with runtime validation | Any-type soup that defeats the checker |
Not sure TypeScript fits your estate?
In the audit we map your estate, model the cost of staying versus moving, and document the recommendation in writing.