top | item 39355312

(no title)

beebeepka | 2 years ago

but what about those if us who prefer other template engines?

vue/angular are better than jsx. Differences are minor, of course. But why should it be jsx?

discuss

order

FlorianRappl|2 years ago

Because JSX is essentially just JavaScript. However, this also opens the door to the question: What will then render / use the JSX element? After all, a JSX element is just a function call. What function is called how is the outcome of this function then rendered?

You cannot compare Vue/Angular (frameworks) to JSX (syntax extension for JavaScript). As a fact you could write your templates in Vue or Angular using JSX.

beebeepka|2 years ago

I am aware it's possible to use jsx with vue. It's trivial and can come in handy. It's just js until templating. To me, these differences barely matter because I can do all that stuff on my own without any frameworks in the first place.

Both are fine. It doesn't have to be a war.

troupo|2 years ago

Differences are major. Vue's templating is a haphazard collection of elements that grew organically as the author(s) realised that more stuff needed to be added for templating to work. There's the Javascript-like DSL, there's Javascript expressions, there are HTML-like attributes, there are HTML-like attributes with magical extensions, there are...

JSX is trivially converted to a Javascript function call which immediately explains everything about its capabilities and syntax.

beebeepka|2 years ago

Both template engines have to provide roughly the same be because the output is simple render functions that emit html. Sure, they are different but map to the same browser apis, so not that different.

I don't see how jsx is more trivial than html which is what cue templates are.