@gomani/router@1.2.0
npm size budget2.2 KB / 4.0 KB ✓
@gomani/router
Routing is not an assembly decision. index / nested / [param] / [...catchall] / _layout, with co-located loader and staticPaths. Prefetch is aggressive on capable links, conservative on the Baseline Network to protect the data budget.
API
createRouter
function
createRouter(routes: RouteTree): Router
Build a specificity-ordered router from the scanned app/routes tree.
loader
type
type Loader<T> = (ctx: LoadContext) => Promise<T> | T
A route's co-located data loader. On the server it can co-locate critical data with the document to kill request waterfalls.