Closed rw3iss closed 7 years ago
If you look at the components themselves.. inside of the preFetch method on each component. If you then look at https://raw.githubusercontent.com/egoist/vue-isomorphic-starter/master/client/server-entry.js, you'll see the Promise.all which resolves the data. Given that this is a promise.all.. all of these preFetches have to complete before it is rendered on the server side. At least that is my understanding.
Hi, I'm deprecating this project, see https://github.com/egoist/unvue for alternative, it's based on vue-hackernews-2.0, check out preFetch for pre-fetching data.
Hi, Is there any general protocol to prefetching remote data for the server-side render? It is actually local data (on a separate local API server). It's my understanding this is what prefetch is for... I'm just trying to load initial object data for a specific component on the server. The server router finds the component, and before render, it wants to load some data. Is there a specific way to do this with this setup? I know that challenges arise if the data is remote/async... If all else fails, I'll just load it from the client, but with the server-side rendering, it seems like it would be appropriate to get the data there for the initial load and stick it in the store.