Earlier quoted context omitted.
> Having everything just be explicit JavaScript code This is funny because it's exactly the reason I prefer react
Agreed, I want markup in my logic — not logic in my markup
Svelte is a language
31–40 of 95 posts
Re: Svelte is a language
#32Give a quick glance to Svelte. Help me understand, how this syntax {#if expression}...{:else if expression}...{/if} can be seriously invented in our... more civilized age?
Re: Svelte is a language
#33The really exciting thing about svelte is getting rid of the virtual Dom. Having everything just be explicit JavaScript code that modifies the Dom manually makes for really readable code. If you have not tried it, got to the svelte tutorial and look at the output code. It's awesome.
Specifically, what is on:click? It doesn’t look like JavaScript, and it doesn’t look like the DOM. It looks like a new language which is specific to Svelte.Or what about this… is this JavaScript?
$: doubled = count * 2;
Or… {#if user.loggedIn}
Log out
{/if}
Or… Click me
I am willing to believe that all of that is ergonomic in some way, but it doesn’t appear to me at first blush as very JavaScript-y, or explicit. I see a lot of black box stuff controlled by a declarative API.Re: Svelte is a language
#34(2019), since there is a reference to "Svelte 3 around the corner" that is confusing otherwise.
Re: Svelte is a language
#35Svelte is a major improvement on vuejs. It is a pleasure to work with. I can’t stand react / JSX. Highly recommend anyone who preferred vue over react to give svelte a try.
Specifics needed (please)
Re: Svelte is a language
#36Great insight. It feels like at some point reactivity as a language primitive should be built into js. Most frameworks start with this and then build out into a opinionated implementation, dissolving the ecosystem into framework fragments. Any known reasons why this is / was never implemented?
Re: Svelte is a language
#37If you want a good language that turns into Javascript I recommend PureScript
Re: Svelte is a language
#38The really exciting thing about svelte is getting rid of the virtual Dom. Having everything just be explicit JavaScript code that modifies the Dom manually makes for really readable code. If you have not tried it, got to the svelte tutorial and look at the output code. It's awesome.
I don’t follow… in what sense is this JavaScript? Specifically, what is on:click? It doesn’t look like JavaScript, and it doesn’t look like the DOM. It looks like a new language which is specific to Svelte. Or what about this… is this JavaScript? $: doubled = count * 2; Or… {#if user.loggedIn} Log out {/if} Or… Click me I am willing to believe that all of that is ergonomic in some way, but it doesn’t appear to me at…
Re: Svelte is a language
#39Give a quick glance to Svelte. Help me understand, how this syntax {#if expression}...{:else if expression}...{/if} can be seriously invented in our... more civilized age?
It’s not the most pretty syntax, but it’s wayyy better than React’s terrible (expression ? … : …) or (expression && …)
My point is this is not a syntax decision that React made, but svelte's syntax was (as far as I can tell) a decision.
Re: Svelte is a language
#40Earlier quoted context omitted.
I haven't used Svelte beyond a couple toy tutorials, but, for me, the infrastructure adapters [1] are the most exciting thing. I love the idea of being able to build using Svelte and auto-magically deploy to something like Cloudflare Pages without completely giving up the potential to deploy somewhere else. 1. https://kit.svelte.dev/docs/adapters
Infrastructure adapters are becoming table stakes for frontend frameworks.