Repository navigation
feat: Svelte 5 attachment — @formkit/auto-animate/svelte (#235) - #257
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closed
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #235.
@formkit/auto-animate/svelteexportsautoAnimate, which works bare ((el) => cleanup) or called with options or a plugin (it returns an attachment).sveltedependency: attachments are plain(el) => cleanupfunctions. Cleanup calls the controller'sdestroy().{@attach autoAnimate({ duration })}in an effect and re-attaches whendurationchanges. I checked this by compiling a real Svelte 5 component: 0 warnings, emits$.attach(ul, () => autoAnimate({ duration })).use:autoAnimate(Svelte 4 actions) is unchanged.Wiring: a rollup step, a declarations move, the
.d.tsimport fix list, and apackage.jsonexport.Tests:
svelte-attachment.spec.tscovers bare use, options (duration honored) and cleanup stopping animations.exports.spec.tschecks the built subpath. Full e2e: 106 passed, 8 skipped.Docs: a new "Svelte 5 attachment" section with an example.