Svelte Crash Course

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

КОМЕНТАРІ • 319

  • @TraversyMedia
    @TraversyMedia  3 роки тому +155

    Around 44:45 a few minutes got cut off when I created the Button.svelte component. It's not a big deal, you can see the code, but it cut out me creating it. Sorry about that. Also, the repo is in the description if you need to see any part of the code.

    • @shocchosolutions6275
      @shocchosolutions6275 3 роки тому +1

      Sir i dont know you see my comment or not i am yor huge fan please do react advance project video

    • @44galore
      @44galore 3 роки тому

      ua-cam.com/video/kEQAYXcR6YQ/v-deo.html is that video copying known / permitted ? Someone took your video with his own audio overlay 😮

    • @12B-m6l
      @12B-m6l 2 роки тому +1

      @@shocchosolutions6275 this is English language misuse, Sir

  • @mohammadrezakarimi2400
    @mohammadrezakarimi2400 2 роки тому +138

    00:20 What is Svelte
    00:49 Compare to React
    01:39 Why use Svelte
    03:16 What should you know first
    03:45 Svelte Component
    04:46 How to get started
    05:14 Project overview
    06:30 Let's get started
    08:01 VS code extension
    08:17 Generated files explained
    11:29 Basic fundamentals
    15:47 Conditionals
    17:16 Foreach loop
    20:20 Starting a real-world application
    01:03:34 Adding some transitions
    01:06:02 Stores

  • @hakakahamuta7175
    @hakakahamuta7175 3 роки тому +223

    You are a life changer for me! Following you for a year, I got a job. I have no words to thank you enough. I wish you all the best, buddy.

    • @vectoralphaSec
      @vectoralphaSec 3 роки тому +3

      cool. How long did you start learning web dev before you got the job? Congrats.

    • @narcissisticnarcissus4956
      @narcissisticnarcissus4956 3 роки тому

      Same for me. Self studied programmer.

    • @hakakahamuta7175
      @hakakahamuta7175 3 роки тому +6

      @@vectoralphaSec Thank you. I have been following Brad for about 10 months now, I have completed Brad's Modern HTML & CSS and Modern JavaScript courses, where I gained the most knowledge, but his free content on youtube is also enough to get a job. Good luck.

    • @Almighty_Flat_Earth
      @Almighty_Flat_Earth 3 роки тому +2

      When Svelte enters the room, the poor react, vue and angular bow down the king. But when "neo.mjs" enters the room, the svelte bows down to the legend.

    • @TheCodebookInc
      @TheCodebookInc 2 роки тому +1

      I started my own youtube channel and now a company. Thnxx Brad. Programming dad

  • @szabolcsjobbagy30
    @szabolcsjobbagy30 Рік тому +34

    This is the BEST SVELTE VIDEO FOR BEGINNERS,
    I recommend this one to everyone who wants to learn Svelte.
    And yesterday, on DEC 14, 2022
    as a historical moment,
    Sveltekit 1.0.0 was officially RELEASED,
    so the formerly beta version is now fully stable, official version!
    CONGRATULATIONS to the Svelte & Sveltekit Team!! :)

  • @-ambatuedit
    @-ambatuedit Рік тому +1

    This is an amazing video for beginners, thanks for making it free 🙏
    Tip that could be useful for someone: instead of typing all html radiobuttons one by one a foreach can be used like this:
    {#each [1,2,3,4,5,6,7,8,9,10] as currRating}


    {currRating}

    {/each}

  • @themongru
    @themongru 2 роки тому +5

    Great tutorial as always.
    As a bonus, you could implement the each loop instead of hardcoding all ten rating selections:
    {#each [...new Array(10)].map((_, i) => i + 1) as rating}

    {rating}
    {/each}

  • @ArifBillahOnGoogle
    @ArifBillahOnGoogle 2 місяці тому

    This is my first Svelte course. If I ever do anything significant with Svelte, you have a big credit to that, Brad. Thank you very much.

  • @ryanwood9288
    @ryanwood9288 3 роки тому +3

    If you are running an m1 mac, you may get an error when you npm run dev for the first time "You are not authorized to view this page" or similar.
    Port 5000 is being used by the airplay receiver, you need to use a different port. In package.json, add --port "new port number here" without the quotes to the start script and you're good to go. This will also change what port the dev script uses.

  • @omedjamal1056
    @omedjamal1056 2 роки тому +8

    for the radio buttons, we can use (bind:group={selected}).I think its more Svelte-like. thanks Brad as always.

    • @pickavana8056
      @pickavana8056 2 роки тому

      Can you please show the code for implementing this?

  • @WolfManThoughts
    @WolfManThoughts Рік тому

    Coming from a React Developer. I really like this framework a lot. Very precise, simple and helps you to exactly what you want to do.

  • @sajidshaikh3155
    @sajidshaikh3155 3 роки тому +14

    Thank you Brad for this crash course. I had asked you on Twitter if you are planning a crash course on Svelte and you had said "Yes " and you delivered 👍

  • @harigovind511
    @harigovind511 Рік тому

    The first 20 mins of this video covers more than most videos on UA-cam, you are doing great work.

  • @urssounds
    @urssounds 2 роки тому +5

    I'm 17min in and this is by far the best svelte tutorial I've seen so far already! 🙏💪

  • @SiddheshNan
    @SiddheshNan 3 роки тому +77

    Was waiting for Svelte content since long time... Thanks a lot, Brad!

    • @TraversyMedia
      @TraversyMedia  3 роки тому +50

      More to come. SvelteKit will be next

    • @nitrox5631
      @nitrox5631 3 роки тому +1

      yes me too

    • @andrewshorts1198
      @andrewshorts1198 3 роки тому +2

      @@TraversyMedia I'm looking forward to this

    • @computerscience1152
      @computerscience1152 3 роки тому +1

      Me tooooo!!!!

    • @Almighty_Flat_Earth
      @Almighty_Flat_Earth 3 роки тому +2

      When Svelte enters the room, the poor react, vue and angular bow down the king. But when "neo.mjs" enters the room, the svelte bows down to the legend.

  • @bootcampdev
    @bootcampdev 3 роки тому +29

    Svelte is getting very popular, that's awesome! 😁

    • @TraversyMedia
      @TraversyMedia  3 роки тому +11

      Hopefully we see more job openings for it. It really is an awesome framework

    • @ahmad-murery
      @ahmad-murery 3 роки тому +1

      if you are Falvio Copes the one I know then I'm expecting a new book will be added soon to your free books collection :D

    • @Almighty_Flat_Earth
      @Almighty_Flat_Earth 3 роки тому +3

      When Svelte enters the room, the poor react, vue and angular bow down the king. But when "neo.mjs" enters the room, the svelte bows down to the legend.

  • @ScrappyCoCo0
    @ScrappyCoCo0 2 роки тому +2

    The ul inside the RatingSelect component can be easily refactored to not use the same code 10 times for each input:
    {#each Array(10) as _, index (index)}


    {index + 1}

    {/each}

  • @2018-g4o
    @2018-g4o 3 роки тому +4

    The stores feature of Svelte is simply amazing

  •  3 роки тому +8

    nice to see some love for svelte, being using it for 1 year and half in production, never going back to react lol, great content

    • @felixvargasjr6678
      @felixvargasjr6678 Рік тому

      I’m looking to learn svelte, coming from react would you say that it’s just an easier tool compared to react? Sorry I’m just learning and hoping to get some insight

  • @dragonballmysteries7580
    @dragonballmysteries7580 3 роки тому +8

    I have been waiting a long time for Brad to make a course like this! I have wanted to study svelte for a while now and Brad makes it easy. Love to you and your family!

  • @s000sdas
    @s000sdas 3 роки тому

    Mr. Brad is that kind of teacher whom everybody wanted to be in his class

  • @BrettCoetzee
    @BrettCoetzee Рік тому

    Likes the video so thanks. Somthing that could be better is the RatingSelect HTML:
    {#each [1,2,3,4,5,6,7,8,9,10] as num}


    {num}

    {/each}

  • @toongurl
    @toongurl 2 роки тому +5

    Oh man I'm, so happy you're doing svelte kit. I got my start as a react dev with your videos. Now we've migrated to Svelte Kit and I'm struggling. Your content makes learning this so much easier. I hope you do a bigger project with stores and reactivity if you have the bandwidth. Even a copy of one of your old react projects but built with svelte instead would be super helpful.

  • @kvncnls
    @kvncnls 3 роки тому +18

    Yesss!! I love Svelte. Big companies need to start adopting it asap! :D

    • @salehmdev
      @salehmdev 3 роки тому +4

      Of course you'd be here :P
      I agree!

    • @TraversyMedia
      @TraversyMedia  3 роки тому +4

      @@salehmdev Kevin is the man 😉

  • @stephenjames2951
    @stephenjames2951 2 роки тому

    I really like the pace of these crash courses. Not too slow and since they are relatively short they can be rewatched if needed.

  • @justingolden21
    @justingolden21 3 роки тому +46

    Svelte is sooooooooooo much easier than React to learn, read, and write.
    Svelte kit is awesome too.
    Glad you made this video. Love your content man.

  • @stevenharder308
    @stevenharder308 2 роки тому

    Wow. Thanks for taking the time to show the different store and variable structures.

  • @it-s-me-mohit
    @it-s-me-mohit 3 роки тому +12

    Perfect timing. Was starting to learn it. 👍👍

  • @GGSoft2009
    @GGSoft2009 Рік тому

    When I find some new future, I always begin it with your crash course, Thanks!!!

  • @cosput
    @cosput 2 роки тому

    Thanks for the crash course, it's well done. Some constructive feedbacl: 7:28 degit doesn't clone, it downloads the tar for the latest commit, which is faster than cloning, and you won't get the commit history.

  • @davidpineda7072
    @davidpineda7072 3 роки тому +2

    Thanks Friend! I just started getting into Svelte, coming from an Angular and Ember background. So much wow on how easy this is. Keep up the good work!

  • @user-jb2vv1ie2w
    @user-jb2vv1ie2w 3 роки тому

    Your voice + Your keyboard sound = fantastic programming code.

  • @mageprometheus
    @mageprometheus 2 роки тому

    Excellent! I'm looking at Svelte for plugins in Obsidian so I won't need some of the app boilerplate but this completely cleared up the brain fog. Time to watch a demo using the latest and check what's changed in the past 12 months.

  • @theMiaow
    @theMiaow Рік тому

    12:25 reactive value
    19:50 overwriting array-ish vars

  • @SeattleSpursFan1882
    @SeattleSpursFan1882 Рік тому

    This was great. Thank you. I'm stoked I was able to solve the challenge you set forth AND I was able to refactor on my own once you introduced the "store" concept. All the best!

  • @luismartins1150
    @luismartins1150 3 роки тому +6

    Great video as aways. I was planning on start using Svelte and this came at the perfect time.
    I hope you do a Sveltekit crash course!!

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

    As someone who usually does backend, svelte is a lifesaver for hobby projects. React had me banging my head against the wall.

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

      Same i usually use htmx and svelte as i find react overkill for my simple projects 😂

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

      @@darthtrex9356 how is htmx? I never really tried it before, I'm not sure how request responses or errors would be handled in html

  • @rah2023
    @rah2023 2 роки тому

    this is by far the best Svelte tutorial.

  • @kittymedusa3618
    @kittymedusa3618 3 роки тому +2

    Thanks for doing a new video! You’re always staying on top of the tech trends.

  • @clingyking2774
    @clingyking2774 2 роки тому

    I can't beleive I just completed a svelte crash course! Thanks Brad.

  • @ABsazerNer
    @ABsazerNer 2 роки тому +1

    I really loved svelte through your video, it'll be my next project

  • @jonathanemmett8043
    @jonathanemmett8043 2 роки тому +1

    Dude this was great, you make things super relatable and easy to comprehend. More svelte content please.

  • @renarsdilevka6573
    @renarsdilevka6573 3 роки тому

    Such a pleasant feeling to hear your voice, so much ease and knowledge. This is golden :)

  • @skryonline5825
    @skryonline5825 3 роки тому +2

    For average and count I would do derived store. This would make it even cleaner code. Great tutorial, thought. Keep up with the Svelte, Brad! I think it has lots of potential and tutorials like this help people to learn about it. Thanks

  • @AramKoshgerian
    @AramKoshgerian 3 роки тому +15

    Amazing and so well explained as always

    • @TraversyMedia
      @TraversyMedia  3 роки тому +5

      Alpine is on the list for future videos 😊

  • @madhanganesh1
    @madhanganesh1 3 роки тому +1

    This is simply awesome, I could not stop the video once started ☺️. You have sparked a interest to do Svelte.

  • @anupamaweerawardhana9652
    @anupamaweerawardhana9652 3 роки тому +22

    It would be great if you can do SvelteKit or Svelte + Tailwind tutorial next.
    Great tutorial as always! ❤️ from Sri Lanka

    • @pickavana8056
      @pickavana8056 2 роки тому

      I think James Q Quick has one with Kit + Tailwind and he is another amazing instructor.

  • @___Kevin
    @___Kevin 2 роки тому

    First of all thank you very much, I was looking for some lightweight framework to make a simple but elegant website for a friend. Svelte is perfect for this kind of project

  • @paulthomas1052
    @paulthomas1052 2 роки тому

    Great introduction to Svelte - just what I needed. I really enjoy your work, Thanks so much.

  • @jhonatanjacinto
    @jhonatanjacinto 2 роки тому +4

    Excellent tutorial... I'm really considering migrating from React to Svelte... Things seem much much simpler with this framework. Thanks again for your work, man!

  • @wils-caru
    @wils-caru 3 роки тому +19

    Svelte is to React what React is to angular.

  • @th3oth3rjak3
    @th3oth3rjak3 2 роки тому +1

    This was a great intro to Svelte! I've been exploring a lot of front end frameworks like Angular and React. I honestly find that this is way easier to use then either of those based on this video. I'm going to have to make a few projects in it and try it out!

  • @harsimransinghbatth5032
    @harsimransinghbatth5032 3 роки тому

    Damn! Talk about timing, I've been looking to get into Svelte for the past month or so. Thanks a lot!

  • @ozgurNY
    @ozgurNY 19 днів тому

    Your tutorials are awesome. I will try to rebuild your feedback app in Svelte 5. Thanks!

  • @dav3evans
    @dav3evans 2 роки тому +1

    Really nice video mate, thankyou!
    For anyone getting to the point where you have to do the dispatch and then create the event forwarding to pass things up to the main App - If like me you thought something like "hhmmm, that's kinda clunky", absorb it as an approach and wait for the Store implementation at the end - MUCH nicer, and worth it to see how much cleaner it is.
    Question! - So I can learn more, does anyone have a take on why you'd ever use that approach with the store technique being there? Is it a legacy approach that will just be used less? Having seen both in action I can't see an immediate reason to not use a store, even for a small app.

  • @bingers_uk
    @bingers_uk 3 роки тому +4

    This is awesome. Would love it if you could do a SvelteKit tutorial

  • @klhmia
    @klhmia 2 роки тому +5

    Awesome tutorial as always, Brad. Thank you so much.
    Svelte really trolled us with these file extension names... I miss .js / .jsx - but the overall tech is awesome. Looking forward to more Sveltelteletle

  • @somerset006
    @somerset006 Рік тому

    Thanks for the fantastic tutorial! One thing I may have missed is why you did not use a loop to lay out the ratings.

  • @jialx
    @jialx 3 роки тому

    what are the odds you drop this video the day I start caring about svelte. 🚀

  • @greggreenhaw
    @greggreenhaw 2 роки тому

    I’m a knockout js user and feel it’s simpler and cleaner. I could build this example in a fraction of the time with 75% less code using knockout. After 2 years of js development I really believe native js and knockout is the best combo

  • @VenkateshMogili
    @VenkateshMogili 3 роки тому

    Thank you Brad, learned a new language today , feeling satisfied for the day❤️❤️❤️

  • @vaniad555
    @vaniad555 3 роки тому

    Perfect timing delivering svelte crash course/21 not too much out there and once again Brad delivers to us, thank you!

  • @paul2DD
    @paul2DD 2 роки тому

    a great tutorial to get you started with svelte, thank you Brad !!!

  • @TrevorTinker
    @TrevorTinker Рік тому

    Big fan of your content. This tutorial was awesome. Thank you!

  • @Almighty_Flat_Earth
    @Almighty_Flat_Earth 3 роки тому +1

    When Svelte enters the room, the poor react, vue and angular bow down the king. But when "neo.mjs" enters the room, the svelte bows down to the legend.

  • @abdullahmoiz8151
    @abdullahmoiz8151 2 роки тому +1

    Everything seems so sensible

  • @gasparcoding
    @gasparcoding 3 роки тому

    perfect summary about the latest features

  • @webspaceadam
    @webspaceadam 2 роки тому

    Just commenting this to push the algorithm for svelte

  • @blankslate6393
    @blankslate6393 3 роки тому

    Great tutorial. Clear and conscise. Please make a follow up for sveltekit.

  • @kellthusad
    @kellthusad 2 роки тому

    Even though I really like Svelte so far (I've created the Chart app with it and its very good and performant) I wouldn’t just jump into building complex prod ready apps with it just yet, instead what I'd do is 1) either create widget like apps; 2) have a monorepo with bunch of both Svelte and React apps

  • @alwayzsmarter
    @alwayzsmarter 3 роки тому +1

    Svelte is my #1 fav go svelte! Go brad!

  • @pemrograman-cepat3393
    @pemrograman-cepat3393 Рік тому +1

    I wonder what is the easiest js framework to work with? I don't care of job market, etc etc. What I care much is about development time.

  • @nukoolchompuparn8570
    @nukoolchompuparn8570 2 роки тому

    You are the best Svelte teacher.

    • @pickavana8056
      @pickavana8056 2 роки тому

      How many Svelte teachers have you tried?

  • @Ahmet_Altun
    @Ahmet_Altun 2 роки тому +1

    Svelte is amazing!

  • @ccmm4094
    @ccmm4094 3 роки тому

    Great job buddy. Concise and skillful.

  • @multitasker8830
    @multitasker8830 3 роки тому

    You are a game changer of web development 🔥🔥

  • @ScriptRaccoon
    @ScriptRaccoon 3 роки тому +3

    Great tutorial! Svelte looks good, but I still haven't seen any JS framework where the communication (in particular, upwards) between components is really easy. All that code (creating stores, importing them, or using event dispatchers) is not necessary when you write vanilla JS / jQuery. Also I really don't want to import specific animation effects before using them as in Svelte - jQuery is much better here.

  • @TannerBarcelos
    @TannerBarcelos Рік тому

    Damn state and updating state is so easy. It feels like plain programming : defining variable, due to some condition update variable. No fancy hooks or other stuff like React.
    The reactive values are still a little foggy with syntax and when to exactly use them (because my mindset is so React centric) but wow im amazed

  • @_whatistruth
    @_whatistruth 3 роки тому

    its good to have a table of contents. Thank you

  • @Franchyze923
    @Franchyze923 3 роки тому +4

    Excellent! I've been seeing Svelte more and more lately and I've been curious about it.

    • @TraversyMedia
      @TraversyMedia  3 роки тому +2

      It really is great. Some things are just so simple compared to react

    • @ba8e
      @ba8e 3 роки тому

      @@TraversyMedia It completely obsoletes React. I cannot look at any other framework anymore.

  • @johetajava
    @johetajava 2 роки тому

    At 20:00, you can use list.push(object) as long as you reassign the reference of the list variable to itself like this:
    list.push(obj)
    list = list
    It is better I think, as it doesn't copy the whole content of the array, which could be a little slower with a large list length.

    • @prch818
      @prch818 2 роки тому

      Hey! Beginner here. Why do you have to do the 'list = list'? Why isn't the list.push(obj) enough?

    • @johetajava
      @johetajava 2 роки тому

      @@prch818 The program has to update the DOM according to the data, which doesn't happen by default. The compiler takes care of this, and regenerates the view when it recognises an assignment. However, it cannot detect all kinds of changes made by a simple function call. It would be hard for it to recignise. Therefore, you can say list = list and give it a hint that it should update the view.

  • @MyALPHAguy
    @MyALPHAguy 3 роки тому +2

    I love this framework... Too bad they don't have any jobs with it in my country.... I'd definitely go for it.

    • @TraversyMedia
      @TraversyMedia  3 роки тому +2

      Yeah. Give it some time. I think we’ll see some popping up

  • @xtapa3271
    @xtapa3271 2 роки тому

    Svelte looks really interesting and I liked the tutorial. Guess I will try recreating your Feedback app. Thanks!

  • @SRG-Learn-Code
    @SRG-Learn-Code 2 роки тому

    Awesome as always, worth to watch even if you already have used svelte before.

  • @jeff_tech
    @jeff_tech Рік тому

    Awesome course! I learned a lot. Thank you Brad!!

  • @yan.mendes
    @yan.mendes 2 роки тому

    Very nice video! Congratulations and thank u for this content. I came from Vue but now im in love with Svelte 🤣🤣🤣

  • @badasscoder4481
    @badasscoder4481 3 роки тому

    wao. Awesssome Your website is now updated. It looks amazing.

  • @matthewritter8988
    @matthewritter8988 3 роки тому +1

    Great crash course! Thanks for all the great content, Sveltekit crash course next 🙏

  • @kalukheabhijit5283
    @kalukheabhijit5283 3 роки тому

    I learn lots of from your video.it is very useful for me.

  • @pappapuddins
    @pappapuddins 3 роки тому +5

    Hey Brad, solid video. Just a quick question though, wouldn't it be a bit more efficient in the feedback form component to make use of reactive values instead of creating the function that handles input? You could have one reactive value that checks if the length of text is correct, another reactive value for the disabled state of the button, and finally another one for the message, which is simply an empty string if the form is valid, or a string with your message if the form is not valid. Seems like you're missing out on Svelte's amazing reactive value system here, since two-way data binding for the text is already handled by the input.

    • @justinoneill2837
      @justinoneill2837 2 роки тому

      this is why i read the comments... valuable insight like this :)
      thanks Chris!

  • @df29208
    @df29208 Рік тому

    Very thankful for his work, but given changes have occurred, what version of Svelte dies relate to or up to? What has changed or no longer applicable.
    Around the 8:23 minute mark when it showing the package dependencies it shows 3.0.0 for the Svelte compiler. I think at one point there was a 'breaking change', one guy wrote a book and a month later Svelte changed so drastically that he said his book was out of date completely and basically not worth buying - I think it had everything to do with 'routes'. I am sure the basics are always there - or at least good to know the background of a project - to help you understand an on going continuously improving application/environment/programing language, etc. FYI MS Visual Basic had a 'language break' where nothing written in a prior version could be run with the new version - things change life must go on.

  • @irfankhanmohammed6964
    @irfankhanmohammed6964 3 роки тому

    I really like ur presentation. Thanks brad.

  • @chang112x
    @chang112x 2 роки тому

    Best JS Framework ever !

  • @Erik-rj5xz
    @Erik-rj5xz 2 роки тому

    Nice! This video was exactly what i needed to get started!

  • @vitoroliveira6170
    @vitoroliveira6170 3 роки тому

    Cool introduction about Svelte, thanks Brad.

  • @michelchaghoury870
    @michelchaghoury870 3 роки тому +2

    hello brad, gr8 vid like always, can u please show us the best way to develop large-scaled react/Next apps (no need to build an entire project) if you can give us some recommendations and best practices, how, when and other tips that help us to have a clean and well structured project even if it getts big and bigger

  • @adi_trades99
    @adi_trades99 Рік тому

    apart from the copy-pasting of the pre-made code, the tutorial was pretty good
    could've benefited from a bit more structure, but still, thank you!

  • @yehuda4904
    @yehuda4904 Рік тому

    That is very interesting, thank you so much for taking the time to share...
    The only question: "how do you do unit testing with variables that are global in a store..."

  • @MikeKoss
    @MikeKoss 2 роки тому +1

    Would it not be better to pass the store to be used down as props into the list and item components? That way you could have multiple feedback lists or whatever, and you wouldn't have multiple components depending on kind of a global state.

  • @Evildragonfirez
    @Evildragonfirez 2 роки тому

    Great video, and Svelte is awesome however events fired using the "createEventDispatcher", don't bubble, meaning I have to "bump" them up myself. That part of Svelte feels a tad bit undercooked, but thankfully, can be avoided by using the browser's native events and explicit event listeners.

  • @edwassermann8368
    @edwassermann8368 2 роки тому

    Excellent tutorial. Thank you!