š šš ADVENT OF SVELTE š šš We're going to ship one thing a day every day from now until Christmas. Wish us luck!
svelte.dev/blog/advent-of⦠Day 1 ā error boundaries! Wrap your code in a <svelte:boundary> and you can isolate and recover from unexpected errors. š docs svelte.dev/docs/svelte/svā¦š tutorial svelte.dev/tutorial/sveltā¦
Day 2 ā `each` without `as`, for when you just want lots of one thing - docs svelte.dev/docs/svelte/ea⦠- demo svelte.dev/playground/e7eā¦
Day 3 ā you can now export snippets from a <script module> (terms and conditions apply) - docs svelte.dev/docs/svelte/sn⦠- demo svelte.dev/playground/16bā¦
Day 4 ā specify a `defaultValue` on form inputs, and it will be used when the form is reset - docs svelte.dev/docs/svelte/bi⦠- demo svelte.dev/playground/b30ā¦
Day 5 ā it's a three-in-one kind of day! `new MediaQuery(...)` lets you use media queries reactively. prefersReducedMotion is a MediaQuery that helps you respect users' accessibility preferences - docs svelte.dev/docs/svelte/sv⦠- demo svelte.dev/playground/89f⦠there's more!
Day 5, part two ā MediaQuery is powered by createSubscriber, which is an advanced feature mainly for library authors. It makes it easy for you to build your own reactive classes that set up event listeners when something is read inside an effect. - docs svelte.dev/docs/svelte/svā¦
Day 6 āĀ we now have modern state-based Spring and Tween classes for adding motion to your UI, replacing the `spring`/`tweened` stores of old. Smooth! š tutorial svelte.dev/tutorial/svelt⦠š docs svelte.dev/docs/svelte/sv⦠š demo svelte.dev/playground/8a0ā¦
Day 7 ā the first of a few planned improvements to the site. A lot of you (rightly!) disliked the tutorial dropdown navigation, so we fixed it. You can even navigate the tutorial with JS disabled, if you're so inclined š svelte.dev/tutorial
Day 8 ā we're calling this 'function bindings'. You know how you can do `bind:value={value}`? You can now do this... bind:value={getValue, setValue} ...which lets you transform and validate data š docs svelte.dev/docs/svelte/bi⦠š demo svelte.dev/playground/1ddā¦
@sveltejs Uh.... this is one thing I still don't like. Actually it is even worse than before. Easy to missclick or if you have multiple items expanded and there is long list, you can get lost what subcategory fits under which category.