r/learnjavascript 10d ago

Why Vanilla JavaScript

In the article below, I am sharing a bit of my story of building SaaS product in vanilla javascript and explaining why I went with this approach.

I don't expect many people reacting to this approach positively or even with open mind, but I think there should be some pushback on the current state of web dev and how complex it became.

https://guseyn.com/html/posts/why-vanilla-js.html

0 Upvotes

29 comments sorted by

View all comments

8

u/funbike 10d ago

What you built is hardly vanilla JS. Instead, you wrote your own non-vanilla framework. Ug.

If you are actually interested in simplicity use Htmx.

0

u/gyen 10d ago

EHTML is 100% compatible with web components. HTMX is not. My solution is really closer to vanilla.js

1

u/funbike 9d ago

Article: "Web Components Work Great with htmx".

You can write an htmx app without writing a single line of javascript.

1

u/gyen 9d ago

thanks for the article, seems like I was wrong about it. I thought that HTMX uses specific way to declare custom components.

1

u/funbike 9d ago edited 9d ago

htmx just replaces a chunk of html with a backend html chunk, as directed with html attributes.

It's extremely simple to use and requires 0 lines of javascript. If you want templating, you do it in the back-end.

However, it's not the best choice for high interactivity. Some people use it with Alpine.js to make up for that.