-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Breaking: Svelte 5 #295
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks so much @Antosik for taking of this big migration effort! 👍
i've been meaning to tackle this as well but haven't gotten to it yet so really appreciated 🙏
@@ -12,6 +12,7 @@ To submit a pull request, clone the repo, install dependencies and start the dev | |||
git clone https://github.com/janosh/svelte-multiselect | |||
cd svelte-multiselect | |||
npm install | |||
npm run package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think contributors need to run npm run package
?
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/svelte": "^5.2.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally, i would like to stick to pure vitest
unit testing. can we do without @testing-library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can get rid of this file entirely now with runes? never liked this hacky workaround for testing 2-way binding...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file contains a lot of boilerplate. many of the functions are 1-liners so probably better to inline them
Work in progress
Breaking changes
svelte
dependency has been moved to peer dependencies.svelte@^5.8.0
is now required3.1. The
onchange
event now triggers only on the component itself, not on theinput
element (to avoid event overlap)Events
Events are now divided into two categories: native events - MultiSelectNativeEvents (triggered on the
input
element) and generated events - MultiSelectComponentEvents (triggered on the component itself).Event naming conventions have been slightly adjusted (e.g.,
on:add
→onadd
), and custom event details are no longer required (e.g.,e.detail.type
→e.type
).Example
Before (svelte4):
After (svelte5):
SlotsSnippetsSlot names have been slightly adjusted (e.g.,
expand-icon
→expandIcon
, etc.).Example
Before (svelte4):
After (svelte5):
Minor changes
MultiSelectEvents
were removed in favor ofMultiSelectComponentEvents
&MultiSelectNativeEvents
Todos
@testing-library/svelte
(?))--legacy-peer-deps
flag)Checklist
[ ] has tests (only needed if any new functionality was added or bugs fixed)
[ ] has examples/docs (only needed if any new functionality was added)
Useful links