-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
updated
is called but component wasn't updated (different from Vue 2)
#2293
Comments
This is expected, it did update. It wouldn't trigger with nested components though |
This is actually a breaking change from v2. In the process of migration, the resulting performance loss makes me very confused. We have a huge amount of data, and each of them needs to be controlled whether it is displayed or not. In v3, it takes an extra 150 milliseconds per second on computing useless rendering, and our FPS decreased from 60 to 50. I suggest this should be documented. |
updated
is called but component wasn't updated (different from Vue 2)
It's true the behavior is different from Vue 2 and I'm not even sure it makes sense for it to call the |
In v2, it seems that component would not update even the v-show changed (update display:none only). But in v3, no matter the v-show changes or not, as long as the parent component updated, the child component will render again(there are no props changes). |
That sounds like v2 behaviour if you used |
If I'm reading it right, So any 'custom' directive would cause the same problem. |
We can definitely optimize this but I wouldn't consider it a bug. |
It took me a long time to figure out that this is what was killing performance in my app. I am rendering ~3000 custom components (each rendering one SVG element) via I then followed this hint,
basically just by extracting the With just that, performance went up from super janky (~20fps) to almost 60fps for me! I think enhancing this would benefit users with a similar use case like mine greatly, i.e., users who want to render large amounts of (list) data with mostly localized changes. I almost would have gone to migrate my Vue3 app to Vue2 (which I do not know) or would have dropped Vue altogether, if I hadn't found the info in this GitHub issue. Or maybe a temporary note in the docs that mentions/discusses this quirk could be added to this doc section https://v3.vuejs.org/guide/component-edge-cases.html#controlling-updates ? Thanks for the hints everyone! |
Version
3.0.0
Reproduction link
https://jsfiddle.net/7revor/xw0tLp65/42/
Steps to reproduce
1.Open the console.
2.Click the update button.
3.Observe the logging.
What is expected?
Child component would not have updated.
What is actually happening?
Child component updated.
The text was updated successfully, but these errors were encountered: