re: It's Just Syntactic Sugar VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Oh man I have heard JSX described as syntax sugar like three times the past year. If so handlebars, liquid tags, directives, markup, markdown is al...
 

Correct me if I'm wrong, but I think the difference here is that JSX is always converted to vanilla JavaScript before it ever reaches the browser or a compiler (see: reactjs.org/docs/jsx-in-depth.html). Whereas markup like HTML can be read as-is. I don't know what happens to handlebars before it reaches the browser, but the infamous Flash Of Unstyled Content issue leads me to think that it's special syntax that handlebars parses and replaces, not syntactic sugar for something else.

 

I read this about 3 times: jasonformat.com/wtf-is-jsx/

Thanks for the added info re: converted to vanilla JS before reaching browser. I hadn't thought of that at all. The vibe I was agreeing with is that OP feels "syntactic sugar" may be a poor metaphor for something syntactically hybrid (aka writing JS in your HTML).

Markup is parsed as dom tree first I thought, then style sheets + JS are read, but in the case of react, the taskrunner decides what is compiled and rendered first...?

lol at "flash of unstyled content". I only just thought about what kind of mechanism that could be.

code of conduct - report abuse