A single npm package with tree-shakeable subpath exports. Every subpath depends down the stack, never sideways. WebGPU at the bottom, widgets on top, adapters and analysis plugged in wherever they make sense.
modules12
classes67+
ts · strictzero any
packaging1 npm · 12 subpaths · tree-shake
layers · bottom → top
The stack
Each layer only sees the ones beneath it. Swap a render backend, swap a WASM core — everything above keeps compiling.
L7application
Your apps · site frameworks · user product. Compose MapView · add layers · bind widgets.
One npm package, 12 subpath exports — tree-shake per feature. Strict interface boundaries (ILayer, IRenderEngine, IRenderer, IViewMode) keep layers decoupled.
WASM core lives outside the browser's JS main thread path (worker hookable) — no GC pressure on the hot render loop. RenderEngine is a facade over draw delegates: any new pipeline plugs in behind one method.
01types first — no any in public API
02contracts over classes — swap implementers, not patch them
03GPU-native by default — state lives in buffers, not JS
04WASM for math — Rust owns projection, triangulation, MVT parse
class diagram · core composition
How MapView is wired
The runtime object graph for a single MapGPU instance. MapView delegates to ViewCore which owns the render engine and dispatches through IViewMode. Interfaces are solid; implementers branch off.