4 ms·
I went through the svelte examples and I was exited until I reached the If block example: {#if user.loggedIn} <button on:click={toggle}> Log
by Rotareti 7y ago
I went through the svelte examples and I was exited until I reached the If block example:
{#if user.loggedIn}
<button on:click={toggle}>
Log out
</button>
{/if}
To me such template language is a huge step back from JSX. JSX is JavaScript, thus you get the full power of the language (JS/TS) with the full support from your editor (type checking, auto-completion, etc.).
- dmitriid 7y agoI hate template languages myself. But in Svelte’s defence, their template language in version 3 seems to be well-designed and streamlined. It doesn’t have the ad-hoc nature of “oh crap we forgot to add if-then-else” of Angular or “let’s create half-a-dozen incompatible javascript-like DSLs” of Vue.
- KuhlMensch 7y agoYeah I think I basically agree. Being able to simply write idiomatic javascript to compose elements is just so awesome. Though I would assume Editor support of Svelte can/is being built.