Site / Creating a site
Comparison: TanStack Start
The other side, from its docs (preloading, SEO, data loading):
| Concern | TanStack Start | foldkit-site + Plus |
|---|---|---|
| Route declaration | File-based routes; route tree by convention, with per-route code splitting | Explicit tree over existing Foldkit Routers; no file convention, no codegen — and no per-route code splitting (a document is the split boundary today) |
| Data fetching | loader per route, run in parallel before render; beforeLoad for context; router cache + Query below | No loaders: Surfaces declare reads, Remote plans and coalesces; the store + retention are the cache, policies are per-domain |
| Waterfalls | Parallel loaders per depth; deferred data for the rest | No loader gate at all; satisfy fixed-point per data-dependence level; pending UI by convention |
| Prefetch | Built in: intent/viewport/render strategies, freshness/retention windows, preloadRoute | Same composition as navigation (sourcesFor + satisfy), trigger app-owned; no windows or lanes — Remote policy + retention decide |
| Guards | beforeLoad redirects; server functions enforce | Route access would be presentation policy only (unbuilt); authority stays at RemoteServer/audience — the split is explicit, not layered |
| Head/SEO | Per-route head() meta; SSR + streaming; prerender crawls links | Titles and head metadata (Site.metaOf) from the tree; SSR/static HTML + sitemap |
| Mutations + refresh | Router invalidation reruns loaders | Entity/connection patches apply directly; membership-changing queries refetch (single-flight designed, last) |
| Server boundary | Server functions alongside routes | Separate by design: documents → SSR, semantic data → RemoteServer, HTTP → Effect HttpApi — the Site never becomes an HTTP router |
The deepest difference is not a feature list. TanStack owns the runtime:
its router schedules, caches, preloads, and renders. Foldkit Plus refuses
the second runtime: the Site is pure topology, and every behavior above is
some other package's primitive composed by the caller. That buys one
transition per feature (UI, agent, and Sync meet at the same update) and
costs the conveniences a runtime provides — per-route code splitting,
preload lanes, loader caches — which arrive here only as compositions with
proven demand, never as framework.