sveltejs / learn.svelte.dev

A soup-to-nuts interactive tutorial on how to build apps with Svelte
https://learn.svelte.dev
MIT License
519 stars 243 forks source link

Is the Svelte Kit tutorial updated for v2? #541

Open samzmann opened 9 months ago

samzmann commented 9 months ago

I'm going throught the tutorial and enjoying it. Great work! Now I just got the the Part 3 / Loading data / Page data section. I got curious about how error works so I consulted the docs, only to find that apparently in SvelteKit V2 I don't need to use throw:

import { error } from '@sveltejs/kit'

- throw error(500, 'something went wrong');
+ error(500, 'something went wrong');

See:

This got me wondering: why is the tutorial teaching me SvelteKit V1? Is this intentional, or did we forget to update the tutorial to V2..?

So I just wanted to ask/bring this to your attention.

Other than that, keep up the nice work!

AdelBeit commented 4 months ago

It's not updated, if you look at package.json it's using sveltejs/kit@^1.30.3 I forked it to update it but it's not straight forward, sveltekit 2 requires sveltejs/vite-plugin-svelte package, but when you install it the dev mode breaks. build & preview work but the lesson dropdown selector stops working for some reason (all the options disappear). I don't want to update the tutorial code if I can't setup the environment without breaking anything first. maybe a maintainer with a better knowledge of the code base could tackle this update