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

feat(ssr): ssrPrefetch option #9017

Merged
merged 11 commits into from
Dec 20, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: ssrPrefetch not an array
  • Loading branch information
Guillaume Chau committed Nov 7, 2018
commit 99765c77b2371143feb9e1b220eda0a912d8733e
3 changes: 2 additions & 1 deletion src/server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ const normalizeRender = vm => {
}

function waitForSsrPrefetch (vm, resolve, reject) {
const handlers = vm.$options.ssrPrefetch
let handlers = vm.$options.ssrPrefetch
if (isDef(handlers)) {
if (!Array.isArray(handlers)) handlers = [handlers]
try {
const promises = []
for (let i = 0, j = handlers.length; i < j; i++) {
Copy link

@galvez galvez Dec 7, 2018

Choose a reason for hiding this comment

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

@Akryum pardon me the intrusion -- just thought i'd drop this here -- I see that you're using a pattern for for loops that I used to employ myself, but, unless you assign the length to an external variable, this idiom actually makes things slower :(

Expand Down