Andrey (azangru) wrote,

There's this strange thing going on: React-based tools, such as Next.js and Gatsby, are begrudgingly acknowledging that React is a pretty hefty library, and are introducing options to remove it (along with the rest of javascript?) at build time or before sending the page to the browser.

Which kinda transforms React from a client-side or universal component library into just a server-side templating library.

This is understandable, given that it removes around 30-40 kB or React and all other bytes of imported libraries; but what weirds me out is why, if this is the case and if this is important for your project, use React at all. If you don't need it on the client, why have it on the server? Is it that much superior than, say, nunjucks?

I appreciate that it's probably easier (probably; perhaps nunjucks has an answer to that) to deal with assets such as css or images by hijacking javascript imports in something like React components, and offloading all the processing and linking work to something like webpack; but if you actually want to use some javascript on your page, aren't you now in a rather insane territory when you have one client-side javascript framework on the server, and a completely different, lighter-weight, javascript solution on the client? Wasn't "isomorphism", i.e. ability to run the same code both on the client and on the server, one of the selling points of React, Vue, Svelte et al?


  • (no subject)

    Imagine buying a phone that snitches on you to the authorities if it spots something illegal:

  • (no subject)

    Someone's comment on Twitter reminded me how differently we interpret what we experience: My impression from that interview was that Yuri was…

  • (no subject)

    Via Twitter. From the book The Gray Lady Winked, photographed by Michael Shermer: Here's the tweet that the paragraph references (took a while…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.