3 ms·
This statement makes no sense: > I have to learn their proprietary syntax and markup. One of Svelte's raison d'etre is to "use the language" and err on less p
by arxpoetica 7y ago
This statement makes no sense:
> I have to learn their proprietary syntax and markup.
One of Svelte's raison d'etre is to "use the language" and err on less proprietary syntax / api / markup. Of the big three (not including Svelte), Svelte uses far less proprietary syntax, boilerplate, and API coverage. It errs on using as much native JS, CSS, and HTML as possible.
- hajile 7y agoReact has one and only one syntactic conceit which is JSX. Truth be told, that is based on a subset of the now deprecated e4x standard. Let's look at Svelte's special syntax going over the docs. Everything mentioned here is NOT part of either the HTML or JS spec. * Uppercase HTML is special (I really don't understand this one as this seems like the perfect opportunity to go all-in on web components) * Interpolation using curly braces * magical $$props object * custom if..else..end syntax * multiple variants of the custom loop syntax * custom await, promise, and handler syntax * custom HTML escape syntax * custom debugger syntax * custom element directive syntax * tons of stuff using the element directive syntax (especially events and data binding) * 4 non-standard pseudo-DOM events * magical <slot> (lowercase) HTML element * magical <svelte> (lowercase) HTML element * magical $: syntax for binding updates That's a ton of magic and doesn't include all the magical code generated to wire everything together. That wouldn't be important except that you can't really avoid it. In React, I can just step over library calls, but since there's no Svelte library, I have to step through the spaghetti it creates from my code (spaghetti because efficient machine-generated code is always spaghetti).