Open alexsandro-xpt opened 7 years ago
We disabled it for the time being but we can add it back in, and give some info on how to enable/disable it. It was previously done like this https://github.com/MarkPieszak/aspnetcore-Vue-starter/blob/91284ba8e2c67d7b2152b58be1efb89d7f7febfe/Client/renderOnServer.js in an older version of the repo.
@vip32 @anderly Should we give the option of enabling SSR now that the repo is more up to speed?
I'd say let's add it back in if it's easy.
yes, we can add it back if it not overly complicates the starter.
It would also be awesome if there are some comments/thoughts on how to ensure data has been loaded before sending the HTML to the client. This seems to me to be a missing piece of the SSR puzzle and it would be awesome to hear comments from some of the wizards! ;-)
SSR was the main purpose for me to use this template, as VueJS have a lot of issues when it comes to SSR.
Is it something we wanted back In the template?
I'd prefer it to be back :-)
(can be commented if you don't want it default)
I'd prefer it to be back
Nuxt.js can be used to achieve!
I took a crack at this; I actually got it to work before on a different project, using SPA Services, aspnet-prerendering and vue-server-renderer.
It worked great on this other project, which I based on this original repo, but I realized that it wasn't using the vendors.config at all. Once I add that in, it starts complaining that vendor_hash is undefined. I found another guy who had a similar problem but his wasn't resolved either: https://github.com/aspnet/JavaScriptServices/issues/1660
I forked and committed my changes here: https://github.com/selaromdotnet/aspnetcore-Vue-starter/tree/ssr
if anyone wants to take a look and help me see what I'm doing wrong, we might get pretty close to solving this one, but I really don't know enough about webpack to try and figure this out on my own :(
To make the current release more lean (without SSR), consider removing 'vue-server-renderer' from package.json
How do you want enable Server Side Render within ASPnetCore?