News for hackers. Stuff that matters.
Re:SvelteKit 1.0 by fruit2020 on Wednesday December 14, 2022 @01:38PM (#33987842)
Except it forces you to use node js, or do I read it wrong? Can we get a streamlined js framework that is just about the frontend and let’s you use whatever backend language you want? I know there is react, vue and angular but they seem so bloated
Re:SvelteKit 1.0 by hamdouni on Wednesday December 14, 2022 @01:45PM (#33987995)
Nodejs is only needed in the development phase.
Re:SvelteKit 1.0 by michaelsbradley on Wednesday December 14, 2022 @02:42PM (#33989040)
That's true if you're developing a SPA or static site with SvelteKit. However, there are APIs that involve Node being run in production, i.e. the authors of SvelteKit envision it being used to build hybrid apps that involve front-end JS and Node.js server/s.
Re:SvelteKit 1.0 by yencabulator on Wednesday December 14, 2022 @03:29PM (#33990015)
Yes, the whole point of SvelteKit is that it's SSR+hydrate. But it doesn't need Node for that. It'll run on just about any Javascript engine, including Cloudflare Workers which is quite close to pure V8 + standard web APIs.
Re:SvelteKit 1.0 by cpfohl on Wednesday December 14, 2022 @08:26PM (#33993751)
That is opt in! The adapter system in SK is great.
Re:SvelteKit 1.0 by pie_flavor on Wednesday December 14, 2022 @02:33PM (#33988885)
Svelte is a frontend framework, which you can use to build anything from a full SPA to a single button. SvelteKit is a Node backend framework that integrates tightly with Svelte.
Re:SvelteKit 1.0 by yencabulator on Wednesday December 14, 2022 @03:28PM (#33989996)
SvelteKit is a Javascript backend framework. It only uses Node at build time (with hopes of replacing even that with e.g. Deno), the deployed serverside component will happily run outside of Node.
Re:SvelteKit 1.0 by cassepipe on Wednesday December 14, 2022 @06:18PM (#33992251)
Thanks that's exactly the answer I was looking for
Re:SvelteKit 1.0 by miohtama on Wednesday December 14, 2022 @02:51PM (#33989219)
We are using SvelteKit frontend with Python backend (Pyramid + SQLAlchemy). When I started the project, I considered doing Python backend + templated HTML frontend a la Django, but SvelteKit server-side rendering was so good that I decided against this. Before I have done JSP, PHP, Django, Next, React and everything between, so I have some experience to compare. Despite all progress on Node.js backends, they still cannot compete with Python for complex SQL + ORM use cases.

The frontend is open source and available here if someone is interested what a complex SSR heavy SvelteKit application deployment looks like:

http://github.com/tradingstrategy-ai/frontend

The SSR server is a lightweight Node.js web server (Vite), but you can have it nicely along your backend API web server (Pyramid in our case). Both are reverse proxied behind the same domain using Caddy.

Re:SvelteKit 1.0 by eblanshey on Wednesday December 14, 2022 @10:54PM (#33995006)
I'm looking at the frontend source code, and the Svelte components look almost the same as VueJS single file components using the composition API. Can someone who has used both comment on both their pros/cons?