Skip to content

v2.2.1

Choose a tag to compare

@KaiHuebner KaiHuebner released this 15 Sep 23:47
· 58 commits to main since this release
41f1cb1

Added

  • <MapGL onError> — called if map initialization fails (e.g. mapLib.supported() reports the environment can't run Mapbox/MapLibre GL JS, such as any WebGL-less context, or the underlying new mapLib.Map(...) constructor itself throws). Always logged via console.error in addition, so nothing is silently lost if this isn't provided.
  • solid-map-gl/testing — a new entry point re-exporting this library's own internal mock mapboxgl.Map/maplibregl.Map and <MapProvider> render helper (createMockMap, createMockMapLib, createMockDrawLib, renderWithMap, tick), the same test doubles this library's own test suite uses to render components without a real WebGL context. Requires vitest and @solidjs/testing-library, both now optional peer dependencies.

Fixed

  • MapGL: onMount's async setup had no error handling, so a construction failure (e.g. mapLib.supported() returning false, reliably the case under Vitest/jsdom and any other WebGL-less environment) became an unhandled promise rejection instead of something a consumer could react to — and the viewport-sync effect had no !map guard, so the very next viewport prop update after such a failure threw TypeError: Cannot read properties of undefined (reading 'stop') on top of that. Both are now caught; see onError above.
  • package.json's repository.url had incorrect case, which broke npm Trusted Publishing's provenance verification for this release's first publish attempt.

Fixes #158.

Full Changelog: v2.2.0...v2.2.1