Porting a vanilla JavaScript library to Svelte 5 - complete guide

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 11

  • @ScriptRaccoon
    @ScriptRaccoon Před 4 měsíci +8

    Nice video!
    Small remark, at 25:00 a better approach would be to use svelte:document in the markup and add the event listener there. This also works with svelte:window. The advantage is that it is more concise and that Svelte does the cleanup (removing the event listener) for you automatically.

  • @vavhust
    @vavhust Před 2 měsíci

    Wow! Informative and really clear explanation. Thanks!
    More videos on Svelte 5, would be great. Plus using Sveltekit

  • @iulikdev
    @iulikdev Před měsícem

    Nice!

  • @AmxCsifier
    @AmxCsifier Před 2 měsíci

    you can also use style:left=

  • @NicholasMaietta
    @NicholasMaietta Před 4 měsíci +1

    I appreciate this!

  • @UwU-dx5hu
    @UwU-dx5hu Před 4 měsíci

    installed the chrome extension.its fun

  • @yanisxmine
    @yanisxmine Před 4 měsíci

    thank you for showing how it's done in general! you read all the time "svelte is just javascript so you're good". for a newbie like me the question remained - can you show me once how you do it? what are the points to pay attention to while porting? very much appreciate this guide. btw appreciation jar is beautiful - how you designed the flow, your writing, approach to privacy, etc.

  • @ubermatchvlaad532
    @ubermatchvlaad532 Před 4 měsíci +1

    Why not use svelte directives instead of js document modifiers i.e. `onmousemove={}` 25:26

    • @StanislavKhromov
      @StanislavKhromov  Před 4 měsíci +1

      👋You can definitely use something like instead of the shown approach. Hopefully it's still useful to see how hooking up event listeners and handling the cleanup works.

  • @iconsumepizza
    @iconsumepizza Před 3 měsíci

    ON GOD I DONT KNOW HOW TO SCRIPT