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

  • @JoyofCodeDev
    @JoyofCodeDev Жыл бұрын

    💬 Discord: joyofcode.xyz/invite

  • @greendsnow
    @greendsnow Жыл бұрын

    Take that t3 stack!

  • @JoyofCodeDev

    @JoyofCodeDev

    Жыл бұрын

    Maybe I should make a video on SvelteKit and tRPC.

  • @greendsnow

    @greendsnow

    Жыл бұрын

    @@JoyofCodeDev is trpc any useful after this update? End to end AUTO typing is here already.

  • @JoyofCodeDev

    @JoyofCodeDev

    Жыл бұрын

    @@greendsnow Depends! 😄

  • @zed5790

    @zed5790

    Жыл бұрын

    ​@@JoyofCodeDev yes please make a video on it!

  • @anton-shubin-live

    @anton-shubin-live

    Жыл бұрын

    @@JoyofCodeDevtrpc video would be awesome! 🙂

  • @maskman4821
    @maskman4821 Жыл бұрын

    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 🤩😍🤗😘😄👏

  • @NicholasMaietta
    @NicholasMaietta2 ай бұрын

    Thank you very much!

  • @vrx_ui
    @vrx_ui Жыл бұрын

    Always giving the best information about svelte and sveltekit! TY!!

  • @zzej
    @zzej Жыл бұрын

    this is awesome. thanks for sharing!

  • @cre8ive65
    @cre8ive65 Жыл бұрын

    This is honestly such a lifesaver.

  • @Huntabyte
    @Huntabyte Жыл бұрын

    Love this feature :) Although I still have restart the TS server every few minutes to make it comprehend

  • @JoyofCodeDev

    @JoyofCodeDev

    Жыл бұрын

    TypeScript is trying. 😂

  • @HeatingUpDuke
    @HeatingUpDuke Жыл бұрын

    Wasn't aware of this, awesome feature indeed!

  • @maelacier6138
    @maelacier6138 Жыл бұрын

    No more arrow functions ! What a time to be alive

  • @JoyofCodeDev

    @JoyofCodeDev

    Жыл бұрын

    Being so used to it I didn't even consider it at first. 😄

  • @mcchikin2751
    @mcchikin2751 Жыл бұрын

    cool man thank you. Exactly what I was looking for right now :D

  • @JoyofCodeDev

    @JoyofCodeDev

    Жыл бұрын

    I aim to please.

  • @Loui3Hunna
    @Loui3Hunna Жыл бұрын

    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

    @JoyofCodeDev

    Жыл бұрын

    It should work for everything! 😄

  • @d47im5e
    @d47im5e Жыл бұрын

    Thank G.O.D!

  • @mavdotj
    @mavdotj Жыл бұрын

    Now I can use export function again 😁

  • @cis84muz
    @cis84muz Жыл бұрын

    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

    @JoyofCodeDev

    Жыл бұрын

    Yeah! 😄

  • @DanielRios549
    @DanielRios54911 ай бұрын

    The typing does not work for "$page.data", is there a fix for this problem?

  • @user-di1sz4xz6u
    @user-di1sz4xz6u2 ай бұрын

    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

    @JoyofCodeDev

    2 ай бұрын

    I would treat those types separately.

  • @skylerdjy
    @skylerdjy11 ай бұрын

    i will also be calling ">" pointy boi from now on

  • @kickbuttowsk2i
    @kickbuttowsk2i Жыл бұрын

    discord notification gang

  • @jost2404
    @jost2404 Жыл бұрын

    and how does a API fetch look like ?

  • @JoyofCodeDev

    @JoyofCodeDev

    Жыл бұрын

    This only works for special SvelteKit values and not types in general.

  • @theIbraDev
    @theIbraDev Жыл бұрын

    my todo list just got much longer 😂

  • @7heMech
    @7heMech10 ай бұрын

    I never used ts to begin with so it's a win-win situation.

  • @JoyofCodeDev

    @JoyofCodeDev

    10 ай бұрын

    Everyone wins because you don't have to use JSDoc types.

  • @MrArdo-branch-main
    @MrArdo-branch-main Жыл бұрын

    HAHAHAHA... we need to clean up this mess right now.

  • @brainshack9077
    @brainshack9077 Жыл бұрын

    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

    @JoyofCodeDev

    Жыл бұрын

    This works for any editor.

  • @ult19x65

    @ult19x65

    Жыл бұрын

    I agree. It's so funny that people live on this bubble that svelte is amazing and it's so mid

  • @justmrmendez
    @justmrmendez Жыл бұрын

    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

    @JoyofCodeDev

    Жыл бұрын

    Restarting the TypeScript server resolves the problem for me but I agree having to do it often sucks.

  • @pixel7038
    @pixel7038 Жыл бұрын

    Me want type

  • @JoyofCodeDev

    @JoyofCodeDev

    Жыл бұрын

    You get type-safety from SvelteKit but you have to write types for everything else.