News for hackers. Stuff that matters.
Re:Thoughts on Svelte(Kit), one year and 3B requests later by cageface on Thursday June 22, 2023 @07:56AM (#36430754)
I like Svelte but I’m not sure I’d describe it as “minimalist”. It’s a new language with its own compiler and reactivity system.
Re:Thoughts on Svelte(Kit), one year and 3B requests later by ravenstine on Thursday June 22, 2023 @08:19AM (#36430996)
It's a new language? Maybe I missed something, having taken a break from Svelte for the last 6 or so months, but I'm pretty sure it's not a "new language" by any stretch of the imagination. Svelte is just JavaScript, syntactically speaking, and some of the language behavior is overloaded to support reactivity. Are you referring to its template language? There isn't anything particularly complex about that either, and it's a lot simpler than other templating languages like Handlebars (which seems to have inspired it).
Re:Thoughts on Svelte(Kit), one year and 3B requests later by 10xDev on Thursday June 22, 2023 @08:47AM (#36431313)
Reactive declarations that work using syntax outside of JS thanks to the compiler does make it a bit more than just JS. https://twitter.com/youyuxi/status/1057291776724271104
Re:Thoughts on Svelte(Kit), one year and 3B requests later by pcthrowaway on Thursday June 22, 2023 @09:36AM (#36431954)
Kind of like how JSX is actually JSXScript, sure
Re:Thoughts on Svelte(Kit), one year and 3B requests later by zdragnar on Thursday June 22, 2023 @10:01AM (#36432314)
JSX is, imho, more akin to a macro; the syntax is replaced with simple expressions. Technically, the JSX syntax isn't even necessary to use React, though most people prefer it.

Svelte bakes itself fully into your code in a way that you can't do without the compiler and still be using svelte.

Re:Thoughts on Svelte(Kit), one year and 3B requests later by waboremo on Thursday June 22, 2023 @01:33PM (#36435764)
JSX is necessary to use React otherwise you create even more footguns in a library that's littered with them.
Re:Thoughts on Svelte(Kit), one year and 3B requests later by cassepipe on Thursday June 22, 2023 @02:09PM (#36436309)
So you're saying that svelte does not just transpiles to js/css/html ? Could you expand on that a bit more ?
Re:Thoughts on Svelte(Kit), one year and 3B requests later by zdragnar on Thursday June 22, 2023 @11:56PM (#36442614)
The point is that Svelte is a full compiler- you cannot "use svelte" without it.

JSX is an essential, yet entirely optional, concept in React. The output of the transform is incidental to the actual behavior of React, the library.

As such, I wouldn't think it warrants the term "JSXscript" or whatever the post I replied to used.

Depending on how your tool chain is set up, you don't need a custom file extension like ".jsx" for files that need the transform, and React doesn't care about file extensions at all.

Svelte, on the other hand, pushes you to use the ".svelte" extension, mixing and matching tags, changing scoping rules, and so forth. If you were to write by hand what it puts out, you're not really using svelte anymore. It is, in this sense, elevated itself to a language superset.

I'm not arguing one is better or worse, just pointing out why I think they are sufficiently different to quibble over semantics.

Re:Thoughts on Svelte(Kit), one year and 3B requests later by RamblingCTO on Thursday June 22, 2023 @09:38AM (#36431993)
Yeah, I did a project in sveltekit + go and then one in htmx, alpinejs + golang. Sveltekit is quite big and not low maintenance.

Not sure what exact use case sveltekit would be good for, that can't be solved with htmx + alpinejs.

Re:Thoughts on Svelte(Kit), one year and 3B requests later by devbent on Thursday June 22, 2023 @11:57AM (#36434180)
Svelte by itself is super tiny.

Sveltekit does a lot more stuff and is accordingly bigger.

Re:Thoughts on Svelte(Kit), one year and 3B requests later by biomcgary on Thursday June 22, 2023 @04:43PM (#36438671)
htmx, alpinejs + golang is the exact stack I've been thinking about. I'm not a front-end developer, but want to be able to prototype things quickly. Are you aware of any public examples of this stack that go beyond "Hello, World!"?
Re:Thoughts on Svelte(Kit), one year and 3B requests later by RamblingCTO on Monday June 26, 2023 @03:41AM (#36476837)
I'm not actually, but I found it very easy to learn. The documentation really is enough. Htmx is used for requests and replacing content. You just need to figure out when to replace what. Alpine is used for on-site interactions. You can hit me up on twitter if you have questions, love to help other people with that stack! https://twitter.com/andinfinity_eu
Re:Thoughts on Svelte(Kit), one year and 3B requests later by michaelcampbell on Friday June 23, 2023 @10:19AM (#36447154)
> Not sure what exact use case sveltekit would be good for, that can't be solved with htmx + alpinejs.

I mean, reductio ad absurdum:

    s/sveltekit/<anything>/; s/htmx + alpinejs/assembly/;
Of all of pg's writings, the one with "the blub paradox" in it has proven to me to be the one I see crop up again and again.