Files
Work/Loader/README.md
2026-06-15 06:59:57 +01:00

36 lines
962 B
Markdown

# Loader
Tiny first-request bootstrap document for Moku.
## Purpose
The loader is intended to be the smallest possible first paint shown before the
real application is handed off.
Long term responsibilities:
- capture original route intent
- collect lightweight client capability hints
- make a tiny boot decision
- hand off to login or app
## Route intent contract
The loader writes bootstrap state to `sessionStorage`:
- `moku.loader.intent` — the intended route path
- `moku.loader.meta` — JSON metadata for the current bootstrap event
The loader also writes a short-lived cookie:
- `moku_loader_seen=1`
The proxy uses that cookie to decide whether to keep serving the loader or to
serve the real app document on the next request.
## Current handoff behavior
For now, the loader simply hands off to the originally requested route. That
keeps the first implementation tiny while leaving a clear place to add auth or
perf-tier decisions later.