NextJS VS SvelteKit in 2024...

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

КОМЕНТАРІ • 120

  • @michaelfrieze
    @michaelfrieze 9 місяців тому +22

    It's really quite simple. If you are more MVC minded, you are not going to like RSC's. React was inspired by XHP which was a component-oriented architecture and the "concern" has always been the component. RSC's componentize the request/response model. React has moved further away from MVC and closer to their component-oriented vision. This has ruffled a lot of feathers just like JSX did back in the day when people were complaining about "separation of concerns".

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

      Yep

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

      And Which most jobs required MVC experience right?

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

      Exactly why I prefer Sveltekit

    • @nymez6968
      @nymez6968 3 місяці тому +1

      @@mwlulud2995SvelteKIT isn‘t exactly MVC either.

  • @salamonrosenberg-vh5xo
    @salamonrosenberg-vh5xo 3 місяці тому +9

    I use SvelteKit with Rust ActixWeb as a backend....fast as hell and simple enough....

    • @davidrempel433
      @davidrempel433 21 день тому

      I'm just curious how you implement this? Do you have a library that glues them together, or is it just a svelte frontend calling a rust backend?

    • @salamonrosenberg-vh5xo
      @salamonrosenberg-vh5xo 21 день тому

      @davidrempel433 hey bud.... it's just API calls to Actix....

  • @HONjramiroz98
    @HONjramiroz98 9 місяців тому +8

    Started using svelte+sveltekit and agree with all you said
    Now I’m learning next js, mostly to understand how it works and adding that tool to my set of tools, but… I’m staying with Sveltekit for the moment, it just works super great

    • @iulikdev
      @iulikdev 2 місяці тому +1

      Me too... sveltekit it's all i need.

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

    The only thing I hate about nextjs is that it's hard to host it anywhere other than vercel or something like netlify, and we all know vercel's pricing isn't the cheapest

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

      Yea I have heard horror stories about next on other platforms. Vercel is great at small scale but yea the pricing as you scale is absurd, a literal 5-10x markup on AWS sucks a lot

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

      There are videos on UA-cam on how to host Next on other platforms

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

      If you want Serverless good luck, and SST is not a solution still young still has many problems, we tried it. So docker or vercel it is 😅

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

      The same thing happened to me with sveltekit until I decided to just create a docker image and deploy it on railways. With docker, deployments are much easier.

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

      @@miguelalzate4850 Really? I was thinking that sveltekit didn't have that problem, I hope that the new version of SST will fix some issues :D

  • @fcnealvillangca7943
    @fcnealvillangca7943 9 місяців тому +7

    it's faster for me to finish in sveltkit so I went sveltekit

  • @ransomecode
    @ransomecode 4 місяці тому +3

    Here's the issue with NextJS; say you have a database with 10m todos, if you are to fetch all that on the sever when rendering the page then it's going to take some time before the user is able to see the page; Remember if you overworking the server then it's going to be a bad experience for all the users. This becomes an issue when you have stuff like dropdowns, accordions or any kind of input/data driven components; You don't want to fetch the data upfront unless the user is interacting with the component. I think this "hype" is something created by the cloud software companies like Vercel to boost their revenue. The more server side resources you consume, the more you have to pay these companies, draining your pocket and filling theirs. Don't go with the hype, think before you code!

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

      😂😂 you need to learn more about web performance

    • @nymez6968
      @nymez6968 3 місяці тому +1

      Well that‘s why you don‘t do that. Blocking the initial page load until some potentially long running operation is done screws you no matter which Framework you use. You need to learn about React Suspense. Understand how to use the tech before starting to complain about it.

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

    The only thing that keep me on Svelte/Kit is transitions. So easy that I can't live without it anymore. Until Leptos (Rust) or someone willing to commit to Zig and do something similar I do NOT think I will ever leave Svelte/Kit behind.

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

      Is it easier than Vue ? I'm a Backend Dev looking to go Fullstack, trying to choose between Vue and Svelte.

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

      @@NathanielBabalola First, I don't know Vue but taking a look at their docs seems like you need to do some CSS and this is a matter of your opinion. I think Svelte is simpler but not as customizable as Vue (although you can create custom transition in Svelte, It's a pain).
      Why Svelte is simpler is that you don't need to do CSS and just
      `import { fade } from 'svelte/transition'`
      and just use it on element directly:
      `This will fade in and out on create and destroy`
      You can take a look at the examples. Just search for '{framework} transitions'.

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

      @NathanielBabalola
      If it is about transitions, In svelte it is just include "transition:fade" , "in:fade" or "out:fade" in html tag just like that. And about Vue you have to declare CSS class, I don't know if there is any other method in Vue because I just use UI framework.
      If it is about front-end only framework then I don't think it is that much of a different. In Vuestate is ref() in svelte 4 is just "let" and in svelte 5 is $state(). Vue use Virtual DOM while svelte not.
      If you understand how state works I don't think you will have a problem switching between different front-end framework. It is just a state with different underlying method like react state use hook, Vue state use signal.

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

    I'm the other way around, I come from React too and definitively don't miss it. But server components seem very appealing.

  • @tomich20
    @tomich20 9 місяців тому +7

    I prefer sveltekit, but had to switch to nextJs because of the community and the amount of libraries and plugins. UI libraries, Datatables, Full proejct examples online, etc.

    • @DoctorMandible
      @DoctorMandible 4 місяці тому +3

      Svelte can use any vanilla js library, typically with no extra effort. Worst case scenario you simply use the library in a js/ts file and then export the functions and classes you need into your svelte file.

  • @squ34ky
    @squ34ky 9 місяців тому +40

    I'm a staunch proponent of using a real backend language for your backend, like Go.

    • @zBrain0
      @zBrain0 9 місяців тому +15

      The problem is typing. And by that I mean both creating types and pushing buttons on your keyboard. When I use a typescript backend I can enforce my apis to conform to a specific model and the important part is I only have to write it once. I don't have to make sure that my models in whatever language match my models in the front end, because I can use the same models. It saves so many headaches. Go is great in a lot of ways, but writing everything in two languages just isn't worth it unless you have a specific backend use case that requires a high level of multithreading for some reason.

    • @Kats0unam1
      @Kats0unam1 9 місяців тому +14

      @@zBrain0 "writing everything in two languages just isn't worth"
      Oh my fucking god. We it rock bottom. You literally just said that writing a backend in a proper language that is not fake type safety is not worth it. Just just fake type safety, good look maintaining that project dependencies in the next 5 years. I'm doing that right now and its a pain in the ass.
      But yeah, If you wanna keep doing your startup bullshit and side gigs, use whatever you want.

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

      " If you wanna keep doing your startup bullshit and side gigs, use whatever you want"
      If you're saying you wouldn't write your startup in Go, aren't you agreeing with the main point of the video?@@Kats0unam1

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

      "real backend language" is silly but I get what you're saying. There's no silver bullet and it's all tradeoffs. For a production grade application there are more things to consider, but for solo dev side projects, it's a much better experience writing everything in one language.

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

      @Kats0unam1 ok son. Apparently you have never tried supabase. Good luck when your backend team makes a change and your api breaks because by definition you can't guarantee they are going to match. Have fun with that.

  • @good-dev-student
    @good-dev-student 9 місяців тому +3

    Any new video using open ai chatgpt project example ? Using sveltkit ?

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

      Just built the example project today :)

    • @good-dev-student
      @good-dev-student 9 місяців тому +1

      @bmdavis419 cool 😎 you the top youtubers that I follow and like you're awesome man 👌

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

    Auth with sveltekit still gets me to this day, was trying to implement the auth with supabase but the set up seem so complex

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

      Its not actually complex, the docs just suck, just the video I just uploaded!

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

      I found it's the other way around for me ahah

    • @Indonesia_Emas_
      @Indonesia_Emas_ 7 місяців тому

      firebase already great and free and you can crate your own jwt token, you just need to practice more and gather more information.

  • @nrgstudios612
    @nrgstudios612 6 місяців тому +1

    Speaking of more templates for Svelte, if anybody knows any templates for SvelteKit that uses Supabase Auth lemme know

    • @bmdavis419
      @bmdavis419  6 місяців тому +1

      I'll have a video on this pretty soon

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

      @@bmdavis419 Awesome! Please be sure to include the repo as well 😅

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

    Unfortunately I don’t have time to study and stay proficient in 2 frontend frameworks, and money is currently in Next, so that’s where I am at the moment.

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

      same with me.

    • @Indonesia_Emas_
      @Indonesia_Emas_ 7 місяців тому +3

      bruh learning frontend is not that hard, a couple days you are ready to rock, learning ai is something challenging.

    • @GabrielGasp
      @GabrielGasp 7 місяців тому

      @@Indonesia_Emas_ sure, now go and center a div for me.

    • @edgardevelops
      @edgardevelops 7 місяців тому

      @@Indonesia_Emas_ couple of days to learn frontend? have you worked on a large codebase before? Implemented features no library exist to help?
      If you can learn frontend + every popping frameworks + ui frameworks + libraries in just couple of days. Salute to you.

    • @Indonesia_Emas_
      @Indonesia_Emas_ 7 місяців тому +4

      @@edgardevelops yes, the frontend logic are just same, just with different sintax

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

    You can have streamed data in sveltekit as well.

  • @ShourovRoy-pk5zm
    @ShourovRoy-pk5zm 5 місяців тому +1

    In sveltekit the load function stop the routing until tge data fetching complete and if you are thinking about stream with promises. Then it won't be server rendered. Where in nextjs suspense data can be found in pageview html data.
    Its a huge with for Nextjs

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

      Await each data object seperately in your load return. Like return { await dataObjectA, await dataObjectB}. Then when they are brought into your page they will load individually, lazily

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

    I thought I was subscribed
    Sorry, now I am 😊

  • @good-dev-student
    @good-dev-student 9 місяців тому +1

    ❤❤ great video 🎉

  • @boccobadz
    @boccobadz 9 місяців тому +10

    How can one say that Svelte ecosystem is not great? I guess that's your biased "react devs". Svelte ecosystem is JavaScript ecosystem. You can use any library that is out there. On the other hand, to use libs in React you need some weird bindings (aka "the react way"), which have nothing to do with JS lib, docs often aren't there or are clanky at best, etc - eg Apache eCharts is a great example - amazing to work with in Sveltekit (even when doing the most complicated stuff well beyond the docs) and abysmal experience in React/Next world (to even run the simplest charts). And that's only one example, there are countless out there. With Svelte 5 it will be even better. React is just bloated mess at this point.

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

      Yea this is a good point honestly, what I more mean when I say react has better ecosystem is that when a company makes an SDK for their thing, 9/10 they will have a special optimized one for react, but not for the other frameworks and you have to work around it which can be kinda annoying

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

    Jack Harlow 😂

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

    I can't deal with the lack of nice UI kits in Sveltekit anymore. I value my time in that matter... Writing react doesn't seem like a pain after seeing how many hours you need to spend to get a professional looking app with Svelte.

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

      Though I prefer react as well but I saw that svelte has their own version of shadcn ui, skeleton or Melt

    • @Sillyvan
      @Sillyvan 9 місяців тому +12

      "I can't deal with the lack of nice UI kits" sounds like you build multiple sites a month which all of need a completly different UI
      the big names are literally usable in svelte. and saying "value my time" just means ur too lazy to write your own styling. this will be an issue no matter the framework you choose

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

      Second vote here for shad cn svelte. With either some copy and pasting or a few command lines you have a set of components that have really good defaults and if you want to you can customize them. Problem solved. React had its day in my opinion, but with tiny bundle sizes, soon to be really crazy accurate levels of reactivity in version 5 and just a hell of a lot less boilerplate for me it's not even worth considering react in 2024

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

    what about qwikjs?

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

      And yet another virtual dom

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

      Qwik is not that appealing because of too many requests for user interaction, normally it is better to expend 3 seconds for the page to load and user interaction be instant than load the page instantly and user interaction takes 500ms
      Astrojs with island architecture is the way if you want really good SEO scores
      Nowadays people are focusing on HTMX to reduce web development complexity

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

    Just here to let you all know how great Remix is. Have a good day.

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

      remix is fire

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

      it doesnt even have csrf out of the box

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

    Simplified illustration...

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

      Very much so yes, there is way more nuance and complexity I obviously did not cover here, but this gets the high level point of the frameworks across

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

      Yeb, indeed, the way of splitting the client side of server side in Sveltekit is pretty good, plus, if we can call it merging them in the "Form Actions" in a magical way, I think that's what makes Sveltekit more predictable when dealing with "Form Actions" !!!

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

    I thought this dude was a Go dev…lmao wtf happened

  • @boot-strapper
    @boot-strapper 8 місяців тому +1

    nextjs suuuuucks. Just use svelte, solid, or hell even vanilla js.

  • @quantum-ng8bs
    @quantum-ng8bs 9 місяців тому

    Laravel >> SvelteKit > Next.js

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

      I used to develop using Laravel, but not going back. I really don't see what's better about it, it works even slower than node/bun based frameworks, worse type safety, the PHP itself is even worse than JS in terms of dx

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

      We are in 2024 and you say Laravel?! 🤣🤣🤣

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

    Here is an idea from someone who used to follow you and doesn't anymore, because I think your takes are questionable:
    How about we dont use a fake type system like Typescript on the server and use a proper language (C#, Go, Java) on the backend and just use Typescript for what was intended to, aka, manipulate the DOM on the browser.
    I have a medium side project that will go to prod maybe next month with Go, HTMX, Templ, Tailwind, PGX. The only js dependencies I have are arc to display some curved lines on openlayers, htmx, and tippyjs to display some tooltips on the map. I installed tailwind though the CLI which means I have 0 need for node_modules and package.json management. 0 js library dependencies and maintenance in 5 years when I want to add / bug fix my projects ? Count me in.

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

      I'm not an expert, but SvelteKit has this nice thing were you are in a sense more "declarative" in your construction. You load all the data you need to build your page. Then you use the data to build your page. In your page you have a bunch of forms that allow the user to submit information that will potentially change the data on the server. Now the fun part is that you don't have to worry about updating all the potential parts on the page that will have to be updated with the new data - you just call to "invalidate" those fetch requests whose data may have been affected by the form submit.
      You could write an API backend in Go and still use SvelteKit, but it seems the issue is that you end up writing stuff twice, types become more painful.

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

      I've said before and I'll say again that I pretty much agree with this, its just that for MY use cases, fullstack TS is better. I am on a small team that has to move fast, I have a separate go in backend in prod rn, and it sucks to maintain. No one disagrees that Go is a faster/stronger language for the backend, its just that TS can get the job done. And it gets the job done way better then I think people give it credit for...

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

      "you end up writing stuff twice, types become more painful" EXACTLY I WENT THROUGH THIS EXACT THING

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

      @@bmdavis419
      "you end up writing stuff twice, types become more painful"
      yeah so.. what you mean is... you have to... type.. code ? Crazy concept.
      You write typescript and you dont enjoy writing type for the backend schema. There is a solution for that, its called Javascript.

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

    Can you take a look hugo & svelte?, well explained ❤

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

    Ur opinion is irrelevant

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

      Why are you watching the video then? Must be relevant to you.

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

      based

    • @dave-7117
      @dave-7117 9 місяців тому +1

      I dont understand why people are so mean. You dont Show your face in Public as he does. You can have your own opinion but unless you dont speak in public you wont help anyone or change anything.
      @bmdavis419 Keep on sharing your thoughts, always nice too see how others are looking at the current situation.

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

      @@dave-7117 appreciate it man, honestly I don't really care if people are mean on the internet, it gives more engagement which helps the channel and I earnestly believe in what I'm saying/making and thats enough for me

  • @iulikdev
    @iulikdev 8 місяців тому +2

    Only sveltekit... forever!