ReactJS Syntax For Web Components
8d 3h ago by programming.dev/u/xoron in webdev@programming.dev from programming.dev
Im investigating an idea i had about JSX for webcomponents after some experience with Lit.
Lit is a nice lightweight UI framework, but i didnt like that it was using class-based components.
Vue has a nice approach but i prefer working with the syntax that React uses. I find it more intuitive for debugging and deterministic rendering. I wondered if with webcomponents, i could create a UI framework that didnt need to be transpiled.
(My intentions with this framework is to get to a reasonable level of stability, to then replace React on some of my existing projects.)
IMPORTANT: Im not trying to push "yet another ui framework", this is an investigation to see what is possible. You should not use this framework in your own code. It is not production-ready. It is intended for myself on my own projects. This project is far from finished. I am sharing because it might be interesting for someone. Feel free to reach out for clarity if you have any questions.
Why would I use this rather than hybrids?
Thats cool! I haven't seen that before.
My approach is because I specifically wanted the react DX... This would then make it easier to refactor my existing projects.
With AI, "easier" is a relative term. I wanted something that remains intuitive to work with.
That's a good point, being closer to the react api would make refactoring easier. The AI of it all is very frustrating for new projects like this. Since LLMs produce the most likely next code based on the training set, it'll take a lot of blog posts and projects on github before it masters your api, but people will be loathe to adopt it if LLMs can't do the heavy lifting for them. I don't envy your position, but I do wish you luck!
Switch to Svelte. You’ll never look back. Everything else is trash.
Svelte is good and easy to recommend. Especially over my unfinished code here.
With what I'm doing, I'm aiming for something that would work without having to use something like vite to transpile anything... if I can replace the Lit dependency (on the roadmap), it would basically be vanillajs.
I'd like to minimise the JavaScript tooling needed for creating a basic project.
Not what you’re trying, but have you looked at HTMX?