-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 unexpected state resetting #1408 #1914
Conversation
Can I do something for your review? |
I found a bug that is caused with a specific case in this PR, and I'm going to fix the bug. |
Hi @dotneet I think it could be merged yes, it seems legit, I let you fix the bug before merging. |
@Atinux Thank you for replying. I've fixed the issue and pushed it now. |
Codecov Report
@@ Coverage Diff @@
## dev #1914 +/- ##
=========================================
- Coverage 89.32% 89% -0.32%
=========================================
Files 14 14
Lines 946 946
=========================================
- Hits 845 842 -3
- Misses 101 104 +3
Continue to review full report at Codecov.
|
Thank you @dotneet You're helping use a lot :) |
Ok I see, the problem is when we use query parameters, it does not update automatically now. |
Thank you for feedback. Exactly. query parameters affects components but we can't detect what components need to be updated. so we need to update all components. this causes state resetting again. I think that the behavior caused by fixPrepatch() is useful almost but it's not natural when it compared to vue-router's specification. So I propose removing data() evaluation on afterEach hook or making data() evaluation optional. I think data() evaluation on afterEach hook causes some problems:
these problems would produce many bugs. Do you have any thought on this? NOTE: |
I invited you on our Slack so we can talk about it by message :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
related issue #1408
getMatchedComponentsInstances() in utils.js returns all components that is matched to new path.
I think this is the root cause of this issue.
getChangedComponentsInstances() in this PR returns components that needs to call data().
This repo can be used to reproduce a problem.
https://github.com/dotneet/nuxt-issue-1408