3 ms·
I haven't really used Svelte, but according to their website, they definitely seem to have a custom language that I don't think I've seen before (eg. not mustac
by Zanfa 3y ago
I haven't really used Svelte, but according to their website, they definitely seem to have a custom language that I don't think I've seen before (eg. not mustache, liquid, handlebars, erb). From their own examples [1]:
<ul>
{#each cats as { id, name }, i}
<li>
<a target="_blank" rel="noreferrer" href="https://www.youtube.com/watch?v={id}">
{i + 1}: {name}
</a>
</li>
{/each}
</ul>
[1] https://svelte.dev/examples/each-blocks https://svelte.dev/examples/each-blocks
- dbrueck 3y agoHmm... apologies, but it seems like we're talking past each other. You thought that Svelte used a "completely custom template language that doesn’t even look like HTML", and I replied that no, compared to something like React, it looks very much like ordinary HTML, with a few exceptions around things like loops and hooks for data bindings, and you replied with a chunk of HTML annotated the way I described. :) Point being that if you take the HTML from a web designer and put it into your svelte app, it looks very similar to the original. For example, our web designers have no trouble continuing to "own" the HTML even after a dev has gone in and made it functional - the overall structure is the same, all of the elements they created are still there (with the exception that if they had e.g. a bunch of dummy rows in a table, those are replaced with one instance of the row and wrapped in a loop construct), the CSS doesn't break because new elements have been added, etc. Our experience with React was very different: once the devs took it, the result was so far removed from the original that the web designers couldn't effectively own it anymore. Maybe for some companies that's not a big deal, but for us it's hard to express just how much better the Svelte way is.