-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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(reactivity): re-fix #10114 #10123
Conversation
Size ReportBundles
Usages
|
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
}) | ||
const provider = computed(() => value.value + consumer.value) | ||
expect(provider.value).toBe('0foo') | ||
expect(provider.effect._dirtyLevel).toBe(DirtyLevels.Dirty) |
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.
I'm not sure if it is good practice to leave a computed dirtyLevel
as Dirty
after accessing its value.
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 correct and reasonable, because provider
deps are indeed changed during accessing its value.
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.
That's OK, but then we should find a way to triggerEffects even computed are dirty.
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.
Yes, it works with the latest commit.
<script setup>
import {ref, computed, nextTick, effect} from "vue"
const value = ref(0)
const consumer = computed(() => {
value.value++
return 'foo'
})
const provider = computed(() => value.value + consumer.value)
effect(() => {
// should console twice
console.log(provider.value)
})
nextTick().then(() => {
value.value += 1
})
</script>
<template>
<div>
1
</div>
</template> This computed will lose it's reactivity |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
The latest CI results are here, it was not updated in the comment: https://github.com/vuejs/ecosystem-ci/actions/runs/7536772812 |
@johnsoncodehk I believe I've found your changes here to cause new issues, see #10172 |
Hey! Here I found a confused problem. dep.get(effect) === effect._trackId Here I think it will always be I'm not sure if it has other functions. : > |
Re-fix #10114 and resolve #10085 and #10090 regressions introduced in 3.4.14.