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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: State-of-the-art for server rendered webapps (non-SPA)?

17 点作者 saurabhnanda超过 5 年前
At my company we have about 80,000+ LoC of AngularJS (v1) in production, which we still actively develop and maintain. We&#x27;ve also dabbled with Angular2&#x2F;Typescript &amp; Elm for the newer features. However, off-late, I am getting increasingly put-off with the amount of complexity SPAs bring into the stack. Especially for user-interfaces that aren&#x27;t <i></i>very<i></i> interactive (or don&#x27;t need to maintain a lot of state in the browser).<p>I remember Rails apps from 5-7 years ago where the entire HTML was rendered by the server. Where required, there was pjax&#x2F;turbolinks and some hand-written jQuery for client-side validations or show&#x2F;hide buttons. What is the current state-of-the-art for these kinds of apps?<p>Think about the billing page of a typical SaaS app [1]. Does it really require to be an SPA communicating with the backend only via APIs? Can&#x27;t it be made of simple HTML pages that do FORM POSTs? What&#x27;s the best way to handle the following in 2019 (or 2020!), without resorting to full-fledged SPAs:<p><pre><code> - Showing&#x2F;hiding UI elements - Possible values of one dropdown depending on the value selected in some other dropdown - Copying billing address to shipping address - Value of a radio button showing&#x2F;hiding some form fields - (I hope you get the point...) </code></pre> PS: Having some type-safety would be an added bonus, because I&#x27;ve been recently bitten by the Haskell bug :)<p>[1] Display list of available plans, let the user pick &amp; configure the plan, make a payment, and move on. Typically it will be used once or twice in a user&#x27;s lifetime.

4 条评论

open-source-ux超过 5 年前
Many of the government services available via GOV.UK are designed to be accessible and usable even when JavaScript is disabled. These services are not designed as SPAs (and all the better for it).<p>For example, here is a demo of an accessible autocomplete drop-down list that uses JavaScript. When JavaScript is disabled, the list becomes a standard HTML drop-down list.<p><a href="https:&#x2F;&#x2F;govuk-location-picker-demo.herokuapp.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;govuk-location-picker-demo.herokuapp.com&#x2F;</a><p>Here is the generic code for the autocomplete on GitHub:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;alphagov&#x2F;accessible-autocomplete" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;alphagov&#x2F;accessible-autocomplete</a><p>And here is a blog post about dealing with a large amount of form inputs:<p><a href="https:&#x2F;&#x2F;accessibility.blog.gov.uk&#x2F;2019&#x2F;04&#x2F;08&#x2F;accessibility-lessons-dealing-with-a-large-amount-of-form-inputs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;accessibility.blog.gov.uk&#x2F;2019&#x2F;04&#x2F;08&#x2F;accessibility-l...</a>
SigmundA超过 5 年前
Server side Blazor is pretty interesting, renders everything in type safe .Net on the server then uses websockets to update dom and bridge javascript. Supports client side webassembly execution model too but not stable.<p>Not exactly lightweight and I guess still a SPA approach but pretty state of the art in server side rendering I would say:<p><a href="https:&#x2F;&#x2F;dotnet.microsoft.com&#x2F;apps&#x2F;aspnet&#x2F;web-apps&#x2F;blazor" rel="nofollow">https:&#x2F;&#x2F;dotnet.microsoft.com&#x2F;apps&#x2F;aspnet&#x2F;web-apps&#x2F;blazor</a>
评论 #21855172 未加载
dhruvkar超过 5 年前
I&#x27;ve been using Python to generate a static Hugo site from a (sort of) CRM API.<p>Mainly because there&#x27;s no real API, and there&#x27;s a just a bunch of scrapers.<p>The funny upside has been that customers really like the speediness of our &quot;real time inventory&quot; (it&#x27;s a re-generated Hugo site every 25 minutes).
评论 #21858325 未加载
评论 #21860750 未加载
thijsvandien超过 5 年前
Have a look at Elixir&#x2F;Phoenix with LiveView. While it’s the state of the art, I’m not sure it would suit you better than sprinkling some JS over an otherwise server-rendered page.
评论 #21871358 未加载