Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use ssrPrefetch in data guide #214

Merged
merged 2 commits into from
Jan 18, 2019
Merged

docs: use ssrPrefetch in data guide #214

merged 2 commits into from
Jan 18, 2019

Conversation

Akryum
Copy link
Member

@Akryum Akryum commented Dec 1, 2018

Reworked the data prefetching guide to use ssrPrefetch and removed all the now unnecessary boilerplate code.

Related feature PR in core: vuejs/vue#9017

@Akryum Akryum self-assigned this Dec 1, 2018
@Akryum Akryum requested a review from yyx990803 December 1, 2018 15:24
},

mounted () {
this.fooInc()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not checking here also if this.fooCount is not set @Akryum ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, and more improvements ✔️

store.replaceState(window.__INITIAL_STATE__)
}
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's a good idea removing the whole client data-fetching part here, as they still address some problems that are not completely solved by ssrPrefetch, e.g. triggering fetches on route change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably take what @trainiac discussed here and explain that ssrPrefetch is meant as a low-level mechanism for achieving "prefetch anywhere on server", but in practice, we probably want to use a higher level plugin to reduce the repetition (as can be done in vue-apollo or Nuxt)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this data-prefetching part is still outdated, because it can't prefetch non-route components.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I mean we need something to replace it

@yyx990803 yyx990803 changed the base branch from master to 2.6 January 18, 2019 21:12
@yyx990803 yyx990803 merged commit d93844e into 2.6 Jan 18, 2019
yyx990803 added a commit that referenced this pull request Feb 4, 2019
* 2.6: serverCacheKey bail out

* 2.6: api additions

* docs: use ssrPrefetch in data guide (#214)

* 2.6: serverPrefetch updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants