Live data from Hacker News

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

pedroth.github.io

1–10 of 117 posts

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

#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 than "look! it's not react!"

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

#8
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

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

#9
> The only potential issue with immediate mode is performance, since we need to re-render the entire UI on every state change.

Notice that in the task list example, if you leave some text in the input and check off a task, your text will be erased.

If we could truly treat the DOM as an immediate-mode UI, there would be no need for React/Preact/ Svelte/Solid/etc. But it turns out there are a fair number of quirks like this that preclude such simple replacements from working correctly.

(That said: I am all for experiments like this for learning, or for fun, or to try out unexplored framework design space!)

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

#10
I agree that React gets overused for many websites, but I'm not sure about this project over something like Astro.

I built an Astro Starter that uses just CSS in a scalable way for simple websites. Content is written in Markdown / MDX files. Design tokens are set in var.css. Other stuff is defined in one config.ts file.

Global styling is set though a few CSS files (Global, Reset, Var, Util, Markdown), components are scoped in styling but utilise the tokens.

Link: https://starter.bryanhogan.com/

GitHub repository: https://starter.bryanhogan.com/

Post reply on HN