Live data from Hacker News

Thoughts on Svelte

tyhopp.com

191–194 of 194 posts

Re: Thoughts on Svelte

#191
post #12

I've been building a medium-scale web application that works as a configurator for 3D models (swapping objects/changing materials) and parsing/storing/syncing those configurations in real-time along with images, and a lot of metadata that needs real-time updates. To be honest, it's a breeze until it's not, my single file gets very long, lots of declarations, $: reactive = another reactive variable, derived stores, th…

Maybe your case is different, as your app is solving a completely different problem. We have been building a somewhat complex CMS system with Svelte the last two years and haven't had any issues, that couldn't be solved because of the lack of information you are mentioning.

After this time, literally every other framework seems unnecessarily overcomplicated for me lol. It is a BREEZE compared to writing React imo.

Re: Thoughts on Svelte

#192
post #123

Earlier quoted context omitted.

It's what you consider central in a framework. For React, JS/TS is king. All markup and all CSS is subsumed in JS/TS. In Svelte, HTML/CSS is king, with the bare minimum of JS/TS necessary for any given task. With that in mind, of course React tends toward type definitions. Also explains why Svelte tends toward markup-oriented definitions.

React doesn’t care where or how you have your CSS.

Doesn't it? I can't put a class name on a HTML Element and then style the said class inside the same file. It seems to me that it cares more about where you have it, than Svelte

Re: Thoughts on Svelte

#193

> Svelte gives you an elegant way to use CSS in your components with tags, why not implement transitions and animations in CSS there? Because CSS has no hooks into HTML lifecycle. If you want to nimate something that appears in the DOM, or disappears from the DOM elegantly, CSS ain't it. That's why almost every single framework outside Svelte struggles with animations and employs increasingly bizarre and brittle work…

Author here, thanks for the context. Added an update to the end of the article linking to this comment - https://tyhopp.com/notes/thoughts-on-svelte#update-2023-03-2...

Hacker News comments and "fun to read". Who are you, sir?

:)

Re: Thoughts on Svelte

#194
post #187

Earlier quoted context omitted.

Depends on whether or not the following is set: export const prerender = true; If it is, it IS in fact compiled to HTML. :-) https://kit.svelte.dev/docs/page-options#prerender Compilers are awesome.

This assumes you are using SvelteKit, not vanilla Svelte

    npm create svelte my-app
Creates a SvelteKit app now, not plain Svelte. That said, you can easily disable the server-side portion.

    export const ssr = false;
Post reply on HN