News for hackers. Stuff that matters.
Re:State of JavaScript 2019 by hajile on Thursday December 19, 2019 @08:54PM (#21841135)
React 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).

There are no comments on this comment yet.