3 ms·
JSX on the server doesn't make sense to me. It makes sense in the browser because it was made to mimic the dom api. But the interface between the browser and s
by pier25 3y ago
JSX on the server doesn't make sense to me.
It makes sense in the browser because it was made to mimic the dom api. But the interface between the browser and server is text.
When using jsx in the server you're extremely limited. You cannot just use any html tag unless the framework has a specific solution for it.
- bvaldivielso 3y ago> When using jsx in the server you're extremely limited. You cannot just use any html tag unless the framework has a specific solution for it. Doesn't look like that's the case in OP's solution, where HTML tags are transformed into Lua tables. I guess then there's some code that turns the lua tables into the html text to be sent to the client
- bvisness 3y agoAs I said in the article, JSX is distinct from frameworks like React. The interface between the browser and server is HTML; LuaX allows me to author that HTML in a more structural way before sending it to the browser. Also I can totally use any tag I want. LuaX powers the RSS feed of my site too, with all its `atom:link` and `pubDate` and `guid` tags. It doesn't care about the names of tags, only the structure.
- pier25 3y agoCan you write script and style tags? Usually this is where JSX implementations fail.