🎅🎄🎁 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…
@sveltejs I can get rid of my custom Svelte 4 store by for this now, yay!
@sveltejs @SvelteSociety Did pretty the same with my class in svelte.ts. The most powerful Svelte feature is the flexibility and *.svelte.ts is awesome.
@sveltejs does this work with container queries? if not... feature request!