from Hacker News

Ask HN: Any web frontend library that fallbacks to SSR if JavaScript is missing?

by _448 on 5/4/23, 5:30 AM with 15 comments

What web frontend frameworks/libraries are available that fallbacks to server-side rendering if JavaScript is unavailable on the client-side?

I can think of Unpoly, but are there any other options available?

  • by pcthrowaway on 5/4/23, 9:59 AM

    I'm pretty sure Svelte and Sveltekit can do this for navigation. Maybe Gatsby too.

    But keep in mind a lot of the interactivity won't work the same.

    Generally the page is pre-rendered on the server, and then links are hydrated to prevent page refreshes on navigation. If Javascript is off, the browser does a page refresh when the user clicks links, and the server pre-renders those.

    In fact, I think a lot of frameworks can do this now: Qwik, Next, etc.

  • by hoofhearted on 5/5/23, 2:48 PM

    Yes, I have built one on top of Next.js.

    What do you think? Is this what you are looking for?

    https://www.elegantframework.com/

    https://github.com/elegantframework/elegant-cli

  • by v0idzer0 on 5/4/23, 8:10 PM

    React? Pretty trivial to set this up in React. But why fallback when you can just do both. SSR always. Then let the js run if its enabled. This is what Next.js and countless other react frameworks do
  • by seabysalt on 5/6/23, 2:48 PM

    Definitely next.js that's why it's also way better for SEO than react
  • by satvikpendem on 5/4/23, 7:36 PM

    NextJS does this.
  • by ushakov on 5/4/23, 11:17 AM

    Remix
  • by yieldcrv on 5/4/23, 8:34 AM

    Can next js do this?