Hacker News new | ask | show | jobs
by deepstack 1473 days ago
Hmm, I think a long time ago (around 2005 or 2006) JSX was briefly considered to be party of ES standard. It didn't make it, and shortly after FB introduced React.

Think it may have being easier if JSX is just included in ES as a standard. So yes and no, JSX introduced by FB via react is a just a syntax sugar, however the original JSX is a meant to be a ES standard, with each node as a tree structure.

https://www.ecma-international.org/publications-and-standard...

2 comments

You're describing E4X. E4X and JSX are both XML-inspired syntaxes, but beyond that have relatively little in common in how they function.

E4X was supported by Firefox for a while, but I think support was removed.

The way I see it, syntax sugar can be part of the language proper.

For instance classes in JS are sugar syntax to define a function that defines fields in this and prototype members of this function.

Arrow functions are sugar syntax to define functions bound to a specific this.

async / await is sugar syntax for promises.

for..of is sugar syntax for iterating over an iterable.