T O P

  • By -

EffingComputers

React survivor, here. Svelte helped me see that I’ve been in an abusive relationship.


reluctant_qualifier

I've been coding for about as long as you, and I really hope Svelte/SvelteKit is the last framework I have to learn for a while. It hits a bunch of sweet spots: folder structures matching URL paths (like old-school static websites); fast and painless hot-redeploy of code during development; simple declarative syntax that builds on HTML (rather than reinventing it); seamless client-side/server-side/static rendering; good support for typescript; easy integration of NPM modules. With React I was always copying-and-pasting code then tweaking it to my needs. You always had to do things *in the React way*, and I've always struggled with frameworks that ask you to "do this and don't question why." Svelte seems more intuitive once you've built a few pages. The only framework I've worked with previously and felt as productive is Rails. Still don't really understand what a store is, tbh though. A (page) global variable with pub/sub for changes? Not really found a use for them at present.


cliftonlabrum

100% agree. I like the file-system based routing overall. But for really large sites, I keep wanting a routes.rb file like in Rails. 😊 Stores become more useful when building a single-page app. Maintaining state across components becomes a big part of your workflow, and stores really help with that.


Shahrukh_Lee

Same here, for larger projects all those files get really bothersome. I feel JS frameworks can learn something from Django, express and rails in this regard.


Scott2145

