Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@mattjennings mattjennings released this 11 Nov 19:52
· 1 commit to main since this release

v2 introduces Svelte 5 support and an API overhaul to better solve the community requests from v1. Please check out the new documentation to see detailed examples and usage. The v1 documentation will remain available here

The following issues have been addressed or fixed with this release:

#7
#9
#18
#15
#17
#27
#21
#34
#35

Migration from v1

You can continue to use the v1 API and incrementally adopt the new API by using the svelte-modals/legacy import. Please check out the migration guide for a detailed walkthrough.

Breaking changes

API

  • Svelte 5 is now required as a peer dependency
  • modals has been changed from a store to being the main entrypoint for most svelte-modals methods.
    • openModal -> modals.open and now returns a promise
      • when using { replace: true } and the currently opened modal prevents the close, the promise will reject
    • closeModal -> modals.close
    • closeAllModals -> modals.closeAll
    • modals -> modals.stack and changed from a store to a rune
    • action -> modals.action and changed from a store to a rune
    • transition -> modals.transition and changed from a store to a rune
  • <Modals /> has been updated to use snippets instead of slots. The default slot has been changed to a modals snippet.
    • svelte-modals/legacy continues to use slots and the default slot
  • Deferred transitions are now enabled by using the exitBeforeEnter action instead of forwarding events

Types

  • SvelteModalComponent has been renamed to ModalComponent and updated for Svelte 5 component types
  • LazySvelteModalComponent has been renamed to LazyModalComponent and updated for Svelte 5 component types