DEV Community

Cover image for Reactive HTML Without JavaScript Frameworks šŸ”„

Reactive HTML Without JavaScript Frameworks šŸ”„

Anthony Max on July 07, 2025

In the modern web development landscape, JavaScript frameworks like Vue, and Angular dominate discussions about reactive interfaces. However, it...
Collapse
Ā 
artyprog profile image
ArtyProg • • Edited

Hello nice work :-),

Here is another way to add reactivity, without any bundlers.
I know, this is a liitle out of subject, but I wanted to show you don't need hyped frameworks to get reactivity.

const app = new Juris();

app.setState('counter', 5);

const element = app.objectToHtml({
    div: {
        children: [
          { div: { text: () => app.getState("counter")}},
          { 
            button: {
              text: "INC", 
              onclick:() =>  { 
                const incedval =  app.getState("counter") + 1
                app.setState("counter", incedval) 
              } 
            } 
          }
        ]
    }
});

document.getElementById("app").append(element)
Enter fullscreen mode Exit fullscreen mode

You can test it here a component approach : Counter

Collapse
Ā 
Sloan, the sloth mascot
Comment deleted
Collapse
Ā 
anthonymax profile image
Anthony Max •

Agree

Collapse
Ā 
gradylink profile image
grady.link •

This is still running JavaScript. In my opinion I would prefer to use Alpine.js.

Collapse
Ā 
anthonymax profile image
Anthony Max •

Alpine.js is a fairly generic approach, not really server-oriented. Syntax-wise, it's very similar to jsx, but a bit weird.

Collapse
Ā 
gradylink profile image
grady.link •

Well then why not use htmx

Collapse
Ā 
ankit_rattan profile image
Ankit Rattan •

Well! That's great... šŸ’Æ

Collapse
Ā 
anthonymax profile image
Anthony Max • • Edited

Thanks!

Collapse
Ā 
parag_nandy_roy profile image
Parag Nandy Roy •

Love this lightweight approach..

Collapse
Ā 
anthonymax profile image
Anthony Max •

Without a framework, create a normal application possible

Collapse
Ā 
abhiwantechnology profile image
Abhiwan Technology •

Very interesting, discussion is goin on related to using reactive HTML. Nowadays most of the India based top 3d game development services provider companies were doing such types of things to get some innovative solutions.

Collapse
Ā 
shiva_shanker_k profile image
shiva shanker •

Looks promising but risky for production! šŸ’” Better strategy: Start with Preact as drop-in React replacement - same code, 90% smaller bundle. Then optimize from there!

Collapse
Ā 
getsetgopi profile image
GP •

Handlebars ++ ?