4 ms·
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.
by cageface 3y 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.
- ravenstine 3y ago[removed]
- 10xDev 3y agoReactive 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 https://twitter.com/youyuxi/status/1057291776724271104
- pcthrowaway 3y agoKind of like how JSX is actually JSXScript, sure
- zdragnar 3y agoJSX 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.
- waboremo 3y agoJSX is necessary to use React otherwise you create even more footguns in a library that's littered with them.
- cassepipe 3y agoSo you're saying that svelte does not just transpiles to js/css/html ? Could you expand on that a bit more ?
- zdragnar 3y agoThe 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.
- RamblingCTO 3y agoYeah, 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.
- biomcgary 3y agohtmx, 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!"?
- RamblingCTO 3y agoI'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 https://twitter.com/andinfinity_eu
- michaelcampbell 3y ago> 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.
- devbent 3y agoSvelte by itself is super tiny. Sveltekit does a lot more stuff and is accordingly bigger.