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

  1. URL parsing and route matching (static, params, wildcards); ranking by specificity.
  2. History API: pushState, replaceState, popstate. Note what popstate does not tell you.
  3. Nested routes and a matched-route chain.
  4. Redirects, including loops — detect and fail loudly.
  5. Loaders: async data per route, resolved before the transition commits.
  6. Cancellation: a navigation superseded by another must abort its loaders.
  7. Error routes and error boundaries per level.
  8. Back/forward, including during an in-flight navigation.
  9. Scroll restoration.
  10. Blocking navigation on unsaved changes.

3. Failure Lab

  1. 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.
  2. Back during load. Press back while a loader is pending. Where does the state end up?
  3. Redirect loop. A→B→A. What does the user see, and what should they see?
  4. Scroll restoration vs async content. Restore scroll before the content that made the page tall has loaded.
  5. 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.