Execution — fw-08-router
Steps extracted from CONCEPTS.md. Read the concepts first; this file is the doing.
Record results in observation.md; tick checkpoints in verification.md.
2. Build order
- URL parsing and route matching (static, params, wildcards); ranking by specificity.
- History API:
pushState,replaceState,popstate. Note whatpopstatedoes not tell you. - Nested routes and a matched-route chain.
- Redirects, including loops — detect and fail loudly.
- Loaders: async data per route, resolved before the transition commits.
- Cancellation: a navigation superseded by another must abort its loaders.
- Error routes and error boundaries per level.
- Back/forward, including during an in-flight navigation.
- Scroll restoration.
- Blocking navigation on unsaved changes.
3. Failure Lab
- Stale loader. Navigate A→B→C quickly with random loader latencies. Land on C, show B's data. Reproduce it deterministically — if your reproduction is "click fast," you have observed it, not reproduced it.
- Back during load. Press back while a loader is pending. Where does the state end up?
- Redirect loop. A→B→A. What does the user see, and what should they see?
- Scroll restoration vs async content. Restore scroll before the content that made the page tall has loaded.
- Double submit. Two rapid clicks on a link with a side-effecting loader.
For (1), implement three fixes — AbortController, a navigation sequence number, and
render-time guarding — then rank them. Ask which is correct when the loader has a server side
effect. That question is the seam into fw-09.