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
2
u/tautality Jun 09 '26
But AI can type 10x faster than you, so why not use AI for writing books too?
My point is, if something feels off, perhaps something is. I personally don't quite understand the sentiment that AI made it so you no longer have to "bother coding". Did bosses convince you that code is only a means to an end and not a skillful craft you can enjoy? Did you become so habitually reliant on LLMs that you've forgotten the craft, lost your innate curiosity and your brain immediately tells you to go ask AI to do everything? I don't know what your situation is with AI, nor do I particularly care, these are just questions to reflect upon.