Deferred Bootstrap

"/home/yossef/notes/git/projects/maplibra/decisions/Deferred Bootstrap.md"

path: maplibra/decisions/Deferred Bootstrap.md

- **fileName**: Deferred Bootstrap
- **Created on**: 2026-06-16 00:48:42

Deferred Bootstrap

Purpose: Why routing, search, and debug layers load lazily after the first floor render.

Related: ../Home.md, ../Architecture.md, ../modules/Bootstrap System.md, ../flows/Startup Sequence.md

Decision

Load heavy subsystems (routing controller, search box, debug layers) only after the map is interactive and the first floor is rendered.

Rationale

  1. Time-to-first-render is the critical metric for user perception. The map should be visible within seconds.
  2. Routing graph loading can take 1-3 seconds for large buildings. Blocking startup on this would make the app feel slow.
  3. Search box is not needed immediately — users typically look at the map first.
  4. Debug layers are developer-only and should never affect production startup.
  5. Network variability — outdoor routing APIs may be slow or unavailable; deferring prevents timeout anxiety.

Implementation

Tradeoffs

When It Was Made

Phase 5+ of the product hardening effort. The deferred bootstrap pattern was added to support large buildings with heavy routing graphs.