ConstBuild a static site from a router's Route.static routes.
Enumerates all static routes, runs their loaders, renders to HTML,
and writes the output to outDir.
Generate a full HTML document wrapping rendered content.
Generate the script tag for embedding loader data
Create a client-side Layer that provides NavigationContext and RouteDataProvider.
On the first call (hydration), reads data from window.__EFFEX_DATA__.
On subsequent calls (client-side navigation), fetches from the server
via ?_data=1.
import { hydrate } from "@effex/dom"
import { Platform } from "@effex/platform"
import { router } from "./routes"
const program = Effect.gen(function* () {
yield* hydrate(App(), document.getElementById("root")!, {
layer: Platform.makeClientLayer(router),
})
})
Effect.runPromise(Effect.scoped(program))
Serialize data for embedding in HTML (escapes script-breaking characters)
Convert an Effex Router into an @effect/platform HttpRouter.
For each route in the Effex Router, registers method-specific handlers:
?_data=1, returns data as JSON.?_action=key, executes it
directly with the parsed request body. No component rendering.Redirect errors are caught and converted to HTTP redirect responses.
Platform utilities namespace.