Day 12 โ send custom types across the network boundary in SvelteKit, whether it's a class containing reactive state, a class used by your database ORM library, or whatever. Just export a `transport` object from your `hooks.js`
๐ docs https://svelte.dev/docs/kit/hooks#Universal-hooks-transport
๐ demo https://stackblitz.com/edit/sveltejs-kit-template-default-b5zbxomg?file=src%2Fhooks.js
๐ docs https://svelte.dev/docs/kit/hooks#Universal-hooks-transport
๐ demo https://stackblitz.com/edit/sveltejs-kit-template-default-b5zbxomg?file=src%2Fhooks.js
Comments
also, encode/decode are shorter
๐ docs https://svelte.dev/docs/llms
๐ demo (a snake game made by Sonnet 3.5) https://svelte.dev/playground/0de3c1c1a31d47bdbb7c4aa3477a6b46
๐ docs https://svelte.dev/docs/svelte/imperative-component-api#unmount
๐ demo https://svelte.dev/playground/a4ca332691204ccd887ec7b1df818182?version=5.13.0
๐ docs https://svelte.dev/docs/svelte/$inspect#$inspect.trace()
๐ demo https://svelte.dev/playground/d135c6f00beb4fa391725e59d8061604?version=5.14.0
๐ docs https://svelte.dev/docs/kit/$app-state
๐ tutorial https://svelte.dev/tutorial/kit/page-state
npx sv migrate app-state
We just fixed that. Install svelte@latest, make sure your extensions are up to date, and feel the wind in your hair as you write your components