Site / Site and the Router
What the Site does not do
- It does not parse anything new. The routers are the URL story, and
literal,query,restandschemaSegmentbehave as Foldkit says. A catch-all router (/:slug) still belongs after the nodes whose literal it would also take, as it does inoneOf. - It holds no state. The route is a field of your Model, written in
updatethrough thesetyou give. The Site never readswindow.location. - It does not fetch or wait. There are no loaders: navigating sets the route at once, and the Surfaces a node names declare what Remote fetches as a result.
- It does not change the runtime.
makeApplication'sroutingconfig and its two Messages are the same with or without a Site.
When the Router alone is enough
A single screen, or a few screens without sections, nav, shortcuts or titles
to keep in step, needs only Foldkit's Router and two update branches. Reach
for the Site when you start keeping a second list of your routes: a nav, a
title per route, a sitemap, or a page that must hear when its route arrives.
Where to read next
foldkit-siteREADME: the API.- Creating a site: a site end to end, with data, prefetch, SSR and SEO.
- Routing example: the application this page quotes.