Svelte 5 is a beast, but is it worth switching?

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 112

  • @WesBos
    @WesBos 9 місяців тому +19

    Welcome to video!

  • @studiousllama4776
    @studiousllama4776 9 місяців тому +28

    Congrats on making the transition to video! Definitely looking forward to more video content.

    • @syntaxfm
      @syntaxfm  9 місяців тому +2

      Pumped to keep evolving here.

  • @nicky-hajal
    @nicky-hajal 9 місяців тому +7

    Love the video and thanks for the content on Svelte! Been using it since 2019 and it's such a joy. I've been holding off on Svelte 5 until it's close to stable but really eager to dive in.

  • @dawid_dahl
    @dawid_dahl 9 місяців тому +11

    I love this podcast! I never went to school and studied programming all on my own. That meant a lot of imposter syndrome, and this podcast kind of served the same purpose as university in the sense that I could connect with other coders and compare my skills with them, to know I was heading in the right direction.
    After 3 years of study I got a real job and have been working as a full-stack dev now for 2,5 years. And I’m so *so* grateful for Scott and Wes for this podcast!
    💙💙

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      That’s amazing! Thank you so much for sharing.

    • @lucasjames8281
      @lucasjames8281 9 місяців тому

      You don’t have imposter syndrome, you’ve learnt how to glue web libraries together and are called a “full stack engineer”. You are an imposter, a library gluer pretending to be a programmer

  • @seethruhead7119
    @seethruhead7119 3 місяці тому

    I like this Wes Bos guy. Is was his class that got me into software development 10 years ago.

  • @roastgg
    @roastgg 9 місяців тому +1

    I like the video quality of this podcast, care to share the camera(s) used?
    Also just gonna put this here: Wes Bos taught me javascript. I tried so many different tutorials, treehouse a ton of other things, nothing clicked until Wes Bos' tutorials. It is nearly a decade later and now I'm a Sr. UX/UI Engineer and I'm happier than I've ever been, doing what I love (which is javascript!) and other front-end things.

    • @syntaxfm
      @syntaxfm  9 місяців тому +2

      Sony FX3s with a Sigma 55mm lens.

  • @fabianmichael9457
    @fabianmichael9457 9 місяців тому +2

    You can just do this for classes: const { class: className } = $props()

  • @UliTroyo
    @UliTroyo 9 місяців тому +1

    Heck yeah! I haven't heard this podcast in ages! That's about to change if you're now on UA-cam.

    • @syntaxfm
      @syntaxfm  9 місяців тому

      Glad to have you back!

  • @rockNbrain
    @rockNbrain 9 місяців тому +1

    Heyy, nice to see your faces guys, I'm listening Syntax for a long time =) Great work guys!!!

  • @sebastianscarano9418
    @sebastianscarano9418 9 місяців тому +6

    some feedback, I would really like to see some code examples as you speak, it's so much easy to follow when you just see the code on screen

  • @brittneypostma
    @brittneypostma 9 місяців тому +6

    Currently for class you could just use class=$$props.class and it will automatically pass in the class as a prop. In Svelte 5 you can spread {…props} and use class={props.class}. I use clsx to merge classes if needed.

    • @syntaxfm
      @syntaxfm  9 місяців тому +3

      Thanks for the details Brittney. $$props always felt weird.

    • @WesBos
      @WesBos 9 місяців тому

      So if I specify a class on the parent and spread it on the child, will Svelte still know to keep those selectors in the child component?

    • @Terr590
      @Terr590 9 місяців тому +4

      It also works if you do this:
      let {class: classes} = $props();

    • @paoloricciuti
      @paoloricciuti 9 місяців тому

      ​@@WesBosunfortunately not: every class in svelte is prefixed with an hash that is unique per component so even if you could pass it down (it's already possible in svelte 4) it will not be applied to the children. Maintainers are looking into methods to make this work however.
      If you really need it tho you can use the :global() selector to remove that extra hash class and achieve what you need
      ```
      :global(.my-class){
      color: red;
      }
      ```
      This will work

    • @WesBos
      @WesBos 9 місяців тому

      ​@@paoloricciutiyeah we are using that right now, but its a weird syntax, doesnt support nesting and isn't ideal. Seems like it could statically analyze any classes that get passed into it, or we could at least specify possible classes as a union on the type def of the component?

  • @gabrieluhlir
    @gabrieluhlir 9 місяців тому +2

    My current approach is... class={style}
    And it works okay :) because I almost never pass something to style attribute

    • @phoneywheeze
      @phoneywheeze 9 місяців тому

      is it different than using tailwind merge if you're already using tailwind?

    • @gabrieluhlir
      @gabrieluhlir 9 місяців тому

      @@phoneywheeze Tailwind merge is if you have coliding classes in a conditional like:
      “bg-blue-500 {active && “bg-red-500”}”
      Never used it, but thats my idea of it
      This is the problem with passing reserved “class” attribute. Altho they say later that sou can solve that by {…rest} or something 😊

    • @justinoneill2837
      @justinoneill2837 6 місяців тому

      curious if you're still using this approach or has it evolved?
      the way i use to do it with v3/v4 was...
      Svelte 4

    • @gabrieluhlir
      @gabrieluhlir 6 місяців тому

      @@justinoneill2837 Yep, we use it in both Svelte and Astro still

  • @carlosnucette6927
    @carlosnucette6927 9 місяців тому +4

    This was very nice, I like this format.

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      Thank you! Back this Weds with a Potluck episode.

  • @ohLyln
    @ohLyln 9 місяців тому +1

    I have been a listener for years and I could never remember which voice belonged to which Twitter profile picture, I am glad to see the new video format! Will definitely keep me more engaged, I am looking forward to more from you two, thanks guys!!!

    • @syntaxfm
      @syntaxfm  9 місяців тому

      You aren't the only one who's said that. Glad to hear you liked the new format, I think it's only going to get better from here. We're listening.

  • @brokeloser
    @brokeloser 9 місяців тому

    Weeeeeeeeeelcome to syntax 0:00
    video version doesn’t have the breathy outro. Thank you 🙏

  • @patricknelson
    @patricknelson 9 місяців тому

    Wooo! This is great. With all the video content I saw coming out on Twitter I was sort of hoping this would happen someday. Would be pretty neat to also see a video version in Apple Podcasts, too (no pressure). 😊

    • @syntaxfm
      @syntaxfm  9 місяців тому

      We're trying to figure that out rn. Video podcasting feeds is very rough rn outside of UA-cam. We've even talked about building our own.

  • @987Stephen1
    @987Stephen1 5 місяців тому

    Hi! I listened to this episode when it first came out, but I hadn't started learning Svelte then. I just started learning recently, but I'm a bit confused because all the beginner Svelte 5 content seems to be aimed at people who already know Svelte 4. I did the Svelte 4 tutorial, but getting it to stick takes time. Do you know any beginner-friendly Svelte 5 videos that you can recommend?
    Also, while I'm here, I keep reading/hearing about how Rune will replace stores, but I don't fully understand how. To practice, I am trying to convert a static site to Svelte. I have a list of activities (walking, running, skating, cycling) and each of these have their own page on the static site. I moved all the activities to an activities array and I need to share that data with the +page.svelte and the Header component. I am guessing the way to do it is to create the array of activities in the +page.svelte and then pass it as a prop to the Header - as I was writing this out, I actually think I started to understand, but let me finish anyway in case it helps others - on the +page.svelte, I access the data from the load function, but to do that, I need to use `let { data } = $props();`. Once that has been added, if I try to use `export let activities....`, I get an error saying that I cannot use `export` because the file is a rune file. Now, my understanding was that I always needed to use `export let` in order to refer to the variable in the html, but now I see I can just use `let` and the `export` was just for reactivity. Thanks, rubber ducking.

    • @syntaxfm
      @syntaxfm  5 місяців тому +1

      Since Svelte 5 isn’t fully released yet, you’ll probably have to wait. However sub to this channel because we’ll be releasing a course on exactly that. Svelte 5 for everyone, not just current Svelte 5 users

    • @987Stephen1
      @987Stephen1 5 місяців тому

      @@syntaxfm Thank you! I've been listening to Syntax for years (it's my favourite podcast) and have been getting excited about Svelte for ages. I had some other things I needed to learn first, so it's been on the back burner, but looking forward to focusing on it now.

  • @yarrichar
    @yarrichar 5 місяців тому

    Speed, simplicity, size - don't forget that a 5 also looks like an S for more synergy

  • @denniszenanywhere
    @denniszenanywhere 9 місяців тому

    Good to see you guys on UA-cam. Listen to your podcast. Now how is it that you have high quality video? Are you using Riverside?

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      We’re using Riverside but the frame rate isn’t always great. We’re working on a fix.

    • @denniszenanywhere
      @denniszenanywhere 9 місяців тому

      @@syntaxfmnow I’d like to try riverside for myself. Thanks

  • @SoreBrain
    @SoreBrain 9 місяців тому +1

    I really enjoy the svelte content. I'm excited for v5!

  • @coherentpanda7115
    @coherentpanda7115 9 місяців тому +6

    The answer is no if you want a job or contract in the industry. Maybe, if you are just doing your own thing.
    But more seriously, it's great you have the podcast on UA-cam with the show notes! Sentry is putting their marketing dollars to good use

  • @ob34915
    @ob34915 4 місяці тому

    The issue with Svelte is that it isn't widely adopted, particularly among enterprise companies. They predominantly use Angular and React.

  • @friendly__drone9352
    @friendly__drone9352 5 місяців тому

    Just subbed! happy to finally have some video

  • @TokyoXtreme
    @TokyoXtreme 8 місяців тому

    When I listen to the podcast, I always imagined you two to be in 60fps.

  • @ivan.jeremic
    @ivan.jeremic 9 місяців тому

    I think you can still get into infinite loops if you change a state rune inside an effect that at the same time uses that state rune.

    • @syntaxfm
      @syntaxfm  9 місяців тому

      I think they are adding a warning for that to prevent users from attempting.

  • @justinoneill2837
    @justinoneill2837 9 місяців тому

    I'm kinda bummed about the removal of "on:" and the pipe " | preventDefault" stuff but overall happy with everything else

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      At first I felt the same and I still miss the pipe. But in practice the onclick works great.

    • @justinoneill2837
      @justinoneill2837 9 місяців тому

      for the "on:click" i really liked the visual separation with the ":" but that said i've also just learned to not question Svelte's breaking changes like i did with kits "+" folder structures (that i cant live without now) 😅@@syntaxfm

  • @dgleitaocontratos
    @dgleitaocontratos 9 місяців тому

    smaller API surface is king, I'd have to check it out to see that for myself

  • @salman0ansari
    @salman0ansari 9 місяців тому +1

    love the video format !!

    • @syntaxfm
      @syntaxfm  9 місяців тому

      Glad to hear it, we’ve been wanting to do this forever

  • @stefansdev
    @stefansdev 9 місяців тому

    Class as a prop was always a big deal for me when working with tailwind. I would constantly name it something else...

  • @sokchhunlynel
    @sokchhunlynel 9 місяців тому

    does anyone know where I can find the same headphones pads on the left person but for Sony wh-1000xm4?

    • @syntaxfm
      @syntaxfm  9 місяців тому

      They are these amzn.to/3SuWYUW
      Wes talks about them at the end of ep syntax.fm/show/669/the-svelte-sveltekit-show

  • @roberthall9452
    @roberthall9452 9 місяців тому

    It's the svirste episvode of svntax and the shvow sveatures Svelte! Is it worth svitching?

  • @Elrinth
    @Elrinth 9 місяців тому

    I tried svelte once, and quickly noticed that it required a node web server. So I instantly threw it away. Very nice it's small and fast. But if I can't put it on any SERVER it won't be universal usage.

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      Not a fan of node? You can use other JavaScript runtimes but yeah just JS for now

    • @Elrinth
      @Elrinth 9 місяців тому

      Not all web hotels have a node server for you to use.@@syntaxfm

    • @syntaxfm
      @syntaxfm  9 місяців тому

      Web hotels?

  • @petecapecod
    @petecapecod 9 місяців тому +1

    👍🏻 just for those awesome goofy faces in the beginning 🎉

  • @olavea4125
    @olavea4125 9 місяців тому

    🥳

  • @AlanDanielx
    @AlanDanielx 9 місяців тому

    Like this format

  • @sebastianscarano9418
    @sebastianscarano9418 9 місяців тому

    will this real-world svelte 5 app be open sourced? will you generate content explaining how you built it and the decision you made? (I hope you will, btw)

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      Available here : github.com/stolinski/svelte-5-drizzle-sveltekit-2-example

  • @W4nn3
    @W4nn3 9 місяців тому

    Snippets can have multiple arguments now 👍

    • @syntaxfm
      @syntaxfm  9 місяців тому

      Love that change

  • @ninjaduck3534
    @ninjaduck3534 8 місяців тому

    More Svelte please! It's like coding 3 years in the future.

  • @rwz
    @rwz 9 місяців тому

    Thee moment when, your mental image of the voices collides with reality!
    But I wasn't far off. 🤪

    • @rwz
      @rwz 9 місяців тому

      Voices are way different, since UA-cam doesn't skip silence and runs at 1.5~

  • @moneyfr
    @moneyfr 8 місяців тому

    😢😢You don't show code

    • @syntaxfm
      @syntaxfm  8 місяців тому +1

      While we’re an audio podcast moving to video, rest assured we’ll not only be showing code soon but will be doing breakdowns and tutorials as well

  • @dominuskelvin
    @dominuskelvin 9 місяців тому

    Hello video

  • @SRG-Learn-Code
    @SRG-Learn-Code 9 місяців тому

    Still watching early into the episode, but I though S5 was things on top, not many breaking changes. Why not to update?

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      It’s not breaking anything in terms that your older code will still work, but when you start using Runes, you can’t mix techniques in a component

  • @AttilaButurla
    @AttilaButurla 9 місяців тому

    "Magical, not magic."

  • @Tobsson
    @Tobsson 9 місяців тому

    Almost feel weird seeing your faces. So used to only hear your voices. Very nice tho! Now you're able to show some examples of what you actually talk about!

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      We have big plans there and have heard everyone who wants more code.

  • @ozgurNY
    @ozgurNY 4 місяці тому

    Svelte 5 runed Svelte experience. Readibility is ruined. Dev productivity is ruined. Sad because i love Svelte

    • @syntaxfm
      @syntaxfm  4 місяці тому

      Give it a real try. In my experience it's now much easier and more readable with Svelte 5. Less mysterious and just as simple

    • @ozgurNY
      @ozgurNY 3 місяці тому

      Svelte 5 rocks !! It took me a month to understand the benefits.

  • @irlshrek
    @irlshrek 9 місяців тому +3

    sorry but slots are WAY more intuitive than passing in components as props and far less ugly, in my opinion. I hope that does not become the norm because thats something i disliked about react code...

    • @syntaxfm
      @syntaxfm  9 місяців тому

      I think this is something you'll get used to and end up loving. There are def some upsides here. (I liked slots too)

    • @phoneywheeze
      @phoneywheeze 9 місяців тому

      agreed. slots especially named slots are extremely intuitive. with the switch though, svelte looks like it's moving towards a developer centered approach, compared to the one it has now, which is to enable non tech people to build uis

    • @ivan.jeremic
      @ivan.jeremic 9 місяців тому

      But you can't just use html spec thing for your language, I'm happy that rich is moving away from changing the language and that he has learned that this is not how you fix the web.

  • @jyjyjyj3
    @jyjyjyj3 5 місяців тому

    Bro looks like AI generated

  • @shrek22
    @shrek22 9 місяців тому

    Why svelte over qwik. Svelte has scale limitations. Qwik doesn’t.
    How is this not spoken about?

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      What exactly are the scale limitations?

  • @not_a_human_being
    @not_a_human_being 9 місяців тому

    They lost me with "runes", I'm done with "Svelte", sorry guys.

    • @syntaxfm
      @syntaxfm  9 місяців тому

      Which part lost you? I'm sure the Svelte team would love the feedback.

    • @not_a_human_being
      @not_a_human_being 9 місяців тому

      @@syntaxfm Well, maybe I'm not the brightest crayon. I meant to say that it does seem complicated, like non-trivial. I'm sure if someone puts their mind to it, they'll get it. But for me it's just feels extremely confusing. I guess I was trying to go with Svelte, because it appeared easier than React. Well, at least that's how it was perceived by me. But now that Runes are coming, it doesn't seem to be any easier than React, so I might as well learn React. I guess Svelte was always meant to be a "side-thing" for people who know React already. But I didn't "get the memo", so I was learning Svelte for my side-project as an alternative to React, with an understanding that it'll be easier. And "runes" sort of take that "gloss" away. Anyways - I'm sure that complexity is technically inevitable, and now that's clear. I'm sure there are good reasons for using Svelte over React (like speed or something), but that wasn't the reason for me. So, for now, I'm done with Svelte.

    • @not_a_human_being
      @not_a_human_being 9 місяців тому

      @@syntaxfm It became too complex - I might as well learn React now.

    • @nelhoa
      @nelhoa 9 місяців тому

      ​@@not_a_human_beingI tought the same at first but now I can see all the huge benefits of svelte 5

  • @LawJolla
    @LawJolla 9 місяців тому

    Syntax listener since episode 1! The face off style video is creepy. Please shoot straight on.

  • @pickavana8056
    @pickavana8056 3 місяці тому

    Sk5 RC. In Runes Mode, $:, slots, ":" (eg on:click"), |preventDefault", onMount() gone. RIP. Still looking for greater clarity on when to use effects vs derived / derived.by.. Rick says if you find you are using $effect a lot, rethink derived! Laughed when you said dont worry about infinite loops. Never hit infinite loops before SK5 but lots of times trying to get derived/effect right. You really have to reconsider/rethink reactivity to avoid infinite loops. Not as simple as it was. Converted a small app that worked with SK4 with 7 $: cut to 4 $effects in SK5, after many infinite loops!

  • @JLarky
    @JLarky 9 місяців тому

    17:47 it's so cute to see Svelte developers trying to explain how React works 🥹

    • @syntaxfm
      @syntaxfm  9 місяців тому +5

      Both of us have been writing React since 2015. Been through all of the painful api and syntax changes.

    • @JLarky
      @JLarky 9 місяців тому

      @@syntaxfm what do you think is going to happen when you try to run useEffect during SSR? :-)

    • @JLarky
      @JLarky 9 місяців тому

      I know what you were trying to say, but what you did say is really funny :)

    • @syntaxfm
      @syntaxfm  9 місяців тому +1

      Have you never had to reach for useIsomorphicLayoutEffect? I've never been able to use a layout effect in a serverside context without reaching for a 3rd party solution. Is that no longer accurate?

    • @JLarky
      @JLarky 9 місяців тому +1

      I did hear about it! But:
      - what you said is "you can't use useEffect if you have SSR", this is wrong because of course you can because you are thinking about useLayoutEffect, not useEffect. And of course you can't :) because it's not going to do anything on the server
      - second is that use of this hook is always was discouraged by docs, but you make it sound as if this is somehow a valid everyday concern that React developers have to deal with