How apple/mapkit-loader works
MapKit Loader is a small TypeScript library that loads Apple MapKit JS in the browser and returns its typed namespace. The main workflow is: an application calls load(), the loader inserts or reuses a script, and the browser fetches MapKit JS before the loader returns the available mapkit object. For server-rendered pages, callers can instead generate script attributes or an HTML string that starts loading earlier. The graph is based on the README and sampled src/index.ts; it does not assume additional runtime modules.
Main entry points: index.ts Loader API
Components 7
Other components
- Application
- Loader API
src/index.ts - Browser DOM
- MapKit CDN
- MapKit JS
- Script attributes
src/index.ts - Script HTML
src/index.ts
Connections 11
- Application → Loader API: calls load
- Loader API → Browser DOM: inserts script
- Browser DOM → MapKit CDN: requests script
- MapKit CDN → MapKit JS: provides runtime
- Browser DOM → Loader API: signals load
- Loader API → MapKit JS: returns namespace
- Application → Script attributes: requests attributes
- Script attributes → Application: returns attributes
- Application → Script HTML: requests markup
- Script HTML → Script attributes: generates attributes
- Script HTML → Application: returns script