Live data from Hacker News

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

pedroth.github.io

41–50 of 123 posts

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

#41
post #20

I think React is way overused but every time you see a blog post with "replace it with this pet mini project instead" I groan because you know the reaction is going to be "what about X feature", and of course the mini framework doesn't do it. I've found the perfect balance to be Astro with Preact. You will inevitably have some piece of functionality that's complex (say, a contact form) and you can lean into Preact fo…

I kind of agree but also

> what about X feature

To which I argue unequivocally YAGNI

95% of apps people actually develop are really just CRUD and could easily get by without JavaScript on the front end at all. They certainly don't justify the layers of complicated state maintenance React and similar systems entail.

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

#42

Earlier quoted context omitted.

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.

[deleted]

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

#44
post #33

[flagged]

Tell me, mister Bofadeez Nutz, why does every non-AI post have to have these dumb "hurr durr just use AI" comments?

I “agree” with your “sentiment”.

But I can’t shake the feeling that discussing this stuff is indeed void on the AI era. I considered my self a JS/TS/React expert dev, derivate, state duplication, url as a source of truth…

All of these points feel void now, I have not checked/cared how my React code looks like in months now. I only care about more high level stuff like schema definition and overall wiring.

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

#46
post #20

I think React is way overused but every time you see a blog post with "replace it with this pet mini project instead" I groan because you know the reaction is going to be "what about X feature", and of course the mini framework doesn't do it. I've found the perfect balance to be Astro with Preact. You will inevitably have some piece of functionality that's complex (say, a contact form) and you can lean into Preact fo…

[deleted]

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

#47
post #6

If you are going to advocate against something, the alternative you propose needs to be better in some important area, other than "not that thing". What is the thing you hate about react, and what is the thing you require in an alternative? I hate bloat and require lightness, so I use Preact. I also hate complexity and difficult to read stuff, so when I look at the proposal here, I don't see anything appealing, other…

The blog post page, which appears to use the author's library only loaded 58.6 kB of JavaScript, which is quite low.

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

#48
Actually browsers already come with a minimal UI library. It's called HTML + CSS + JS.

There's actually no need to make any wrappers - you describe what you want in HTML and make it look good with CSS.

You only need to make UI using JS only for complex components.

Case study: I tried porting an old strategy game from pygame to web using codex. Codex decided that it doesn't need any library and raw-dogged HTML. It was able to match look and feel of an old UI with a very simple, maintenable code. Doing that with just CSS sounds kinda tedious to me, but it can be done, and honestly it looks more maintenable than any UI library.

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

#49
post #20

I think React is way overused but every time you see a blog post with "replace it with this pet mini project instead" I groan because you know the reaction is going to be "what about X feature", and of course the mini framework doesn't do it. I've found the perfect balance to be Astro with Preact. You will inevitably have some piece of functionality that's complex (say, a contact form) and you can lean into Preact fo…

Same, at least for smaller projects where I want some kinds of interactivity, but also a good static rendered page first and just the ease of writing, Astro+preact has been very nice.
Post reply on HN