r/javascript • • 1d ago

Unframework - The compiler that speaks seven UI frameworks

https://unframework.dev
0 Upvotes

16 comments sorted by

•

u/boblibam 23h ago

I don’t really understand the purpose. When would I use this?

To me frameworks are about developer experience. How is this not just another framework just that it compiles to other frameworks?

Why not just write plain native web components at this point?

I’m genuinely not sure what the target audience and purpose is.

•

u/alexgrozav 22h ago

The target audience is pretty niche, mainly UI library maintainers. I built this for myself first of all. I maintain Inkline, a Vue.js UI library, and I put a lot of thought and care into its components. It would be a shame to have them available only for Vue. I want people to get a real React, Svelte or Angular component of the same high quality.

Web components are the obvious alternative but they're not native to the framework, so you lose things like typed props and slots working the way each framework intended. That said, I'm planning to add web components as another compiler target, so you'd get them too from the same source.

•

u/boblibam 21h ago

Interesting. That does sound pretty niche indeed. Once I’ve seen a micro-frontend setup where a team tried to share UI components across frameworks. So I can imagine that being a rare but similar use case.

•

u/PierrickP 23h ago

same, i don't get the point.

I don't like react. Why i would like to write my components in another very opiniated framework using tsx ?

•

u/alexgrozav 22h ago

It's aimed at UI library maintainers. Please read the full answer above.

8

u/Iggyhopper extensions/add-ons 1d ago

This website runs at 4 fps.

•

u/jessepence 23h ago

It's a classic case of forgetting to try your website with the cache turned off and 4g emulation. I guess he forgot to add "make it performant" in his prompt.

•

u/alexgrozav 23h ago

Damn.. I only wrote "make it pretty"! :(

Fair feedback though, I mostly tested it on my own machine and my phone with a good connection. I'll look into it. Thank you!

•

u/alexgrozav 23h ago edited 23h ago

4 fps is generous, I was aiming for a slideshow!

Seriously now, what browser and device are you on? This is the second complaint I got about the site's performance. I'll tone it down.

•

u/Iggyhopper extensions/add-ons 23h ago

Irrelevant. You are advertising a framework and displaying it like a WebGL demo.

•

u/alexgrozav 23h ago edited 22h ago

Fair enough, I get that it's not for everyone. I like the look, but I don't want anyone to have a bad experience. I'll make the necessary adjustments to improve the performance.

•

u/Due_Ad_2994 23h ago

the lengths devs will go to not learn basic web standards is unbelievable

•

u/PlateletsAtWork 23h ago

Oh, when I read the title I was hoping this was a cross-platform native GUI library, but it just compiles to different web UI frameworks? Why?

•

u/alexgrozav 22h ago

I built this mainly for myself. I maintain a Vue.js UI library, and I want to be able to ship it to several different frameworks. Creating and maintaining the same component over and over again and having it behave consistently is a huge maintenance burden which I'm now offloading to a compiler. This way, people to get a real React, Svelte or Angular component of the same high quality.

I put a lot of thought and care into the components I build and it would be a shame to have them available only for Vue.

•

u/smith-o_17 5h ago

The parity checks are useful; how do you handle component features that don't map cleanly across all seven targets?

-3

u/alexgrozav 1d ago

Unframework is now available on npm. My dream of writing a component once using TSX, and compiling it to native React, Vue, Svelte, Angular, Solid, Qwik and Astro code, has finally become a reality.

The first components I’ve put through the whole pipeline are a Button, an Input, a Radio, and a Checkbox, and they render the same in all seven frameworks.

"The same" is both a promise and a test. On every PR, CI compiles the components to each framework and checks every output in a real browser: the DOM, the accessibility tree and the pixels have to match one shared baseline, with zero pixel tolerance (visual parity).

I'm also releasing Unframework Preview. It shows every component on all seven frameworks side by side, with controls for their props, so you can see parity for yourself. Build it as a static site and host it anywhere, like a Storybook that speaks seven frameworks at once.

Each output is a real component in its framework's own style: hooks in React, runes in Svelte, signals in Solid. There's no runtime or wrapper in between, so each file depends only on its framework.

Looking forward to hearing your thoughts.

https://unframework.dev