News for hackers. Stuff that matters.
Re:OOHtml – Object-Oriented HTML Implementation by trilbyglens on Tuesday February 13, 2024 @03:57AM (#39355847)
Tbh this is basically jsx. Jsx is also cursed.
Re:OOHtml – Object-Oriented HTML Implementation by tentacleuno on Tuesday February 13, 2024 @04:25AM (#39355999)
If a DSL is "cursed", then JSX is a lot less cursed than that -- it's basically just XML-like shorthand for JS, as opposed to a whole new language.
Re:OOHtml – Object-Oriented HTML Implementation by phrasecode on Tuesday February 13, 2024 @01:14PM (#39360784)
Why not we think in terms of "tradeoffs"? You'll find that there a million alternative syntaxes that could work but which would require seeking the right balance. Evan You's on this comes to mind again: https://youtu.be/ANtSWq-zI0s?si=fDbJLfA9T5VLvgsZ.

Meanwhile, I am happy to put up a quick post regarding the thinking over here. I might have done a bit of that in the introductory article: https://dev.to/oxharris/revisiting-the-html-problem-space-an...

Re:OOHtml – Object-Oriented HTML Implementation by CipherThrowaway on Tuesday February 13, 2024 @05:06AM (#39356191)
Say what you want about JSX, but this is the opposite of the JSX approach. JSX embeds markup in your logic rather than logic in your markup.
Re:OOHtml – Object-Oriented HTML Implementation by bastawhiz on Tuesday February 13, 2024 @10:44AM (#39358639)
JSX props are just JavaScript expressions. This invents a new third thing.
Re:OOHtml – Object-Oriented HTML Implementation by gloosx on Tuesday February 13, 2024 @01:58PM (#39361328)
No. JSX doesn't try to stay HTML syntax. JSX is actually just syntactic sugar around pure functions. If you remove the babel transform it will be just a wall of nested functions which output the DOM.