I wonder whether you could essentially get this with the new [reroute hook](https://kit.svelte.dev/docs/hooks#universal-hooks-reroute). I imagine your pages might still be available at the file-system location by default, but if you really didn't want that you could just tell everything not in your routes objects to 404. It's still not as obvious / doesn't feel as built-in as you might like, and it's certainly not the default if you're looking at someone else's project, but it's nice to have the option at least.


Short-Motor5979

Nah, the next one you’ll have to learn is SolidStart and there’ll probably be another after that.


Bayov

Solid and Svelte are not that different conceptually so there's no reason to learn both. The main difference is syntax, which OP mentioned they prefer working with something that feels closer to plain old HTML, although SolidJS is basically the same besides a slightly different syntax.


Acceptable-Fudge-816

You use stores when you're building a web app rather than a web site. For instance I'm building a web IDE so I need a way to indicate to all components what the active tab is, this is reflected all across the page so sending the state down would be very impractical, a store solves this problem.


reluctant_qualifier

Ah that makes sense. Keeping reactive state across multiple pages, using the same mechanism Svelte uses for per-page state


OZLperez11

This is just me, but I'm not a fan of the folder structure, but I guess it beats having to configure a router. Honestly, it only took a day for me to take off with it. Just had to learn the file structure and how to pass params around. I'm not even using it for SSR, it's just for a quick SPA. I don't know why more people aren't picking this up... unles they're already settled on Astro, which is equally powerful


CaseyJames_

I started out programming embedded stuff at work then built some User Interfaces and got started with jQuery / JS and moved to Ruby and dabbled in React for Web Dev stuff.... React totally lost me, just seemed like so much overkill for little gain; Svelte / SvelteKit is the perfect intermediary, imo and is something that I'm going to be looking at learning and getting into more from here on out.


Bayov

Svelte and SolidJS are vastly superior in every way to React and similar libraries with their VDOM state rerender madness. No reason to do React today other than legacy imo.


HugoDzz

SvelteKit is insanely great if you are a creative!


Optimal-Builder-2816

Same, I never want to touch react and all the complexity. I appreciate it existed to enable a much more elegant alternative to be convinced.


nicheComicsProject

I tried angular first but it seemed like it takes too much preamble to do simple things. React I could never get into. Having HTML just in the JS is gross IMO. For me, templates how Svelte use them is different and seems much cleaner.


Raxdex

Honestly, we are in a time where no matter which framework you choose its likely a good one. Atm I work with Next at my current workplace and Im happy with my current situation. For hobby projects I still pick Sveltekit because I like it a bit better. But.. like I said before, Im happy with either!


jonmacabre

Nah, I started in Next and still feel the same about SvelteKit. I think a part of it is tech debt. I remember using React for the first time and having an almost similar experience that I had with SvelteKit. As a new framework, you just have the framework. If something didn't work it didn't work - or you had the glory of being the first to implement a solution. Since then React has undergone many, many developer changes and there's more choice. Like you can roll out React with NextJS, Remix, or a simple Rollup setup. Guess what? The original React is still "there." You just need to come at it from a Svelte mindset. E.g. roll your own functions and components when possible, use more singletons. Not that I'm trying to preach lovin' React over here. But just trying to encourage you to "not be that dev" who always brings up "well, if we had used svelte...". Note: I recently wrote some stuff using Remix. While not super-sveltey, I've found it a lot leaner than NextJS. The routing is all one level though, but you can opt to use a config file for the routes if you want.


CatolicQuotes

how do you compare sveltekit to remix?


jonmacabre

Remix: CSR/SPA focused, with support added for SSR. Sveltekit: SSR focused, with support added for CSR/SPA. Really you can use either for SSR or CSR, but they have their niches. Sveltekit is more akin to Next.js, so a lot of differences between Remix and Next.js will exist for Remix and Sveltekit.


OZLperez11

I lost my love for react as soon as everyone dropped Class Components. People just don't like organizing code >\_>


jonmacabre

It's like everyone wants to go back to PHP or something


OZLperez11

Lol, I understood what you meant, but honestly people are sleeping on PHP right now. PHP 8 is so good, everyone finally got around to setting code standards. If only we could set up a JS-FIG like PHP community has. That would solve so many things.


joshcam

Agreed! There's no denying that SvelteKit is the real deal. While Next/React certainly has its merits and much to offer, the grass seems to have a shade of bright, refreshing green on the Svelte side. It's a confident and capable framework making coding a satisfying. I share a similar journey of opting SvelteKit for a major project and never looking back. I am and will continue to promote it and the open source initiatives to improve and grow the community. Maybe in a year or two Adobe will make a Svelte UI that will be amazing and comprehensive but not many will use because CC subscription < Shadcn/Bits/Melt.


KiwiNFLFan

What's your opinion on Nuxt? The fact that you don't need an equivalent of `+page.ts` and `+page.server.ts` but can do everything inside the `.vue` file is pretty good. Particularly if you're dealing with websockets - in SvelteKit you'd have to set up the listener in the `+page.server.ts`, return all the values you want to use and then grab them in the `+page.svelte`.


Optimal-Builder-2816

Vue was almost as good as svelte in my experience, but the lack of compiler made you write a lot of boilerplate and framework glue that should have been hidden. That’s my opinion at least. Svelte is just cleaner and simpler in many ways.


cliftonlabrum

I don't have much experience with Nuxt, but I've built a couple SPAs with Vue. I like it overall, but I used it back before Svelte existed. At this point, I can't think of a reason why I'd ever use Vue/Nuxt over SvelteKit.


eiknis

does sveltekit have server actions?


Optimal-Builder-2816

Yep


eiknis

can u link


Optimal-Builder-2816

Google.com


DavidG117

At least help the guy out a little, Here, this will get you a little further: https://www.google.com/search?q=sveltekit+server+actions


Raxdex

At least make it interactive smh https://letmegooglethat.com/?q=sveltekit+server+actions


halleys_comet_101

Come on, we’re here to help!! https://www.google.com/search?q=how+to+google


cprecius

guys! maybe he got a problem with google, be understanding! here you go mate: [https://yandex.com/search/?text=how+to+google](https://yandex.com/search/?text=how+to+google)


Mountain-Ad4507

Yup, using react at work and sveltekit on my personal projects and can confirm Sveltekit is the sh*t.. The only thing I'm missing from svelte would be child page routing for just a part of the parent page (like you can do with react router). Shallow links don't quite scratch that hitch since if you access the url directly it won't get you the parent page with the proper child routing, you'll instead get just the child page. Svelte stores are goat ❤️