I rrcently learned that you can invalidate the page data. So when adding a new todo, you can just use:enhance={()=>invalidateAll()} and the todos get automagically refetched without reloading the whole page.
@@abd-ulbasit What ben is doing is a normal post request. Not only does the server handle the post request, it also has to resend all the static assets and JavaScript bundle. By using enhance, you only need to invalidate the data and not refresh the whole page.
I'm honestly surprised at how the universe is working right now. I just started a svelte + golang project a few days ago, and watched a video or two of yours on Golang development. Now I find a video on this from you? Sick!
I used svelte 2 years ago for a side project and it really got me back into loving web development again. I haven't been able to use it since though. Seem to be forever stuck deep in react land now.
been a Rails fan since 15 years ago. Did more backend in the last 5 years. But yeah, Sveltekit made me excited about web dev again like Rails did 15 years ago. Impressive.
I love my current Stack! Go + Postgres + SQLC + Svelte (+ Tauri). Im not using Kit if there is no reason to though. This constant "upselling" to meta-frameworks is just annoying. Probably because they want you to deploy on the edge with vercel. I get very decent performance just throwing everything containerized on Hetzner VPS's. It's multible times cheaper than anything else. RAW SQL is also the way to go for me. Those API's for SQL constantly hit "edge cases" where you have to build workarounds for simple transactions.
@@papajohnsuk5965 You can either use boolean flags or nullable parameters. In the SQLC documentation you can read more about this at HOW-TO GUIDES/Naming parameters/Nullable parameters Edit: The first method would look like this: UPDATE todos SET title = CASE WHEN $1 = TRUE THEN $2 ELSE title END done = ... WHERE ... RETURNING *;
@@phoneywheeze it's a compiler U write vanilla SQL and it will create a type safe data-access-layer using the standart Go SQL standard library you will get structs for the tables (your models) and a method for each querry (+ a params struct that defines the params for the querrie) The nice thing about it is that you still have vanilla SQL without abstractions on top of it. It also saves you from all those stupid mistakes you can make when writing SQL (typos & syntax) It's another option to interact with a database additionally to ORM's, vanilla or the SQLx thing Ben showed in his previous videos
I had similar experience 2 weeks ago. I said to myself "This should have been the web dev all along". But now I am back to nextjs because of a UI library I should use.
Well it’s absolutely worth it to use a meta framework for actual web apps as seo and robots require contentful html. If your planning on building an internal tool or a desktop using tauri or electron that doesn’t require seo and robots to understand them then just throw that meta framework out the window and use svelte by itself and Golang as the backend. Perfectly reasonable.
The only reason I can think of using sveltekit in a desktop app is to simply the routing. If you have a complex app such as a game with multiple levels/scenes. Clean up is really simple by just loading a seperate endpoint.
@@dandogamer lol just use svelte routing or routify, I’m not even sure if it’s possible to run a meta framework on electron but I’m positive it’s not applicable with tauri. Also using a whole server for one user on a desktop app would be wack but yeah essentially your right routing is good but I think sveltekit would be complete overkill for just that.
I think even for internal tools using Sveltekit makes sense, as it adds a real opinionated structure to your Svelte app and for a company project working on a team it can benefit from it, as it adds a bunch of useful features (and default routing). I am personally building at my company a project based on Sveltekit frontend + Spring boot backend API in Kotlin to avoid boilerplate. BTW you can make SvelteKit work only client side by disabling Server Side Rendering globally, and for me it's better than just using Svelte as it's basically Svelte SPA + the structure of SvelteKit. The only downside is that you miss access to SvelteKit features and libraries that work with server side, so for now I am using the same setup as in this video.
i love sveltekit so much. i mostly use it just standalone with prisma for an ORM. i should probably branch out more and learn how to write backends in go
I noticed the same thing with React [ timeline | 15:00 ], they are at this moment going through a transition and starting to do things differently. When I began learning React was when the changes began. The moment I began to kind of understand the useState and useEffect was when out of nowhere these changes occurred. I got turned off Because of this and gave up and decided to jump onto Android and even did some Django for the backend for my Android app which I am working on. But anyways, congratulations on your project! I am very impressed with what you demonstrated; it is inspiring to see what you created so far. I hope to reach the level of mastery you have. Very impressive work. You are very skilled at your craft.
I have quite an experience in my work in marketing but I am so excited for Svelte. I would trade my marketing work for a low salary in a different country just to do what you do. I'm learning more JS for now.
And the problem before with form actions was that you had to refresh the hole page, so we moved to client setup and had a validation on client so the feedback is faster, but now it's just small html being sent back and the hole page is not refreshing, so just validate on the BE 😁 really nice!
Call me crazy but I just started learning F# yesterday and am really enjoying it (Been reading books on functional programming this year and really love it). I may try their SAFE stack. If my delusion wears off, I’ll run back to Go land and hop on this stack haha
I'm running into this weird split where I do like SvelteKit with Go Fiber backend, but it's a pain to deal with two servers. You can make beautiful websites with SvelteKit and SkeletonUI, but for laughs I'm going to give HTMX and Picocss in Fiber. If I can make it 90% pretty and reactive I might split my projects types in two where I use either SvelteKit only or Fiber only.
Today, I made a new friend and met a new teacher. 🎉❤ I have an opinion. I believe it would be great if you added validation to the inputs. I'm not sure how to do it, but I think it would be beneficial to include it in both the front end and back end. 😊 Would you consider implementing this?
I think it has a little problem Like A request comes to the frontend server, and from there it goes to backend server if both servers are different that is an overhead.
This is a great approach. Isomorphic javascript is one of the worst things to ever happen to the web. Properly separating frontend and backend and using appropriate technologies for each is the best way to go.
am i right in saying that in sveltekit (and other frameworks) that pages are either hydrated or not? i.e SSG vs SSR with CSR taking over in the browser. What about your thoughts on the Island Architecture for frontend, i.e partial hydration? The framework astro does this and you can use svelte for the interactive islands
Partial hydration is really cool and probably the future, for now svelte is just ssg or ssr which imo is fine, I would bet sveltekit 5 is gonna do something like that
The only problem with Svelte is lack of rich and mature UI components like Quasar, Vuetify, PrimeVue, PrimeNg, PrimeReact. For this reason I prefer Nuxt with Quasar. I have no time to reinvent the will and dig into css or tailwindcss
i just release 2 softwares, one using next13 and another one with sveltekit and sveltekit looks pretty better right now, beside next13 router its super slow, which is annoying. and all backend go
You are watching the video well. I have a question. Why is the configuration of the go fiver server different from the one you uploaded, 'ua-cam.com/video/Gktt4w74LO4/v-deo.html'? I know this is a video uploaded by upgrading the existing 'ua-cam.com/video/6C-2R92L01Q/v-deo.html'.
I haven’t tried svelte, but the thought of yet another JavaScript runtime environment is not appealing. Node and the browser is more than enough environments, I don’t need to learn another environment which is framework specific. I’ll stick with Vue. :)
What its the point to replicate all that back-end logic, using literally native browser functions just to "do not refresh the page"? any back end language + MVC would make the same thing, even more complexe steps and flows on the frontend (with useCase Pattern + DDD), and if you need some interaction on the client, why not just add some little bit of js code instead using this heavy js framework runtime with re-rendering on the front end, even with "compilation", "its just js on the client-site" ? just to "not refresh" the page? i know that's is why people are saying that next js, sveltkit, and all this metaframework its becoming php, this old, realiable techs past the test of the time, and now, here we are, svelte kit + go for me, dont make any sense, Simple SPA's for APPS on the client (hybrid mobile apps and PWA are an amazing use case). PHP, Go, or anything and just the minimal javascript, for the real full stack.
Sorry but praising a js framework for "no js on the client" capabilities is just a bad meme. Sure that might be true in this case, then what? do you build for nojs users? good luck with that! Problem is it's TOO HARD to predict/understand when the functionality will be or not javascript, gets messy real quick.
I probably phrased it wrong then because what I meant to praise was MINIMAL js. I am not a no js guy, I am a minimal js guy and Svelte is perfect for that with progressive enhancement.
This is literally web forms in 2005 when i started web dev. Fashion made a circle.
I rrcently learned that you can invalidate the page data. So when adding a new todo, you can just use:enhance={()=>invalidateAll()} and the todos get automagically refetched without reloading the whole page.
just `use:enhance` alone would do that as well
but in that case, it would make a whole new fetch request to the server. The way Ben is doing, help to reduce unnecessary load on server
@@abd-ulbasit well said sir.
@@abd-ulbasit What ben is doing is a normal post request. Not only does the server handle the post request, it also has to resend all the static assets and JavaScript bundle. By using enhance, you only need to invalidate the data and not refresh the whole page.
I'm honestly surprised at how the universe is working right now. I just started a svelte + golang project a few days ago, and watched a video or two of yours on Golang development. Now I find a video on this from you? Sick!
Same feeling here, it's seems the universe is deterministic.
I used svelte 2 years ago for a side project and it really got me back into loving web development again. I haven't been able to use it since though. Seem to be forever stuck deep in react land now.
it's sad that corporate prefer react while svelte really will boost productivity with it simple way of thinking
You do know that's pretty much the old way of doing things with just some star dust on top. That said - the star dust is pretty cool :)
The older I get the more I think they just got this right in the 90s and we just made things worse for very specific problems most people don’t have
Exactly what I love about sveltekit. Jump straight from jquery to svelte skipping all the other garbage Js frameworks. i only hope more people use it.
I'm pretty far into the Nextjs ecosystem but I'm Sveltekit curious
been a Rails fan since 15 years ago. Did more backend in the last 5 years. But yeah, Sveltekit made me excited about web dev again like Rails did 15 years ago. Impressive.
I love my current Stack!
Go + Postgres + SQLC + Svelte (+ Tauri).
Im not using Kit if there is no reason to though.
This constant "upselling" to meta-frameworks is just annoying.
Probably because they want you to deploy on the edge with vercel.
I get very decent performance just throwing everything containerized on Hetzner VPS's.
It's multible times cheaper than anything else.
RAW SQL is also the way to go for me. Those API's for SQL constantly hit "edge cases" where you have to build workarounds for simple transactions.
how do you handle optional fields in sqlc, for example when making a patch request, only certain fields need to be sent
@@papajohnsuk5965 You can either use boolean flags or nullable parameters.
In the SQLC documentation you can read more about this at HOW-TO GUIDES/Naming parameters/Nullable parameters
Edit: The first method would look like this:
UPDATE todos
SET
title = CASE
WHEN $1 = TRUE THEN $2
ELSE title
END
done = ...
WHERE ...
RETURNING *;
Yea u definite do not need a meta frame work, I personally like having it but it’s not needed
what's sqlc?
@@phoneywheeze it's a compiler
U write vanilla SQL and it will create a type safe data-access-layer using the standart Go SQL standard library
you will get structs for the tables (your models)
and a method for each querry (+ a params struct that defines the params for the querrie)
The nice thing about it is that you still have vanilla SQL without abstractions on top of it.
It also saves you from all those stupid mistakes you can make when writing SQL (typos & syntax)
It's another option to interact with a database additionally to
ORM's, vanilla or the SQLx thing Ben showed in his previous videos
I had similar experience 2 weeks ago. I said to myself "This should have been the web dev all along". But now I am back to nextjs because of a UI library I should use.
Well it’s absolutely worth it to use a meta framework for actual web apps as seo and robots require contentful html. If your planning on building an internal tool or a desktop using tauri or electron that doesn’t require seo and robots to understand them then just throw that meta framework out the window and use svelte by itself and Golang as the backend. Perfectly reasonable.
Couldn't have said it better!
The only reason I can think of using sveltekit in a desktop app is to simply the routing. If you have a complex app such as a game with multiple levels/scenes. Clean up is really simple by just loading a seperate endpoint.
@@dandogamer lol just use svelte routing or routify, I’m not even sure if it’s possible to run a meta framework on electron but I’m positive it’s not applicable with tauri. Also using a whole server for one user on a desktop app would be wack but yeah essentially your right routing is good but I think sveltekit would be complete overkill for just that.
@@massy-3961 haha I was trying to clutch straws with that one
I think even for internal tools using Sveltekit makes sense, as it adds a real opinionated structure to your Svelte app and for a company project working on a team it can benefit from it, as it adds a bunch of useful features (and default routing). I am personally building at my company a project based on Sveltekit frontend + Spring boot backend API in Kotlin to avoid boilerplate.
BTW you can make SvelteKit work only client side by disabling Server Side Rendering globally, and for me it's better than just using Svelte as it's basically Svelte SPA + the structure of SvelteKit. The only downside is that you miss access to SvelteKit features and libraries that work with server side, so for now I am using the same setup as in this video.
i love sveltekit so much. i mostly use it just standalone with prisma for an ORM. i should probably branch out more and learn how to write backends in go
I started working with this stack a year ago never been relaxed like this. thanks for this video
I noticed the same thing with React [ timeline | 15:00 ], they are at this moment going through a transition and starting to do things differently. When I began learning React was when the changes began. The moment I began to kind of understand the useState and useEffect was when out of nowhere these changes occurred. I got turned off Because of this and gave up and decided to jump onto Android and even did some Django for the backend for my Android app which I am working on.
But anyways, congratulations on your project! I am very impressed with what you demonstrated; it is inspiring to see what you created so far. I hope to reach the level of mastery you have. Very impressive work. You are very skilled at your craft.
A suggestion, you may increase the ide font size because it will help a lot for people who watch from phone 😊
I tweak Pocketbase and use SSG + hydration.
I'm not into Edge craze.
What theme VSCode are you using?
I have quite an experience in my work in marketing but I am so excited for Svelte. I would trade my marketing work for a low salary in a different country just to do what you do. I'm learning more JS for now.
I'm old enough to have started with the web in the late 90's and watching this, is giving me nostalgia... XD
I use django with sveltekit ❤
What a flashback to when I was doing php 12 year ago 😁 But this is great! Keep up the awesome videos! 😊
And the problem before with form actions was that you had to refresh the hole page, so we moved to client setup and had a validation on client so the feedback is faster, but now it's just small html being sent back and the hole page is not refreshing, so just validate on the BE 😁 really nice!
Call me crazy but I just started learning F# yesterday and am really enjoying it (Been reading books on functional programming this year and really love it). I may try their SAFE stack. If my delusion wears off, I’ll run back to Go land and hop on this stack haha
😂.. that's what made us Engineers in the first place, not afraid to get our finger tips dirt.
I'm running into this weird split where I do like SvelteKit with Go Fiber backend, but it's a pain to deal with two servers. You can make beautiful websites with SvelteKit and SkeletonUI, but for laughs I'm going to give HTMX and Picocss in Fiber. If I can make it 90% pretty and reactive I might split my projects types in two where I use either SvelteKit only or Fiber only.
Only thing missing from svelte is shadcn/ui library. I know that there is a svelte port but I need data tables and it is not available yet.
Yea Im not a svelte user but i came across the video "The Anti Component Library" it was cool
There's tanstack table, also drizzle orm just made a studio with svelte could leverage to see what they did for their data table
Yeah the data table is built on top of tanstack table which has a svelte adapter. It shouldn't be too hard to port, I'd expect it co come out soon
The cool thing about svelte is that many vanilla js libraries work with it. Hope that expands your search beyond the "svelte-*" libraries
It's available now btw (look into the docs of shadcn-svelte)
I moved 4 years ago from React to Svelte. No regrets... Svelte makes my life easier and happier.
Great video, thanks for the insight. However, I found background music to be load and really annoying, you might consider it for future videos.
Yea I definitely screwed that one up lol, it was way too loud I edited this waaaaay to late at night
It would be cool if the terminal is not taking up half of the screen xD
Today, I made a new friend and met a new teacher. 🎉❤
I have an opinion. I believe it would be great if you added validation to the inputs. I'm not sure how to do it, but I think it would be beneficial to include it in both the front end and back end. 😊 Would you consider implementing this?
I noticed that you're hiding your id input with a CSS class. Is there any reason not to use ?
Quick correction: excited not exited. All good we all make small mistakes
WHY DON'T THEY PUT SPELL CHECK IN THE TITLE BOX I PHYSICALLY CANNOT SPELL
@@bmdavis419God Damn youtube
Did you use a tutorial to learn before building? Or you just googled as built?
3 days no news video, i miss you man ❤😢
I think it has a little problem
Like
A request comes to the frontend server, and from there it goes to backend server if both servers are different that is an overhead.
I’m not a frontend guy, I dont really understand these metaframeworks but my impression is he ended up using 2 backends in this video
This is a great approach. Isomorphic javascript is one of the worst things to ever happen to the web. Properly separating frontend and backend and using appropriate technologies for each is the best way to go.
am i right in saying that in sveltekit (and other frameworks) that pages are either hydrated or not? i.e SSG vs SSR with CSR taking over in the browser. What about your thoughts on the Island Architecture for frontend, i.e partial hydration? The framework astro does this and you can use svelte for the interactive islands
hmmm it seems astro needs to use SSR mode to use form actions
Partial hydration is really cool and probably the future, for now svelte is just ssg or ssr which imo is fine, I would bet sveltekit 5 is gonna do something like that
Yes!!! Svelte and golang for the win!!!
The only problem with Svelte is lack of rich and mature UI components like Quasar, Vuetify, PrimeVue, PrimeNg, PrimeReact. For this reason I prefer Nuxt with Quasar. I have no time to reinvent the will and dig into css or tailwindcss
Skeleton UI is really really good
thanks Ben
Htmx + go backend will be the future
Yea we’re gonna be trying this sometime this month
How did you handle infinite scrolling?
Did you consider of using phoenix (elixir) instead of go?
i just release 2 softwares, one using next13 and another one with sveltekit and sveltekit looks pretty better right now, beside next13 router its super slow, which is annoying.
and all backend go
You got a thing for uploading videos past 1AM EST
My internet takes 2 hours to upload videos and I work very weird hours so it has kinda become the norm lol
3am on my end, still watching 😁😁
It's worth the wait for me
@@bmdavis4191mbps
Yes, please that video about combining SK and Go instead of just Svelte! JavaScript would be a bottleneck, no?
The problem is that there are no jobs for svelte in most countries.
LFG 💪🏾
Your background music at the start was distracting
Yea that was an editing screw up, will fix it in the future!
@@bmdavis419 Alright, alright :)
You are watching the video well. I have a question.
Why is the configuration of the go fiver server different from the one you uploaded, 'ua-cam.com/video/Gktt4w74LO4/v-deo.html'?
I know this is a video uploaded by upgrading the existing 'ua-cam.com/video/6C-2R92L01Q/v-deo.html'.
I'm excited for you
why do you prefer it over solid?
He clearly values the progressive enhancement
New project excitement
Love sveltekit!!
I haven’t tried svelte, but the thought of yet another JavaScript runtime environment is not appealing.
Node and the browser is more than enough environments, I don’t need to learn another environment which is framework specific. I’ll stick with Vue. :)
there's no new environment
@@fakenameforgoogle9168 the compiler might as well be a new environment. It’s not 100% v8 JavaScript
you must have not sen solid or qwik
best
svelte is the best
What its the point to replicate all that back-end logic, using literally native browser functions just to "do not refresh the page"? any back end language + MVC would make the same thing, even more complexe steps and flows on the frontend (with useCase Pattern + DDD), and if you need some interaction on the client, why not just add some little bit of js code instead using this heavy js framework runtime with re-rendering on the front end, even with "compilation", "its just js on the client-site" ? just to "not refresh" the page? i know that's is why people are saying that next js, sveltkit, and all this metaframework its becoming php, this old, realiable techs past the test of the time, and now, here we are, svelte kit + go for me, dont make any sense, Simple SPA's for APPS on the client (hybrid mobile apps and PWA are an amazing use case). PHP, Go, or anything and just the minimal javascript, for the real full stack.
Sorry but praising a js framework for "no js on the client" capabilities is just a bad meme. Sure that might be true in this case, then what? do you build for nojs users? good luck with that! Problem is it's TOO HARD to predict/understand when the functionality will be or not javascript, gets messy real quick.
I probably phrased it wrong then because what I meant to praise was MINIMAL js. I am not a no js guy, I am a minimal js guy and Svelte is perfect for that with progressive enhancement.
bro backtracked on his opinion in 2 days
you look like ben award and mizkif mixed together. sorry i am in a bad mood