Aspnetcore-angular-universal: Add option to turn off SSR(Server Side Rendering)

Created on 20 Apr 2017  路  11Comments  路  Source: TrilonIO/aspnetcore-angular-universal

Add an option to turn off rather than force user to delete/comment things.

PRs welcome! enhancement

Most helpful comment

This would be a nice idea actually, make it a little easier for people to Opt-in/out of it.

I think by default it might almost be easier to have it Off, as I don't think most apps need the benefits of SSRendering. Let me see what I can come up with! Good idea @skorunka

All 11 comments

Also maybe disable SSR for development?
It would speed up webpack compilation twice.

We just did that yesterday.
No problems for now.

Hi, could you share your code please? And BTW: How do you bundle CSS and include it in HTML master page when you turn off SSR?

This would be a nice idea actually, make it a little easier for people to Opt-in/out of it.

I think by default it might almost be easier to have it Off, as I don't think most apps need the benefits of SSRendering. Let me see what I can come up with! Good idea @skorunka

Especially since things like Material 2 don't support it (at this point) - I've turned mine off 馃憤 .

@TimHarker When you turn off SSR, how do you bundle CSS and insert it into page? I had to do this: https://github.com/MarkPieszak/aspnetcore-angular2-universal/issues/161#issuecomment-295829586

@TimHarker Could please kindly share how you totally disabled SSR and cleaned both your Angular and .NET server code? Thanks!

You can just comment out the code in HomeController, make it do nothing but return View(); for the Index Route. Return the _index.cshtml file to <app></app> instead of ViewData["SpaHtml"] and that should do it, there might be a few more things, but that'll work I believe. @vicver82

@MarkPieszak Thank you Mark!
I've done that, as per your instructions in the Readme file. I'm currently trying to clean all ng-side files, and to get aot working again.

@vicver82 this issue good to close?

Yes, thank you.

Yeah we can close it for now, eventually we can work on some type of flag that handles turning it on/off for us.

Was this page helpful?
0 / 5 - 0 ratings