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

Support latest Nuxt in SSR utils #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Support latest Nuxt in SSR utils #34

wants to merge 2 commits into from

Conversation

kpdemetriou
Copy link

In continuation of #10, this version of ssr-utils.js should work with all future ^2 versions of Nuxt.

@ghost
Copy link

ghost commented Jan 27, 2021

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());
Copy link
Owner

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?

Copy link
Author

@kpdemetriou kpdemetriou Feb 7, 2021

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);
Copy link
Owner

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?

Copy link
Author

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().

@MartinMalinda
Copy link
Owner

It seems like your Prettier has quite a different style. Lack of {} strikes me most. I should probably add some .prettierrc to root.

@kpdemetriou
Copy link
Author

This uses something other than Prettier, so some formatting is in order anyway; but good idea nonetheless.

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.

2 participants