Show HN: WebJSX – A tiny Web Components and JSX library
webjsx.org
webjsx.org
One example: if I want to use tailwindcss, then adopting web components comes at a cost/risk. While there are techniques like in this tutorial [1], you end up getting cut by the bleeding edge if you are not using Lit, you are using vite (based on comments), etc etc. (And the space moves so fast, I'd be afraid that any architectural differences between Tailwind and Web Components, might start to hurt me further in the future.)
I must have used around 50 prompts for this. The source code is here: https://github.com/webjsx/webjsx
This was the first prompt: https://chatgpt.com/share/66f0307c-e0f8-800d-873c-beb65abd7f...
2. I was not able to find a way to use JSX with lit. Template strings have so many downsides. vscode support is kludgy, because it's a template string.
The idea behind webjsx is that you may not need much in the framework. webjsx is less than 200 lines of code.
Also I have to say none of what you mentioned about JS template literals even remotely matches my experience nor have I ever heard of anyone mention this before I’d love to know more of what you’re referring to here though.
How a feature that’s literally built into the JavaScript spec is somehow buggier than JSX is actually kind of confusing to me to be totally honest with you.
But it's also something JS is standardizing. Previously TypeScript had stuff that broke when JS decided to standardize differently. In fact, it's happened in decorators as well when the spec changed - old TypeScript code which used this syntax will stop working at some point if it hasn't already.
> How a feature that’s literally built into the JavaScript spec is somehow buggier than JSX is actually kind of confusing to me
The problem is that strings have no type information, unless we parse it into some AST and connect it with the rest of the program. You could do that during dev with extra tooling, but because JSX parsing is built into TypeScript (and hence VSCode) it just works out of the box.