TE
ТехЭхо
ГлавнаяТоп за 24 часаНовейшиеЛучшиеВопросыПоказатьВакансии
GitHubTwitter
Главная

ТехЭхо

Платформа технологических новостей, созданная с использованием Next.js, предоставляющая глобальные технологические новости и обсуждения.

GitHubTwitter

Главная

ГлавнаяНовейшиеЛучшиеВопросыПоказатьВакансии

Ресурсы

HackerNews APIОригинальный HackerNewsNext.js

© 2025 ТехЭхо. Все права защищены.

Static as a Server

75 балловавтор: danabramovоколо 7 часов назад

13 comments

turtlebits17 минут назад
I dont get it. Yes it's a static site, but it's only text and you're sending 100kb+ of JS over the wire. Is there any reason why you need React?
zeropointshоколо 1 часа назад
My exact thoughts[1] when it comes to hosting, things should be static, although I seek joy in Astro and Markdown. [1]<a href="https:&#x2F;&#x2F;zeropoint.sh&#x2F;blog&#x2F;astro-as-static&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zeropoint.sh&#x2F;blog&#x2F;astro-as-static&#x2F;</a>
exogenоколо 3 часов назад
This is also how I build most of my static sites, usually deployed to GitHub Pages. For example, here’s the demo page for a library I recently developed: <a href="https:&#x2F;&#x2F;exogen.github.io&#x2F;turbo-colormap&#x2F;" rel="nofollow">https:&#x2F;&#x2F;exogen.github.io&#x2F;turbo-colormap&#x2F;</a><p>Or a more complicated app: <a href="https:&#x2F;&#x2F;exogen.github.io&#x2F;t2-model-skinner&#x2F;" rel="nofollow">https:&#x2F;&#x2F;exogen.github.io&#x2F;t2-model-skinner&#x2F;</a><p>Are all of Next.js’ features overkill for such sites? Sure, but the convenience such frameworks provide is worth it. And the reason to prefer it over something like Vite is simply routing, which Vite doesn’t cover out of the box, so as soon as I want to add a second page, I now have another problem to solve.<p>Next.js’ best feature is simply that you’re up and running with `npm i react react-dom next` and step two is just writing the pages.
raddanоколо 5 часов назад
I understand that somebody might want to generate static pages from code that generates it dynamically, but I fail to appreciate _why_. Are people using this for a handful of pages they want to load quickly and whose contents rarely change, or are people building entire static sites using things like React? If it&#x27;s the latter... uh... why? It&#x27;s been awhile since I was a web developer, so maybe my pain threshold is inappropriately low. I think Jekyll is fine and use it pretty regularly.
评论 #43930442 未加载
评论 #43930675 未加载
评论 #43932427 未加载
评论 #43932324 未加载
评论 #43930488 未加载
评论 #43931550 未加载
评论 #43930518 未加载
评论 #43930497 未加载
评论 #43931507 未加载
评论 #43931586 未加载
评论 #43930362 未加载
nhumrich37 минут назад
This model already has a name: pre-rendered.
_bentonоколо 2 часов назад
I&#x27;m curious if Next has full support for Cloudflare or if this is the only way to run Next w&#x2F;RSC off of Vercel.
atokoоколо 6 часов назад
I wonder if the omission of React Context in this example is intentional. Do you think Context is compatible with suspense? In the sense that posts is being passed to components as props three times over.<p>Is it because each component is expected to abstract over async, relying on the promise state?
评论 #43930579 未加载
ktpsnsоколо 6 часов назад
This got popular in JS toolkits a few years ago, at least. For instance, Svelte(kit) also has a static output variant.
switzоколо 6 часов назад
It&#x27;s unfortunate that there is so much misinformation about what react server components really are, but it&#x27;s not necessarily the fault of either party. The name is confusing (names are hard), the architecture is new (people don&#x27;t want to learn it), and it lends itself to conspiracy theories (that aren&#x27;t true).<p>But it really is a magnificent piece of technology. Because they&#x27;re called &quot;Server Components&quot; people think that &quot;server&quot; means run-time, but as a friend pointed out, 15 years ago people were running wordpress servers and caching pages ahead-of-time. As Dan mentions here: &quot;server&quot; doesn&#x27;t imply it has to execute at run-time.<p>But there are also massive advantages to running a server at run-time that seem lost on people. I do think over time the concepts behind RSCs will filter out into most web frameworks because they are so powerful. It&#x27;s the best functionality of the old-world SSR languages (PHP, rails) combined with the best functionality of the new-world client frameworks (React). You get to pick and choose when to lean on either, and they work together through composition.<p>I wish people were a bit more patient and spent a bit more time trying to understand these concepts before bashing them. Part of that is the fault of names, communication, and lack of documentation. But the underlying technology is rigid and strong. It&#x27;s here to stay, even if it arrives in other forms.
评论 #43929949 未加载
评论 #43930445 未加载
评论 #43930423 未加载
评论 #43931610 未加载
revskillоколо 6 часов назад
If you put a cache around all GET API handler, you&#x27;re faster than static.
评论 #43930728 未加载
评论 #43930601 未加载
throwaway314155около 5 часов назад
I am having trouble understanding this article&#x27;s premise:<p>```<p>RSC means React Server Components.<p>And yet, although this blog is built with RSC, it is statically served from a Cloudflare CDN using their free static hosting plan. It costs me exactly zero.<p>Zero.<p>How is this possible?<p>Aren’t these React Server Components?<p>```<p>Why is any of that confusing? The very first thing I think of when someone says &quot;React Server Components&quot; is, well, server side rendering of react components. What else could it possibly be? Is anyone who is an established React developer really confused by this?
评论 #43931115 未加载
评论 #43931003 未加载
ricardobeatоколо 3 часов назад
Varnish and PHP say hello from the distant past of 2008.
评论 #43931919 未加载
rco8786около 3 часов назад
One more reason to be confused about nextjs
评论 #43931855 未加载
评论 #43931921 未加载