ashlsun / untitled-inventory-app

0 stars 0 forks source link

upgrade to svelte 5 #28

Closed Rettend closed 1 day ago

Rettend commented 5 days ago

this is how svelte 5 looks, and it seems to work.

Svelte still throws errors for using element references without $state but it seems to work, though they maybe don't need it according to this site: Component Party (btw this site compares 4 and 5 and has a lot more examples than the docs)

Item was mutating its item prop which was throwing warning, so i reworked how the events are handled, but did not finish it. I think item should move to a svelte store (which also changed in svelte 5).

Rettend commented 5 days ago

can't get tests to work

also the testing-library supports svelte 5 but they still have their peer deps set to 4 so npm install fails (along with the github action)

related issue: https://github.com/testing-library/svelte-testing-library/issues/284

can be solved with bun or npm i --legacy-peer-deps

Rettend commented 4 days ago

also closes #25

there are still edge cases, like you can spam ctrl + v and ctrl + z to input more than 20 chars 🫠 and the cursor isn't always correctly reset when pasting, but it mostly works

ashlsun commented 4 days ago

nice!! ill read through right now

also saw this when googling, putting this here for later https://github.com/testing-library/svelte-testing-library/issues/284

edit: LOL its the same link u put 🤦🏻‍♀️

Rettend commented 3 days ago

testing lib works, and i override the tabler-icons peer dep for now.

also i added the neat vitest ui which you can run with npm run test:ui and see the coverage here: image