r/javascript • u/Right-Principle-4877 • Aug 22 '26
AskJS [AskJS] I built a reactive JS framework where components are plain HTML files
I wanted to see how far I could push the idea of writing an app using mostly the HTML syntax developers already know.
The interesting part is the template API. There are only a few places where OlumJS treats an attribute as code:
wheneachon*keyhtml
Everything else is a string, withĀ {expr}Ā interpolation when you need a value.
So instead of introducing directives likeĀ :class,Ā v-if,Ā *ngIf, etc., the idea is to keep the distinction HTML already has between something likeĀ onclick="..."Ā andĀ class="...".
For example, the component itself is just:
<script>
const state = { name: "Olum", taps: 0 };
</script>
<h1>Welcome to {state.name}!</h1>
<input value="{state.name}" oninput="(e) => state.name = e.target.value" />
<button onclick="state.taps++">clicked {state.taps} times</button>State is also intentionally simple ā you mutate it directly and the DOM reacts to the changes.
Thereās routing, scoped CSS, and a small store as well, but the main experiment is really:Ā can you get SPA-style reactivity while keeping the component model close to vanilla HTML/JS?
It's currently aimed at prototypes and small apps rather than large production codebases.
For those who work with JS frameworks: do you think keeping components as plain HTML files is a useful abstraction, or does it become limiting as an application gets more complex?