Best solution for Server Side Rendering in Quasar
-
Hello guys,
I’m finding the best solution for for Server Side Rendering in Quasar framework. My friends told me to write a ServerJS file to let ExpressJs get data with API and render HTML by EJS instead of use Vue Server Render (proved conflict of Quasar)Please help me if you have experience in Server Side Rendering. Thank you in advance!
-
@chelsea39 said in Best solution for Server Side Rendering in Quasar:
Hello guys,
I’m finding the best solution for for Server Side Rendering in Quasar framework. My friends told me to write a ServerJS file to let ExpressJs get data with API and render HTML by EJS instead of use Vue Server Render (proved conflict of Quasar)Please help me if you have experience in Server Side Rendering. Thank you in advance!
Quasar isn’t yet SSR ready. If you could be a bit patient, SSR is in the plans for the near future.
Scott
-
I see Quasar have solution for SSR, but it’s seemly not good!
http://quasar-framework.org/guide/app-prerendering-for-seo.html -
@chelsea39 that’s just a tip. Those packages are NOT maintained by Quasar nor does Quasar ensures any guarantee on their quality.
True SSR will be available for Quasar (by Quasar team) in the future. -
@rstoenescu Hope we will see soon
-
I’m looking at using prerendering on Netlify and not seeing it work at the moment. They say they use the open source prerender that prerender.io uses, so I tried their service url with no luck either. This however does work: http://service.prerender.io/http://quasar-framework.org/quasar-play/android/index.html
Were any extra steps taken for prerendering on that demo site? I am trying a basic index vue with a vuejs swiper slider on it at the moment and only seeing the app div in the body for the prerender.
-
Incase this helps others out there:
It turned out I had not uncommented the ie support / Promise polyfill, which is required by https://github.com/prerender/prerender ( PS. Install that locally and turn on logging in the server.js file to see errors )
The next thing that got in the way was it worked with the default quasar template but my site includes vuex and running the prerenderer again could not find the Promise and also had a message from vuex about Promise being missing. The fix I have used at the moment is to move the require(
quasar/dist/quasar.ie
) line from main.js to my vuex store.js file.The move was based on a comment from here: https://laracasts.com/discuss/channels/vue/ie-11-vuex-polyfill
And this may be useful: https://github.com/vuejs-templates/webpack/issues/474#issuecomment-278748816 -
PS. If there is a better way that doesnt move quasar boilerplate around ( not that moving a require statement is a big deal ) lets talk about it here.
-
How soon the ssr support will be ready?
-
Next thing is i18n + DataTable rewrite and then SSR will be added.