TrilonIO / aspnetcore-Vue-starter

*NEW* Asp.net Core & Vue.js (ES6) SPA Starter kit - Vuex, webpack, Web API, Docker, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.21k stars 266 forks source link

SSR is enable? #23

Open alexsandro-xpt opened 7 years ago

alexsandro-xpt commented 7 years ago

How do you want enable Server Side Render within ASPnetCore?

MarkPieszak commented 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?

anderly commented 7 years ago

I'd say let's add it back in if it's easy.

vip32 commented 7 years ago

yes, we can add it back if it not overly complicates the starter.

cjblomqvist commented 7 years ago

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! ;-)

kherona commented 7 years ago

SSR was the main purpose for me to use this template, as VueJS have a lot of issues when it comes to SSR.

MarkPieszak commented 7 years ago

Is it something we wanted back In the template?

cjblomqvist commented 7 years ago

I'd prefer it to be back :-)

cjblomqvist commented 7 years ago

(can be commented if you don't want it default)

vdasus commented 7 years ago

I'd prefer it to be back

ElderJames commented 6 years ago

Nuxt.js can be used to achieve!

selaromdotnet commented 6 years ago

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 :(

0xgeert commented 5 years ago

To make the current release more lean (without SSR), consider removing 'vue-server-renderer' from package.json