Live data from Hacker News

Svelte 5 Released

npmjs.com

21–30 of 254 posts

Re: Svelte 5 Released

#21
post #15

Where would one even start learning more about front-end development in today's world? Ignoring the dizzying amount of frameworks, how could I become knowledgeable enough to connect my back-end experience to design the "full stack?"

Play around with some stuff and see what works for you best. Personally, I didn’t get frontend at all before React came by, and then switched to Svelte because it fits my mental model exactly.

If you don’t like anything – no worries! Classic SSR with templates and stuff is a thing too, as another commenter pointed out.

Edit: no matter what, make sure you write good HTML first and foremost. Use proper semantic tags, don’t add dozens of nested divs, use native controls when possible etc. Make sure to check accessibility, but it should be OK if you don’t do any weird stuff. MDN is a great starting point.

Re: Svelte 5 Released

#22
post #7

We use Svelte 4.0 in production and it performs beautifully; it rarely is the cause of our frustrations. Excited to try the new version. Lately I’ve also been wondering about the relationship and correlation between software writing skills and writing skills.

What makes you think about a possible correlation?

Re: Svelte 5 Released

#23
What's the preffered way to make simple SPAs using Svelte now? I'm using this +layout.ts with sveltekit: > export const ssr = false; export const prerender = false;

But it feels awkward for real SPAs - internal applications that have no need for server side rendering.

Re: Svelte 5 Released

#24
post #15

Where would one even start learning more about front-end development in today's world? Ignoring the dizzying amount of frameworks, how could I become knowledgeable enough to connect my back-end experience to design the "full stack?"

Just choose one.

Re: Svelte 5 Released

#25
Svelte 5 has been very nice to work with over the past few months. Yes, runes require you to think more carefully about lifecycles and updates. And you may end up writing a little more code initially than with svelte 4. But it serves you better in the long run with complex apps. I found a process for gradually turning a simple app into a more complex one that works for me. I iteratively move $state() runes out of .svelte files and into .svelte.ts files where I build a more abstract data-oriented structure for my app from a series of mutually linked classes. Then those runes can be re-imported into the .svelte files, or used and updated wherever you need. If you plan it right, I think it avoids the need for heavy redux-like state management. (at least I think so. I haven't worked with redux much myself)

Re: Svelte 5 Released

#26

I love Svelte and use it for all my personal projects and all company projects (except strictly static sites are still built with just 11ty but I hate it and want to move off it). But I'm going to wait a bit on v5 for the company, scanning all the issue headlines, it looks like there are a still a lot of unresolved edge cases: https://github.com/sveltejs/svelte/issues As for my latest personal project, upgrading righ…

For what it's worth, I've upgraded three pretty beefy projects to v5 over the past 6 months or so (making sure to stay on top of latest releases), and I haven't seen any weirdness. That being said, I'm not using any of the transition APIs and only one of the projects uses the "runes outside of a Svelte file" thing (i.e. svelte.js files), so YMMV. I was so excited about runes that I couldn't wait. The only thing that bit me initially was `$state` runes converting objects into Proxy instances, so if you want to send data using `postMessage` or IPC in Electron, you need to serialize it first. I really love the new APIs. The Svelte team did an awesome job of addressing most of the gripes I had with v4.

Re: Svelte 5 Released

#27
post #23

What's the preffered way to make simple SPAs using Svelte now? I'm using this +layout.ts with sveltekit: > export const ssr = false; export const prerender = false; But it feels awkward for real SPAs - internal applications that have no need for server side rendering.

What's the goal of disabling SSR though?

I get that hydrations value is mainly in SEO and a tiny improvement in initial draw speed, but why would you want it disabled, specifically?

It's pretty much what you already wrote though.

https://kit.svelte.dev/docs/single-page-apps

Re: Svelte 5 Released

#28
post #23

What's the preffered way to make simple SPAs using Svelte now? I'm using this +layout.ts with sveltekit: > export const ssr = false; export const prerender = false; But it feels awkward for real SPAs - internal applications that have no need for server side rendering.

I would probably just go with the Vite template: https://vite.new/svelte-ts

Re: Svelte 5 Released

#29
post #23

What's the preffered way to make simple SPAs using Svelte now? I'm using this +layout.ts with sveltekit: > export const ssr = false; export const prerender = false; But it feels awkward for real SPAs - internal applications that have no need for server side rendering.

I do have to ask - why don't you want to use SSR just because it's an internal application? For the new Svelte Society website we're SSR:ing everything (even the Admin dashboard). Being able to use form actions is a god send.

With that said, unfortunately when using Kit in "SPA mode" you're not getting the full experience, but it's still the best thing out there. You could try Routify as well.

There's a great talk from last years Svelte Summit that was about Svelte(Kit) in "SPA mode".

https://www.youtube.com/watch?v=uIZOeBS-3cI

TL;DR: Lean into load functions and monkey-patch fetch (if possible)

Re: Svelte 5 Released

#30
post #27
post #23

What's the preffered way to make simple SPAs using Svelte now? I'm using this +layout.ts with sveltekit: > export const ssr = false; export const prerender = false; But it feels awkward for real SPAs - internal applications that have no need for server side rendering.

What's the goal of disabling SSR though? I get that hydrations value is mainly in SEO and a tiny improvement in initial draw speed, but why would you want it disabled, specifically? It's pretty much what you already wrote though. https://kit.svelte.dev/docs/single-page-apps

wouldn’t not running a server be a reason to disable SSR?
Post reply on HN