Skip to content

Svelte 5 native support and other changes

Pre-release
Pre-release
Compare
Choose a tag to compare
@dimfeld dimfeld released this 16 Nov 08:04
· 30 commits to master since this release

This is a release candidate for svelte-maplibre 1.0. I believe everything is done but want to let it soak a bit before publishing.

See the demo site here.

This release not only upgrades to Svelte 5, but also integrates a few other breaking changes I've wanted to make:

  • All the code in the package was moved to runes (thanks @benmccann for the nudge), so Svelte 5 is now required.
  • Event handlers are now functions passed as props, in Svelte 5 style. The main difference that you will find is that instead of using event.detail, the data for an event will just be present on event.
  • Events no longer have the map attribute added to them since this is already present as event.target
  • For anyone implementing their own layer components, the context structure has changed a lot. See context.ts for more details
  • Update deck.gl dependency to v9. Deck.gl's support for Mapbox and Maplibre is completely different between v8 and v9. This release does not change the interface in a breaking way, aside from the new version requirement. A future release will publish a new Deck.gl layer component which better integrates with the new support.
  • Many of the uses of null in the package have been changed to undefined, which works better with Svelte's prop handling in some cases.

The old Svelte-4-compatible version will probably not get any new features, but for a while I will try to port significant bug fixes back to there as they are made.

Major Changes

Minor Changes

  • #214 0485a6a Thanks @dimfeld! - Add generics for Features on many components to permit better type safety

  • #214 0485a6a Thanks @dimfeld! - Only add event handlers to the map when something is actually listening