CodeVetter · Repo Unpack · Data flow
remix-run/remix
HTTP input becomes a Web Request and request context before middleware and route dispatch. Component output becomes a byte stream carrying HTML and client-entry metadata, which the browser uses to activate components and frames. OAuth data crosses a session-backed redirect boundary before application-owned identity persistence. CLI inputs and configuration follow separate Node filesystem and process boundaries.
- For one-argument handlers, createRequestListener constructs a Web Request, invokes the handler, and sends synchronous or asynchronous responses through sendResponseForRequest; request-construction and handler failures use separate error paths.
- Router.fetch creates RequestContext, assigns its router, and dispatches through global middleware before matching routes against context.url.
- dispatchMatch merges matched parameters into context.params and executes route middleware or the handler while racing against request abort.
- renderWith stores a per-request renderer as both a context key and context.render; render connects request URL, abort signal, frame resolution, and client entries to renderToStream and createHtmlResponse.
- A file:-based clientEntry ID is split into source ID and export name, resolved with assets.getScriptEntry, and returned with href, import map, and preload metadata.
- The template browser entry imports each requested module through importModule, selects its named export, rejects non-functions, and supplies that loader to run().
- Asset requests accept GET/HEAD, normalize transform query data, parse mapped paths, and route CSS through styleCompiler; compiled script responses enforce fingerprints and distinguish missing/disallowed files from invalid transforms.
- Session middleware parses the signed cookie, optionally validates embedded expiration, loads SessionStorage, installs context.session, then saves after downstream handling and appends Set-Cookie when storage returns a value.
- External login generates state and a PKCE verifier, stores the transaction under __auth by default, and returns the provider authorization redirect; callback processing validates provider/state before invoking the provider runtime.
- resolveExternalAuth looks up the provider account, extracts profile details, updates or creates a user, optionally links by profile-derived email, then creates or updates the auth-account row.
- Scaffolding resolves the target directory and application name, copies token-substituted template files, and rewrites package name, Remix dependency version, development dependencies, and Node engine constraints.
- Route inspection launches a Node subprocess that dynamically imports app/routes.ts, normalizes the exported routes object, writes JSON to stdout, and returns that output to the parent loader.