Stop Using Types In SvelteKit
You no longer have to use type annotations for special SvelteKit values.
👉️ Support
▶️ KZread Membership
youtube.com/@joyofcodedev/join
🔴 Patreon
/ joyofcode
👉️ Links:
Zero-effort type safety
🔗 svelte.dev/blog/zero-config-t...
👉️ Uses:
🔗 joyofcode.xyz/uses
👉️ Socials:
🐦️ / joyofcodedev
💬 / discord
🔖 Timestamps
0:00 SvelteKit Type Annotations
1:24 You Don't Have To Use Arrow Functions Anymore
1:47 Going Over The Zero-effort Type Safety Post
2:38 How SvelteKit Generates Types
4:22 How Does It Work
4:58 Outro
#svelte #sveltekit #joyofcode
Пікірлер: 45
💬 Discord: joyofcode.xyz/invite
Take that t3 stack!
@JoyofCodeDev
Жыл бұрын
Maybe I should make a video on SvelteKit and tRPC.
@greendsnow
Жыл бұрын
@@JoyofCodeDev is trpc any useful after this update? End to end AUTO typing is here already.
@JoyofCodeDev
Жыл бұрын
@@greendsnow Depends! 😄
@zed5790
Жыл бұрын
@@JoyofCodeDev yes please make a video on it!
@anton-shubin-live
Жыл бұрын
@@JoyofCodeDevtrpc video would be awesome! 🙂
This is a great tutorial, default type is no longer required, thank you for the reminder, from now on type is not much a deal while working with Sveltekit, awesome 🤩😍🤗😘😄👏
Thank you very much!
Always giving the best information about svelte and sveltekit! TY!!
this is awesome. thanks for sharing!
This is honestly such a lifesaver.
Love this feature :) Although I still have restart the TS server every few minutes to make it comprehend
@JoyofCodeDev
Жыл бұрын
TypeScript is trying. 😂
Wasn't aware of this, awesome feature indeed!
No more arrow functions ! What a time to be alive
@JoyofCodeDev
Жыл бұрын
Being so used to it I didn't even consider it at first. 😄
cool man thank you. Exactly what I was looking for right now :D
@JoyofCodeDev
Жыл бұрын
I aim to please.
This is so nice, but does this also apply to RequestHandler types as well? And when running svelte-check this gets treated as an error. Do you know if there is something I have to update for it to not count as errors?
@JoyofCodeDev
Жыл бұрын
It should work for everything! 😄
Thank G.O.D!
Now I can use export function again 😁
That is awesome! But I noticed that when I try to use these data from `import { page } from '$app/stores';` the typings do not work :/ Maybe it will be fixed
@JoyofCodeDev
Жыл бұрын
Yeah! 😄
The typing does not work for "$page.data", is there a fix for this problem?
What if I have to send the data as props to a component? What happens to the type of data in that component? Struggling with this for a long time
@JoyofCodeDev
2 ай бұрын
I would treat those types separately.
i will also be calling ">" pointy boi from now on
discord notification gang
and how does a API fetch look like ?
@JoyofCodeDev
Жыл бұрын
This only works for special SvelteKit values and not types in general.
my todo list just got much longer 😂
I never used ts to begin with so it's a win-win situation.
@JoyofCodeDev
10 ай бұрын
Everyone wins because you don't have to use JSDoc types.
HAHAHAHA... we need to clean up this mess right now.
Sorry but having to rely on people on my team using a specific (imho bad) IDE with a specific plugin to have type safety, seems like a bad idea to me.
@JoyofCodeDev
Жыл бұрын
This works for any editor.
@ult19x65
Жыл бұрын
I agree. It's so funny that people live on this bubble that svelte is amazing and it's so mid
I'm fighting more with TS server that my code, i don't know if my types are wrong or TS server is wrong anymore. This is not a good experience.
@JoyofCodeDev
Жыл бұрын
Restarting the TypeScript server resolves the problem for me but I agree having to do it often sucks.
Me want type
@JoyofCodeDev
Жыл бұрын
You get type-safety from SvelteKit but you have to write types for everything else.