Update the Svelte 5 examples to use the new snippets and event props
TheOnlyTails opened this issue · 5 comments
In Svelte Summit Fall 2023 a few days ago, Rich Harris announced a few new Svelte 5 changes:
- Slots are going away and being replaced with "snippets", a new way to create reusable markup.
- Event dispatching and the
on:directive is being replaced with regular callback props. - It's now recommended to use classes to encapsulate state instead of objects with getters and setters.
Component Party still uses the old examples, and they should be updated to reflect the new announcements.
I'm happy to write them myself if need be.
Your contribution is welcome !
@TheOnlyTails we still seem to be missing a snippets example
The site doesn't really have any example where snippets are applicable.
As slots are deprecated in v5 then perhaps snippets would sit under slots? But I see your point, removing Svelte slots in favour of snippets in the 'slots' section of the website might be a bit confusing!!
In the slots examples, I did showcase the use of {@render} to insert the children prop, but there is no appropriate place to showcase snippet definition.