Bootstrap System

"/home/yossef/notes/git/projects/maplibra/modules/Bootstrap System.md"

path: maplibra/modules/Bootstrap System.md

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

Bootstrap System

Purpose: Orchestrates startup from shell initialization through lazy feature loading.

Related: ../Home.md, ../Architecture.md, ./MVF Loading.md, ./Asset System.md, ../flows/Startup Sequence.md

What It Does

The bootstrap system is a staged pipeline that brings the app from an empty page to an interactive map while deferring heavy work. It is implemented across src/bootstrap/ and coordinated by script.js.

Bootstrap Stages

1. Shell Bootstrap (src/bootstrap/bootstrap-shell.js)

2. Map Bootstrap (src/bootstrap/bootstrap-map.js)

3. Data Bootstrap (src/bootstrap/bootstrap-data.js)

4. Deferred Bootstraps

App Context

src/bootstrap/create-app-context.js creates a shared context object passed through all stages:

Performance Budget

src/bootstrap/perf-budget.js defines startup time budgets and warns when exceeded.

Rollout Telemetry

src/bootstrap/rollout-telemetry.js provides a fire-and-forget telemetry sink for routing engine fallback and startup performance events. Delivery order: navigator.sendBeaconfetch({ keepalive: true }) → silent drop.

Runtime Flags

src/bootstrap/runtime-flags.js parses URL query parameters for routing configuration:

Important Files

How It Connects