Releases: zerodevx/svelte-toast
v0.9.6
This is a maintenance update that brings tooling and dependencies in sync with the latest Svelte decisions.
Changelog
onpop()
callback returns adetails
object as its second param containing the close event, if any (#104):
toast.push('foo', {
onpop: (id, details) => {
const { event } = details
// `undefined` if closed by timeout;
// `MouseEvent|KeyboardEvent` if closed by dismiss button
console.log(event)
}
})
<script lang="ts">
import { toast, type SvelteToastOptions } from '@zerodevx/svelte-toast'
function stub(msg: string, options: SvelteToastOptions) {
toast.push(msg, options)
}
</script>
- Support Svelte
v5
since it's backward compatible
Roadmap
The next minor v0.10.0
will contain breaking changes - strictly speaking, semver
allows that between minor
increments of the v0
branch. Changes include:
onpop()
: callback deprecated in favour of a promise-based implementation;component
: decoupling ofToastItem
into aController
andView
- this allows greater control on how a toast looks;pausable
:none|hover|hidden|all
- finer control on when toasts pause (#103);reverse
: applies to container-level only;- and probably some other stuff.
These changes prepare us for v1.0.0
where codebase will be refactored to Svelte v5
only - this repo greatly benefits from v5
's fine-grained reactivity and snippet runes. Work on this begins when v5
stable ships.
Moving forward, the v0
branch will be maintained based on Svelte v4
(can be used in both v4
and v5
projects), while the v1
branch will be written in Svelte v5
and can only be used in v5
projects.
v0.9.5
v0.9.4
v0.9.3
v0.9.2
v0.9.1
v0.9.0
Sorry this took some time.
v0.9
introduces a big tooling upgrade to svelte-package
to better keep in sync with any changes in the Svelte ecosystem. Consequently, compiled packages (for non-Svelte consumers) are moved to a separate /dist
endpoint. This distinction helps the package work with virtually any permutation of environment setup.
Under the hood, we added better type safety, moved away from handwritten ts.d
to generated ones, and performed a slight code refactor/cleanup.
v1.0.0-rc.1
⚠️ IMPORTANT NOTICE!
Install this component if you're using the latest SvelteKit. That's because of a breaking change that landed there. Background of the issue here. Track progress as we work towardsv1
here.
Edit: resolved from v0.9
onwards. SvelteKit users should switch back to @latest
stable:
$ npm i -D @zerodevx/svelte-toast@latest