Overview
A typed router that treats routes as contracts instead of strings.
The route is not a string. It is an agreement.
Cookbook Router connects route definitions, URL state, navigation, React rendering, SSR, and build-time generation. The payoff is not a clever API. The payoff is that broken links, malformed route trees, and stale contracts fail where engineers can act on them.
Get running
Understand the model
Read the API
Fix the failure
Packages
| Package | Responsibility |
|---|---|
@cookbook/router | Route definitions, matching, URL state, navigation, middleware, history, SSR primitives, and diagnostics. |
@cookbook/router-react | Providers, links, hooks, outlets, slots, boundaries, and lazy views. |
@cookbook/router-cli | Route discovery, validation, contracts, registration, manifests, and watch mode. |
The six bundler plugins invoke the same CLI build pipeline. They do not invent six different routers.
Start with what you need
Install the packages for the runtime you actually use.
Define a static route tree the CLI can inspect.
Generate contracts and let TypeScript reject impossible navigation.
Add middleware, slots, intercepts, and SSR only when the application needs them.
Where this can bite
Cookbook Router will not search the browser filesystem, infer route parents from folder names, or make executable URL codecs statically analyzable. Build-time tooling needs explicit files and static route data. This boundary is deliberate.