News for hackers. Stuff that matters.
Re:Web Components Eliminate JavaScript Framework Lock-In by WorldMaker on Monday November 27, 2023 @02:32PM (#38437044)
> HTML(Div(Strong(text))) is terrible*

> This is what JSX compiles to behind the scenes.

Oh, it is much worse than that. By classic default it is:

    React.createElement('div', { /* props and attributes ... */ },
      React.createElement('strong', { /* ... */ }, text))
Recent updates and other JSX frameworks simplified the name of `React.createElement` to just `jsx` or `h`. I've seen projects that manually write `h` calls like that everywhere, and it is indeed terrible.

(Source: I've just completed a bunch of crazy TSX work and got pretty familiar with the compiled forms.)

Re:Web Components Eliminate JavaScript Framework Lock-In by wayfinder on Monday November 27, 2023 @06:36PM (#38440128)
Yeah, you're right. I was kind of simplifying it. API-wise, it's more like document.createElement() but I didn't want to asterisk that because document.createElement() is actually a thing and I didn't want people to think it was a simple layer on top of document.createElement.