VueJS newbie here. I finally got a skeleton app working with SSR and reactivity. One issue is still dogging me. When the server first sends the fully rendered page and displays it correctly, it then flickers because it drops into the meteor subscribe. But that isn’t necessary upon first load, because it already has all the data.
How can I prevent re-subscribing to data when the page is already fully rendered? Is there a way to check for SSR on the client side?
Hey. I am going to look into this today actually. The problem is that there needs to be a form of none reactive hydration of the collections. I have some ideas for it (pre hyrdate as part of the html body or freeze reactive updates on innitial subscription)
I will keep you posted if I made that work or at least a message in a couple of hours with an update
Not familiar how vuejs hydrates, but here is a related post I did for React
What we did was on load, the component checks for a specific ID if it exists in the DOM and just use that content on re-render. That removes the white-screen repaint for SSR. Ideally this is automatically handled by React and Vue.
Yes this is true. @akryum has created Meteor Vue SSR for this. However even with this package, it will not solve the problem, because its related to the clientside hydration part of minimongo.
Minimongo currently has no clean way of being hydrated (ejson data from html into clientside collection without triggering updates. That’s currently something i’m looking into, becuase its quite a critical thing for me to have.