-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support latest Nuxt in SSR utils #34
base: master
Are you sure you want to change the base?
Conversation
Congratulations 🎉. DeepCode analyzed your code in 5.884 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s Dashboard | Configure the bot |
return getNuxtData().vueConcurrency[key].value; | ||
} | ||
if (process.client) { | ||
onBeforeMount(async () => !task._instances.length && task.perform()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is onBeforeMount
needed here? shouldn't if (process.client)
be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is personal preference and is analogous to how @nuxtjs/composition-api
handles these sorts of cases internally. The alternative you propose should work, I imagine (but this hasn't been battle-tested like my implementation).
} | ||
if (process.client) { | ||
onBeforeMount(async () => !task._instances.length && task.perform()); | ||
reviveTaskInstances(key, task); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the revive happens after task.perform()
? shouldn't it be the other way around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it's irrelevant because of onBeforeMount
. In the alternative you proposed, you would need to revive the task instances prior to (conditionally) running task.perform()
.
It seems like your Prettier has quite a different style. Lack of |
This uses something other than Prettier, so some formatting is in order anyway; but good idea nonetheless. |
In continuation of #10, this version of
ssr-utils.js
should work with all future^2
versions of Nuxt.