š šš 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ā¦
Day 9 ā warnings and errors emitted by the compiler, or while your app is running, are now accompanied by links to the docs. Over time, we'll flesh out these docs with more details about what caused the error in question š demo svelte.dev/playground/809ā¦
Day 10 ā a lot of you wanted a place to put async setup work that happens before your SvelteKit app starts up. You can now export an `init` function from `hooks.server.js` and `hooks.client.js` that will be awaited before any other stuff happens š docs svelte.dev/docs/kit/hooksā¦
Day 11 ā a whole new module, for getting reactive views of window properties like innerWidth, innerHeight, scrollX, scrollY and so on. Like the bindings on <svelte:window> but with less boilerplate š docs svelte.dev/docs/svelte/sv⦠š demo svelte.dev/playground/8acā¦
@sveltejs The very thing I've been looking for other meta-frameworks. Great job svelte team!
@sveltejs Can I use it on client side to setup in-memory session from accesstoken query parameter send from IAM callback in OAuth flow ?
@sveltejs not sure why but it doesn't say what it does when hovered using JSDoc