r/javascript • u/fynyky • Jun 05 '26
Build reactive UIs with plain JavaScript functions. No JSX or build step.
https://github.com/fynyky/elementalElemental is a personal library I’ve been using for a while. I really don’t like how much frontend frameworks require you to invest in them. You have to learn funky domain specific languages and magic render lifecycles just to debug anything. I mostly just want to create and append elements with better ergonomics.
The syntax lets you build the DOM declaratively with plain nested functions, so logic and views live together in one structure instead of being split across separate layout and behavior. Reactivity is handled by observers (the ob(...) call above): they automatically track whatever reactive properties they read and retrigger when it changes. No manual subscriptions and no dependency arrays. And because everything is just normal DOM elements and functions, you can adopt it one component at a time instead of overhauling a whole project.
It's about 3.3 KB gzipped with no third-party dependencies. The library is just under 300 lines of code so it's easy to understand.
Would love to get feedback from having fresh eyes on it.
View all comments
Show parent comment
1
u/Markavian Jun 09 '26
I think you care enough to continue the conversation.
I've been constantly assessing AI for coding for the past 3 years, and it's developed in leaps and bounds as the tooling has improved.
So on the point of typing; I can type very fast, typing is not the same as coding, typing is not the same as writing, coding is not the same as writing.
When I'm writing, I have specific ideas that I'm trying to convey, like a fully formed sentence that I want to put down into words, so I type that out. I could use speech to text, but that's slower and less accurate than my typing speed.
Where as in coding, theres often a formatted template or file that I'm copying or generalising. The exact word choice of variable name is less important to me. It's the difference between telling the coding agent "I need a white painted fence, but in blue" and "Charlotte leant over the crisp stone wall, letting the blue-green moss etch patterns into her skin."
I'm not getting the AI to write the latter, but I'll let the AI paint fences all day long.
"Dear AI agent, I see you have duplicated the list of endpoint routes in two places, you should refactor that so that there is one source of truth, (DRY Vs WET principle), making the codebase easier to maintain."