TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

React is actively harmful if your website is static

33 点作者 BigBalli超过 1 年前

9 条评论

legitster超过 1 年前
As an old-school web guy, I am kinda astonished at some of the new React-only devs I run into. I&#x27;m the dumbest programmer in the world and these guys can run circles around me when it comes to anything webapp. But then sometimes they get lost with the most seemingly basic HTML or CSS related question.<p>It&#x27;s like watching someone masterfully use an excavator, but then seeing them use that same excavator to hang an Ikea picture frame on a wall because they don&#x27;t know how to use a hammer.
gherkinnn超过 1 年前
I agree that React (or anything like it) is not the right choice for static content [0]. Islands are great too.<p>I disagree that React is fundamentally bad. React (et al) probably should not be used in 80% of the cases it is being used for, but it is plenty fast for 80% of cases it is reasonable to use. And yes, I read the author&#x27;s links on the topic.<p>What I found to slow SPA type things (mostly built in React due to its popularity) to a crawl are ~bad~ terrible choices for UI libs, several (!) tracking libraries, badly loaded 3rd party assets, unoptimised images, ads, not using URLs properly, and a cascade of API calls. All of which independent of React, but much of it affordances of client-side fuckery.<p>0 - The idea to set up an entire stack and everything that comes with it to render a hand full of paragraphs borders on lunacy. It is equally insane to wire up a dozen services and as many databases to manage a hand full of entities for a dozen users. I have come to terms with the fact that all software is fundamentally broken and everybody involved (including myself) has been infested with brain worms. The Butlerian Jihad can&#x27;t come soon enough.
frfl超过 1 年前
the biggest thing is native html is a pain to make non-trivial websites with. JSX, via react, provides a nice modular abstraction layer that easier to write and manage vs a blob of html and raw js files.<p>Of course if web components, I haven&#x27;t really looked into them, provide a similar level of abstraction, thats great. If not people will end up (mis)using React and co because it&#x27;s easier from a developer experience point of view.<p>There are alternatives of course. Astro [1] produces native, static html from JSX. Deno has Fresh [2], which offers a similar thing in the Deno ecosystem. Next.js [3] has static html option, but last time I tried it, it wasn&#x27;t as nice as Astro or Fresh in this particular area.<p>[1]: <a href="https:&#x2F;&#x2F;astro.build&#x2F;" rel="nofollow">https:&#x2F;&#x2F;astro.build&#x2F;</a> [2]: <a href="https:&#x2F;&#x2F;fresh.deno.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fresh.deno.dev&#x2F;</a> [3]: <a href="https:&#x2F;&#x2F;nextjs.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nextjs.org&#x2F;</a>
strict9超过 1 年前
The phrases <i>actively harmful</i> and <i>considered harmful</i> in tech writing have become hyperbolic and should be retired. They no longer mean anything.<p>It would make sense if <i>suboptimal</i> or another word was used instead. But it wasn&#x27;t and the end result makes it appear as though there is a harmful risk when in fact there is none.
评论 #38877052 未加载
tracerbulletx超过 1 年前
All for being simple, I often write websites by hand in html if it makes sense. But the author doesn&#x27;t know what they&#x27;re talking about and using any of the major React based static site generators or frameworks is a perfectly valid and incredibly performant option for building a static website that gives you prefetching, image pipelines, the ability to progressively add in dynamic local first features later and other beneficial things that would be time consuming to do by hand.
pssdbt超过 1 年前
React is fine. It can be abused just like anything else. This post brings nothing to the table.
drpossum超过 1 年前
&quot;If you don&#x27;t need javascript you&#x27;re making things complex and slow. Therefore everything about React is bad. I offer no alternatives for the actual use case.&quot; is a pretty nuclear take.
评论 #38861319 未加载
082349872349872超过 1 年前
I&#x27;d like to think that Kernighan and Ritchie chose their iconic first example (the static greeting &quot;hello, world&quot;) as an homage to the simplicity of constant data.
FounderBurr超过 1 年前
Thank god this man has one consulting slot available!
评论 #38877058 未加载