News for hackers. Stuff that matters.
Re:Origins of JSX and Why It Exists by hyperhello on Monday July 10, 2023 @07:33PM (#36674513)
What if you just set innerHTML to a quoted HTML string then the syntax colorizer would color it for you? Would that settle most of what you were doing transpiling for? Or just put the tags and attributes in JSON and the content in quotes? Universal and guaranteed to work without proprietary superlanguages.
Re:Origins of JSX and Why It Exists by axiak on Monday July 10, 2023 @08:42PM (#36675079)
I'm not a frontend engineer so I might be misunderstanding, but I thought react was creating representations of dom elements in the render function so that it only needs to apply diffs to the actual dom to keep the browser from eating cpu
Re:Origins of JSX and Why It Exists by hyperhello on Monday July 10, 2023 @09:59PM (#36675592)
But the browser could be doing that itself.
Re:Origins of JSX and Why It Exists by mock-possum on Tuesday July 11, 2023 @01:33AM (#36676767)
Check out what Lit is doing with tagged template literals.