> 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
You don't need React: creating a minimal UI library in Vanilla JavaScript
11–20 of 117 posts
Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#12Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#13After looking at the code in the tic tac toe example I am now 100% convinced that I need React.
Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#14Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#15Earlier 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
Nothing in HTML is immediate mode. Any framework with a DOM is retained mode, by definition.
Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#16> immediate mode You keep using that word. I do not think it means what you think it means. React most definitely falls under what would be called a "retained mode" of some sort. And the UI library described here is also.
UI=f(state)
Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#17[flagged]
Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#18Earlier quoted context omitted.
Nothing in HTML is immediate mode. Any framework with a DOM is retained mode, by definition.
But the api is trying to simulate immediate mode using DOM
Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#19I 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…
Re: You don't need React: creating a minimal UI library in Vanilla JavaScript
#20I'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 for that. But for the vast majority of a content-heavy site you can just use Astro and skip the client-side bulk entirely.
STANDARD DISCLAIMER ANY TIME I COMMENT ON FRONT END DEV: your project may be different. A blog or a shopping site and have extremely different requirements to a full Gmail-style web app. There does not need to be a one size fits all answer.