1

We have a website that's running AngularJS 1.* but one of our main clients are military personnel and they frequently attempt to use the site via Department of Defense computers. These, of course, have javascript disabled.

I've heard of doing server side rendering, but the majority of the examples and research just mention using it for the initial load. We would need the entire site to run off that principle. Essentially acting like an old MVC site. Is this even possible? And I don't mean with just angularJS. Angular 2(5, whatever version we're on now), or react. I just really don't want to back track to .net MVC

Edit: I realize this is, for all intents, a silly question. I was just hoping there was some awesome new tech that had solved the issues that would be present in even attempting this (as stated below, data-binding. I realize this concept completely defeats the purpose of SPAs)

Thanks anyways. I may just delete this question. Didn't have too many expectations to begin with.

cphilpot
  • 1,155
  • 3
  • 17
  • 39

1 Answers1

2

This is very possible! Don't let the rest of the people here fool you.

We have a few websites that work just fine with or without JavaScript enabled. My company website https://bitgenics.io is a React app. If you disable your JavaScript the only thing that won't work is the client-side video player.

Now I have no experience with Angular 1 (and I have heard SSR is hard there), but support should be better in the later versions of it. Getting the GETs to work is the first challenge. But the next one is that you have to have a fallback for your HTTP POSTs. SPAs often use straight REST calls to do any state changes, but you can't do that because it requires JS on the client.

So your forms have to a fallback of a regular FORM post. So you might need some server-side logic to receive these POSTs and respond with a Server-Side Rendered page again.

  • oh goodness, that's a lot of work. I think our existing site is already too embedded with JS to reasonably redo. But I see what you're getting at. I feel like this would be creating an MVC app but with a SPA library. Not sure this would be worth it? But I see how this might be achieved. Seems messy though. – cphilpot Feb 13 '18 at 14:35
  • 1
    You asked if it was possible, not if it was easy :D But yeah, it isn't trivial, especially in Angular 1 I hear. If you are on later versions of Angular it is supposed to get better. You certainly don't have to redo your app though, most SSR solutions allow you to render the HTML/CSS on the server, so you re-use most of your rendering logic. – Erwin van der Koogh Feb 14 '18 at 19:56
  • Btw.. could you do me a favor and mark my answer as correct? There are a *lot* of misconceptions about this area as you can see by the other answers/reactions. I am trying really hard to educate people on this.. – Erwin van der Koogh Feb 14 '18 at 19:59
  • @ErwinvanderKoogh Do you happen to have any blog posts on this topic? I was under the impression that probably ` – toraritte Aug 29 '18 at 15:55