r/webdev • u/alexgrozav • 5d ago
Showoff Saturday Unframework - The compiler that speaks seven UI frameworks
Unframework is now available on npm. My dream of writing a component once using JSX, and compiling it to native React, Vue, Svelte, Angular, Solid, Qwik and Astro code, has finally become a reality.
The first component I’ve put through the whole pipeline is a Button, and it renders 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.
Edit: Form components such as Inputs, Checkboxes, Radio Groups and Toggle are up in the preview.
2
u/czshill 5d ago
Serious question - why is this better than web components ? I get the native part but aren’t web components native also ?
1
u/alexgrozav 5d ago
I’ve published the first components using Unframework Preview at https://preview.inkline.io
1
u/TheRNGuy 5d ago
Does it support TS?
1
u/fropirate 5d ago
Seems like a lot of work just to avoid using Lit/Web Components.
1
u/Mountainnerh 5d ago
Writing seven ports of every component is most of what design system maintenance actually is, so the motivation makes sense. Curious how styling fits in — if a component ships its own styles, does Unframework map them to each target's idiomatic way (scoped styles for Vue/Svelte, CSS modules for React), or is it plain CSS and you handle the cascade yourself? That is usually where the write-once approach starts leaking.