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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What happened to server-side rendering?

117 点作者 knasmai大约 6 年前
A few years ago, there was a lot of talk about Isomorphic rendering of JavaScript, but seems to have died down recently.<p>Are any products still using it? What happened?

24 条评论

lelf大约 6 年前
Phoenix.LiveView — you can&#x27;t ignore it, the coolest thing happening right now about server-side rendering.<p>Demo: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;Z2DU0qLfPIY?t=2628" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;Z2DU0qLfPIY?t=2628</a><p>Links: <a href="https:&#x2F;&#x2F;leveljournal.com&#x2F;why-phoenix-liveview-is-a-big-deal" rel="nofollow">https:&#x2F;&#x2F;leveljournal.com&#x2F;why-phoenix-liveview-is-a-big-deal</a> <a href="https:&#x2F;&#x2F;elixirforum.com&#x2F;t&#x2F;phoenix-liveview-info&#x2F;16569" rel="nofollow">https:&#x2F;&#x2F;elixirforum.com&#x2F;t&#x2F;phoenix-liveview-info&#x2F;16569</a><p>PS please stop calling it isomorphic — this is disgrace for the mathematics.
评论 #19466805 未加载
评论 #19468612 未加载
评论 #19466850 未加载
_bxg1大约 6 年前
The main advantage of server-side rendering of client-side templates is cutting your initial load time to a bare minimum (not having to wait for scripts to load&#x2F;compile, taking advantage of page caching, etc.). However, this usually only matters when you&#x27;re afraid of users getting impatient and bouncing, which tends to be true of sites that mainly display content and don&#x27;t have a ton of interactivity, and sites like that usually shouldn&#x27;t be using client-side rendering in the first place.<p>So you have two buckets: web apps that don&#x27;t care too much about shaving milliseconds from the initial load, and content sites that shouldn&#x27;t be shipping heavy JavaScript in the first place. The target market for hybrid rendering is the tiny slice of sites in-between those two, so it&#x27;s a minority of use-cases. Though it is also used by sites in the latter category that are shipping heavy JavaScript anyway and having regrets.
评论 #19466695 未加载
评论 #19466702 未加载
mxstbr大约 6 年前
Universal rendering is widely used in the React ecosystem, in large part thanks to Next.js[0] making it simple to set up and run.<p>Many large sites like Marvel.com, Nike.com, Invisionapp.com, hulu.com and many more run on server-side rendered React, see the Next.js showcase for a more complete list: <a href="https:&#x2F;&#x2F;nextjs.org&#x2F;showcase" rel="nofollow">https:&#x2F;&#x2F;nextjs.org&#x2F;showcase</a><p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&#x2F;</a>
评论 #19466353 未加载
heynk大约 6 年前
At my team, we use next.js for pretty much every &#x27;web-based&#x27; product.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&#x2F;</a><p>It gives you SSR with React out of the box. It&#x27;s really nice to work with, and flexible enough that we haven&#x27;t had issues with more customized situations.
zamalek大约 6 年前
While not JavaScript, there&#x27;s now Razor Components[1]. It doesn&#x27;t work exactly like isomorphic JS, as it operates more like a terminal session (the server sends down VDOM mutations to the client). I&#x27;m not entirely sold on the approach yet, but I am going to be keeping an eye on it.<p>[1]: <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;aspnet&#x2F;core&#x2F;razor-components" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;aspnet&#x2F;core&#x2F;razor-component...</a>
评论 #19465890 未加载
评论 #19465657 未加载
aeharding大约 6 年前
I&#x27;ve had great success with Vue&#x27;s builtin SSR -<p><a href="https:&#x2F;&#x2F;vuejs.org&#x2F;v2&#x2F;guide&#x2F;ssr.html" rel="nofollow">https:&#x2F;&#x2F;vuejs.org&#x2F;v2&#x2F;guide&#x2F;ssr.html</a><p>Great for FB&#x2F;twitter share scraping, google scraping, etc. Also much better startup speeds.<p>Once you get it configured it&#x27;s very little additional work to maintain.<p>I have it set up to do things like determine mobile&#x2F;desktop depending on the `user-agent` to determine the prerendered page to serve, and then the client side JS takes over depending on the viewport size and will either a) Rebuild (less than 1% of the time) changing the markup from desktop-&gt;mobile of mobile-&gt;desktop or b) Continue happily
评论 #19466688 未加载
artellectual大约 6 年前
I built a solution for server side rendering using Elixir &#x2F; Plug and Chrome Headless via Chroxy. It simplifies server side rendering greatly since it doesn’t care about the client side library you use. I have been using it to power my site[1] which is written in React.<p>I also happen to make the Elixir Foundation series of videos[2] that show how to do serverside rendering using elixir. So I’m dog fooding the dog food.<p>[1] <a href="https:&#x2F;&#x2F;www.codemy.net" rel="nofollow">https:&#x2F;&#x2F;www.codemy.net</a><p>[2] <a href="https:&#x2F;&#x2F;www.codemy.net&#x2F;sets&#x2F;elixir-foundation" rel="nofollow">https:&#x2F;&#x2F;www.codemy.net&#x2F;sets&#x2F;elixir-foundation</a>
dfabulich大约 6 年前
For sites using React, Angular, Vue, and Ember, the &quot;talk&quot; has died down because it&#x27;s just a standard feature of the platform. Server-side rendering is part of the table stakes at this point for JS frameworks.
cwisecarver大约 6 年前
Obligatory plug for Phoenix LiveView: <a href="https:&#x2F;&#x2F;github.com&#x2F;phoenixframework&#x2F;phoenix_live_view" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;phoenixframework&#x2F;phoenix_live_view</a><p>edit: This actually has examples <a href="https:&#x2F;&#x2F;dockyard.com&#x2F;blog&#x2F;2018&#x2F;12&#x2F;12&#x2F;phoenix-liveview-interactive-real-time-apps-no-need-to-write-javascript" rel="nofollow">https:&#x2F;&#x2F;dockyard.com&#x2F;blog&#x2F;2018&#x2F;12&#x2F;12&#x2F;phoenix-liveview-intera...</a>
评论 #19466481 未加载
azangru大约 6 年前
&gt; Are any products still using it?<p>Of course they are. Lots.<p>The New York Times. The Intercept. AirBnB. Just off the top of my head.
评论 #19466594 未加载
lr4444lr大约 6 年前
My two cents:<p>1) Lack of reliable real time ability to detect device and compute size. 2) Increased computation complexity of what to render - why put that load on the server when devices are now commensurately as fast - or even faster given the trend to distributed services that maximize network throughput over power.<p>I&#x27;m not even sure why it was so popular in the first place; client server separation is a good thing, IMHO.
评论 #19466547 未加载
评论 #19466351 未加载
bfoks大约 6 年前
Remember that Google Bot uses Chrome 41[1]. So some features from ES6+ might not be supported. It&#x27;s always a good idea to use Babel during compiling a SPA without SSR.<p>[1] <a href="https:&#x2F;&#x2F;developers.google.com&#x2F;search&#x2F;docs&#x2F;guides&#x2F;rendering" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;search&#x2F;docs&#x2F;guides&#x2F;rendering</a>
Scarbutt大约 6 年前
I would say is more relevant now, the time to build and complexities of SPAs has make many companies switch more to multipage SSR react with additional react JS for the browser, for SSR, SSR react is superior (because of components) to stuff like pugs IMO.
评论 #19466558 未加载
k0t0n0大约 6 年前
&gt; There was a lot of talk about Isomorphic rendering of JavaScript, but seems to have died down recently.<p>It&#x27;s no way near dead, just look at nuxtjs&#x2F;nextjs&#x2F;Gatsby. they are getting more popular day by day. Recently I worked on an E-commerce platform using next.js and Gatsby.<p>I have to say its really cool and good user experience overall. the only issue I had was the complexity of the code. You have to think about backend&#x2F;frontend at the same time. I will definitely use it where it makes sense.
martin-adams大约 6 年前
I believe a significant motivation of SSR was to be indexed by Google, then Google said they will start crawling JS rendered pages:<p><a href="https:&#x2F;&#x2F;webmasters.googleblog.com&#x2F;2014&#x2F;05&#x2F;understanding-web-pages-better.html?m=1" rel="nofollow">https:&#x2F;&#x2F;webmasters.googleblog.com&#x2F;2014&#x2F;05&#x2F;understanding-web-...</a><p>So maybe that took the wind out of the sails.
评论 #19466847 未加载
jotto大约 6 年前
It&#x27;s still relevant, just difficult. I think the herd jumped into SPAs before they understood the implications.<p>I was one who jumped in, then tried to automate my way out of client-side slow renders with <a href="https:&#x2F;&#x2F;www.roast.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.roast.io&#x2F;</a> (uses a headless browser to server-side render a JS app)
NicoJuicy大约 6 年前
I can integrate js in a viewengine in asp.net MVC for reuse of HTML components ( yes, server side rendering based on the v8 js engine)<p>I also use razor though, but this is a neat workaround instead of using a headless browser.<p>The right mix of using scaffolders in. Net ( server side) and client side components can decrease development time exponentially
leowoo91大约 6 年前
I&#x27;m still surprised how many people are not aware of client-side rendering being unstable, because they don&#x27;t see the final result per visitor, but a prediction most of the time. Testing cross-browser is another story, though it can help a bit, is also usually omitted.
badsavage大约 6 年前
Server-side rendered React with Clojure is my favorite way to deal with a website
torte大约 6 年前
The talk died down because it became a standard way of doing things now. It isn&#x27;t something special anymore and the tooling has evolved to make it more seamless.
andrei_says_大约 6 年前
It’s happy and well, being the main source of rendering in most of my live apps.
moltar大约 6 年前
Nuxt is in full swing
aboutruby大约 6 年前
Most people have realized it&#x27;s actually complicated to do it right and just gave up on server-rendering their React apps (e.g. Reddit).
评论 #19466614 未加载
austincheney大约 6 年前
1) What do you mean by server-side rendering of JavaScript? It sounds like you mean executing JavaScript on the server that otherwise is destined to execute on the client-side. I execute JavaScript on the server&#x2F;terminal all the time and don&#x27;t call it <i>server-side rendering</i>.<p>2) What is your motivation? What problem do you think you are solving with <i>server-side rendering</i>?
评论 #19466428 未加载