Live data from Hacker News

You don't need React: creating a minimal UI library in Vanilla JavaScript

pedroth.github.io

21–30 of 117 posts

Re: You don't need React: creating a minimal UI library in Vanilla JavaScript

#21
post #18

Earlier quoted context omitted.

But the api is trying to simulate immediate mode using DOM

That's called an "abomination". The advantage of immediate mode is not storing a DOM. If you write immediate-mode code but it stores a DOM anyway then it's the worst of both worlds.

How would you do layouting without a tree structure in place? Not really sure what you're getting at here

Re: You don't need React: creating a minimal UI library in Vanilla JavaScript

#22
post #21
post #18

Earlier quoted context omitted.

That's called an "abomination". The advantage of immediate mode is not storing a DOM. If you write immediate-mode code but it stores a DOM anyway then it's the worst of both worlds.

How would you do layouting without a tree structure in place? Not really sure what you're getting at here

You have discovered one advantage of retained-mode designs.

Re: You don't need React: creating a minimal UI library in Vanilla JavaScript

#26
post #23
post #17

Earlier quoted context omitted.

Framework, not language. And framework choice still matters.

So do programming languages, fwiw. The argument of "we have Fable, X doesn't matter anymore" is a severe case of delusion.

I would have agreed before I used Fable. It's not even vibe coding anymore. It's just coding.

E.g. Just always use Rust instead of Python.

Re: You don't need React: creating a minimal UI library in Vanilla JavaScript

#27
post #12

unlike many of the commenters, I found this pretty nice and educational, there are full stack developers who cannot write anything outside React and do not even understand why React was created in the first place

Nice! positive comment

Re: You don't need React: creating a minimal UI library in Vanilla JavaScript

#29
post #4

> The only potential issue with immediate mode is performance, since we need to re-render the entire UI on every state change. How this made it to HN front page?

I think the author is saying a potential issue of a vanilla implementation of immediate mode. The following text explains that there is already many optimizations for this

> I think the author is saying a potential issue of a vanilla implementation of immediate mode.

And you (pedro_movai) == the author? So you are saying that potential issue? Sorry, technically you are right that the author is saying that but I got confused with you referring to yourself in third person. Nothing wrong with it. Just want to confirm if you're the author.

Post reply on HN