Hacker News new | ask | show | jobs
by cageface 1093 days ago
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.
2 comments

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.

> 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.
Svelte by itself is super tiny.

Sveltekit does a lot more stuff and is accordingly bigger.

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!"?
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
[removed]
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
Kind of like how JSX is actually JSXScript, sure
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.

So you're saying that svelte does not just transpiles to js/css/html ? Could you expand on that a bit more ?
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.

JSX is necessary to use React otherwise you create even more footguns in a library that's littered with them.