24 comments

  • afavour 1 hour ago
    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 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.

    • donatj 1 hour ago
      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.

      • mexicocitinluez 6 minutes ago
        > 95% of apps people actually develop are really just CRUD and could easily get by without JavaScript on the front end at all.

        Nearly every app has some version of CRUD, but you're conflating the persistence model with the interaction layer. Just because an app is CRUD doesn't mean it doesn't require complex, client-side interactions.

        I'm building an EMR and there is a large portion that is CRUD, but that doesn't mean I don't rely on enormous forms or don't need client-side validation.

        And not only, but "you could get by" is true of a lot of things. I could get by with full-page refreshes every time a form is saved or a chart is pulled, but that doesn't mean it's the best option or that the users won't notice it.

        This argument has big "I seldom build web apps but have a lot of opinions on them" energy. Like, the idea that I, myself, have seen enough of the different projects and use cases for the web that I can unequivocally state something like "95% of apps don't need a front-end framework" reeks of ego. You just flat out haven't. The field is enormous.

      • holoduke 24 minutes ago
        95% of the frontend apps can easily be made with AI. Doesn't matter in which framework.
    • matsemann 1 hour ago
      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.
      • lkbm 10 minutes ago
        I switched my small personal projects to preact in a (temporarily successful effort) to get one under 14kb after re-reading [0] a year or two back. So far haven't run into any limitations.

        If you need React, then go ahead and use React, but I'd encourage people to try a simple s/react/preact/g on their websites. (Okay, not quite as simple as that, but even if you don't like vibe coding, this is something an LLM can be trusted with.)

        [0] https://endtimes.dev/why-your-website-should-be-under-14kb-i...

  • fidotron 7 minutes ago
    A major feature of React (like Java) is the ability to reduce the blast radius of errant colleagues through much stricter boundaries.

    In the AI/vibe coding world this becomes even more valuable, on top of the fact LLMs are well versed in React already and don't need to eat context to understand it.

    The problems are people then assume that because you're using React you must use next.js, vite etc. Then you're in trouble.

  • jakelazaroff 2 hours ago
    > 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!)

  • killerstorm 1 hour ago
    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.

    • gorgoyel 29 minutes ago
      The problem is really folks trying to one-size-fits-all web projects. React basically exists to give a “good enough” GUI toolkit functionality in the browser. On the other hand, the web was built to publish content as in articles and information. Everything kind of sits somewhere on the continuum between static content and the interactive app experience. At the extreme it can be interactive “art” piece.

      It is important to consider digital media (as in art medium) best to convey an idea. And folks should start with HTML/CSS. Minimally, JS can be used for client-side validation. But that’s not necessary since the server needs to validate anyway.

      • killerstorm 9 minutes ago
        I think main reason people choose React now is "nobody was fired for choosing React". (That used to be a saying about IBM as a vendor.) People can build their career around React.

        And it is better "job security" than pure HTML+JS: React apps need constant maintenance

  • Oras 2 hours ago
    > 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?

    • pedro_movai 2 hours ago
      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
      • blenderob 1 hour ago
        > 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.

      • mollerhoj 1 hour ago
        "I think the author is saying" - Wait, are you not the author? This seems dishonest.
      • inigyou 2 hours ago
        Nothing in HTML is immediate mode. Any framework with a DOM is retained mode, by definition.
        • pedro_movai 2 hours ago
          But the api is trying to simulate immediate mode using DOM
          • inigyou 1 hour ago
            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.
            • Warwolt 1 hour ago
              How would you do layouting without a tree structure in place? Not really sure what you're getting at here
              • inigyou 1 hour ago
                You have discovered one advantage of retained-mode designs.
    • gulugawa 1 hour ago
      I think the high quality of the author's website is more relevant than theoretical concerns about performance.

      Loading performance on the s website is quite good, and it appears to be using the JS library described in the blog post. I also saw that pages were loading around 60kb or JavaScript or less.

      Also, from looking at the author's GitHub profile, it appears that they do not make significant use of LLMs and actually took the effort to write the code by themselves.

  • cyanregiment 14 minutes ago
    You don’t need React until you do.

    And that’s fine. It’s easy to replatform later with LLMs.

    With vanilla you typically do class based components for organization (which can be quite clean in type=“module” with import/export) and you end up writing a complex View type class that does all the DOM manipulation.

    You gotta hide the framework somewhere or you’ll repeat yourself a lot

    Bonus points at scale you invent a templating solution. Maybe you use JSX

  • codazoda 1 hour ago
    Even this is more complex than many websites need to be. A few months ago I wrote about why I often create pages in pure html and css.

    https://joeldare.com/why-im-writing-pure-html-and-css-in-202...

    • inigyou 1 hour ago
      Regarding small pages - there's a certain size threshold where the entire HTTP response is sent back in the first TCP window for most client OSes, which allows minimum round-trips.
  • karol 41 minutes ago
    A 50-100 LOC library that provides 80% of what React does is very easy to create. I created one of those 14 years ago before React, to replace things like mustache and similar templating languages. That doesn't take away from your effort. It's a good idea for anyone to recreate their favourite lib to understand the principles.
  • bryanhogan 2 hours ago
    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/

  • fg137 1 hour ago
    I wish that before someone writes yet another article on "You don't need React" they can do a Google search to look up all the 1000 articles already written with the same arguments and the discussions around that.
  • netdur 2 hours ago
    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
  • progx 45 minutes ago
  • mythz 2 hours ago
    Minimal UI library results in maximal App code, which makes it a good usecase for why you're better of with React/Vue
    • gulugawa 1 hour ago
      I looked at the author's website, and a typical page downloaded around 60kb or less of JavaScript.
  • imguienjoyer 1 hour ago
    here is one that uses the fact that the raf loop will slow down when the tab is out of sync. makes state handling much easier. similar to dearimgui

    frontend example https://github.com/spirobel/counter/blob/master/frontend/cou...

    on the backend this obviously runs only once. the main issue with backend frameworks is, that the request and other context data has to be passed through the business logic + VIEWS. leads to tight coupling of all the components as it is downstream from the data structure + presentation

    this is resolved by resolving the html template strings at the end and allowing functions (that also produce html template snippets) to be passed into the template strings.

    this decouples views, business logic and data

    https://github.com/spirobel/mininext/blob/master/docs/archit...

    worked on this for the last few years. But it is still only a few hundred lines of code that you can understand in a few hours

  • jorisw 1 hour ago
    Who knew the largest community in Web tech had it wrong all this time?
  • Flavius 2 hours ago
    After looking at the code in the tic tac toe example I am now 100% convinced that I need React.
    • inigyou 2 hours ago
      React and systemd feel the same way to me: both really sensible ideas at the core, surrounded in layers of bullshit.
  • onesandofgrain 24 minutes ago
    React is popular because it's pushed by Meta.
  • hsn915 2 hours ago
    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!"

    • gulugawa 1 hour ago
      The blog post page, which appears to use the author's library only loaded 58.6 kB of JavaScript, which is quite low.
      • vitaflo 3 minutes ago
        Preact is 3kb. The size argument doesn’t hold weight.
  • wild_egg 2 hours ago
    > 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.

    • pedro_movai 2 hours ago
      I think the author is referring to immediate mode because of

      UI=f(state)

      • wild_egg 1 hour ago
        I do understand that's what they have in mind. But that's not what immediate mode means. Function application is not the only criteria.

        We are talking about rendering into a browser by twiddling DOM APIs. That's definitely retained mode rendering and repeatedly claiming it's immediate mode doesn't make it true

        • account42 55 minutes ago
          With that argument, every UI is retained mode because everything gets saved in the GPU's scan out buffer.
  • gulugawa 1 hour ago
    I read the blog post, and your framework looks great.

    I think React is overused, and I'm happy to see people support alternatives.

  • imafish 1 hour ago
    Maybe it’s not needed. But why not just use React anyway?
  • dbbk 1 hour ago
    What is the point of this?
  • huflungdung 2 hours ago
    [dead]
  • bofadeez 2 hours ago
    Discussing language preferences at all sounds very pre-Fable era
    • inigyou 1 hour ago
      Tell me, mister Bofadeez Nutz, why does every non-AI post have to have these dumb "hurr durr just use AI" comments?
      • jvidalv 1 hour ago
        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.

      • bofadeez 1 hour ago
        You sound like me before I tried Fable.
        • phoghed 11 minutes ago
          You sound like most people I know that only have a Claude subscription. GPT-5.6 is so much better bang for the buck.
    • afavour 2 hours ago
      Framework, not language. And framework choice still matters.
      • orphea 1 hour ago
        So do programming languages, fwiw. The argument of "we have Fable, X doesn't matter anymore" is a severe case of delusion.
        • bofadeez 1 hour ago
          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.

      • bofadeez 1 hour ago
        Tomato tomato. English is my favorite new programming language.
        • afavour 1 hour ago
          You're showing your ignorance here. Different frameworks have different ways of working that can lead to better or worse performance on client devices, no matter what Fable spits out for you. You owe it to your users to care.
          • bofadeez 59 minutes ago
            Have you tired using several billion Fable tokens in production? It will do whatever you want.

            So you can still have your opinions on what works best. But it doesn't matter much, it's not 2025 anymore.

            E.g. always use Rust instead of Python