CodeVetter · Repo Unpack · Data flow
remix-run/react-router
Route configuration becomes normalized route objects and runtime matching state. Browser submissions become Fetch Requests whose results update route data and errors. Server adapters convert platform inputs into the same request abstraction and return streamed responses. Session data follows a separate cookie-to-storage lifecycle controlled by application code.
- createBrowserRouter feeds route objects, browser history, and hydration data into createRouter before initialization.
- navigate resolves relative targets through normalizeTo and transforms navigation options into a path, submission, or error.
- startNavigation aborts the previous navigation, matches the new location, and creates a Request with an AbortController signal.
- Mutation submissions run handleAction before handleLoaders; completion commits action data, loader data, errors, and working fetchers.
- Express copies request headers, streams non-GET/HEAD bodies into Fetch Requests, and aborts when the response closes before finishing.
- Document rendering collects loaderData, actionData, and sanitized errors into a Turbo Stream handoff alongside build metadata.
- callRouteHandler forwards request, URL, params, context, and route pattern, converting redirect data wrappers into thrown Responses.
- getSession parses a cookie identifier and reads backing data; commitSession updates or creates backing data and serializes the identifier.
- File sessions serialize data and expiry as JSON, generate random hexadecimal IDs, and remove expired data during reads.
- Type generation creates context, clears the generated type directory, and writes generated server-build and route files.