Skip to content

v4.1.0

Choose a tag to compare

@alexandermccormick alexandermccormick released this 12 Oct 19:26
· 45 commits to main since this release
4f12a22

Light and lazy entry points, and a safe monitorsManager.init() (#111, #110).

Changes

  • @sjvair/monitor-map/core: the router context (provideMonitorMapRouter, useMonitorMapRouter, ROUTER_KEY, MonitorMapRouterApi) and monitorsManager without the map, for use at host-app startup.
  • @sjvair/monitor-map/routes: monitorMapRoutes with a lazy layout and lazy route components, so a host router can reference it without loading maplibre.
  • monitorsManager.init(): overlapping calls share one request; a failed init can be retried; an explicit pollutant wins over a call without one; the latest readings load in parallel with the monitor list.
  • monitorsManager.resumeAutoUpdate(): refreshes once and restarts polling if it was stopped.
  • Bug fixes:
    • Live updates resume when the map is reopened after being closed.
    • A monitors update that resolves after the pollutant changed is dropped instead of overwriting the new pollutant's readings.
    • The package builds on case-insensitive filesystems (macOS) without a resolver workaround: map/map.svelte.js is now map/map-manager.svelte.js.
  • Tooling: the release workflow runs the unit tests and a bundle check before publishing.

The . entry is unchanged, including its eager monitorMapRoutes.

Upgrading

No changes are required. To keep the map off a host app's startup path, import the router context and monitorsManager from @sjvair/monitor-map/core and monitorMapRoutes from @sjvair/monitor-map/routes. On a cold deep link into the map, the router outlet is empty until the lazy layout chunk loads.