-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix(vue-app): prevent calling asyncData
in keep-alive pages (#5945)
#5947
Conversation
Thanks for the PR. A test is failing and actually it should not since it actually does not use In order to check it, I believe you may want to keep the instance of the page, if it exists, get its VNode and checks if it uses |
@Atinux oh yeah... I forgot e2e test 😨 p.s. I had checked |
Codecov Report
@@ Coverage Diff @@
## dev #5947 +/- ##
=======================================
Coverage 95.68% 95.68%
=======================================
Files 82 82
Lines 2689 2689
Branches 690 690
=======================================
Hits 2573 2573
Misses 98 98
Partials 18 18
Continue to review full report at Codecov.
|
Nice @Elevista Would be nice to complete with another test (I guess adding a new layout with |
@Atinux |
little late because I'm busy with work these days. 😅 |
Why shouldn't asyncData be called again with keep-alive? Now it's not even going to be called? :-| |
@ericmuyser Key of keep-alive page is route url, so if |
Thanks for your contribution to Nuxt.js!
Issues that are labeled as |
It's been a long time, could this merge request be reviewed or merged? |
asyncData
when keep-alive page activated (#5945)asyncData
in keep-alive pages (#5945)
007c785
to
a84f31d
Compare
This was wrong approach.. |
Types of changes
Description
Resolves: #5945
Reproduction link: https://codesandbox.io/embed/codesandbox-nuxt-7ostd
related code
https://github.com/nuxt/nuxt.js/blob/f3d29e378087b6c6c686a03292c2bce409161110/packages/vue-app/template/client.js#L386-L397
https://github.com/nuxt/nuxt.js/blob/f3d29e378087b6c6c686a03292c2bce409161110/packages/vue-app/template/utils.js#L24-L31
Component.options.__hasNuxtData
value of SSR rendered keep-alive page istrue
Checklist: