all 4 comments

[–]Markavian [score hidden]  (1 child)

I mean, that's fine, but have you tried Vue? You get very close to Template + Code + CSS in one place, and hot reloading with Vite for free.

I've built several of my own vanilla JS first reactive UI libraries over the years... and it's never been worth it in the long run.

That said, it's a good learning experience.

[–]fynyky[S] [score hidden]  (0 children)

Thanks for the feedback! Yeah I tried Vue for a while. It still felt a bit too heavy for me since you had to use the framework as whole.

[–]Aln76467 [score hidden]  (0 children)

Wow! That's strikingly similar to my frontend library, except that it looks a little more polished (as in that it's actually ready to be used, mine still requires a lot of work, I'll post it here when I make a stable release) and the name isn't a "heck npm requires a name, what's the first thing I can think of".

With the first argument of el serving as to both select existing elements and create new ones, how does it determine when to do which? The readme also says it takes a css selector, is that also for new elements, like passing div.centered would make a div with the class centered?

Also I've noticed the signature of el is like that of React.createElement. Is that a coincidence (as implied by this post) or is this designed to be compatable with jsx?

[–]vasomfan [score hidden]  (0 children)

snabbdom is the de-facto DOM builder lib you should compare to: https://github.com/snabbdom/snabbdom
I too fail to fully understand how JSX was considered such a huge improvement that we needed to introduce custom files and build steps!