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.
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.
This is correct and reasonable, because provider deps are indeed changed during accessing its value.
There was a problem hiding this comment.
That's OK, but then we should find a way to triggerEffects even computed are dirty.
There was a problem hiding this comment.
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: |
|
@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.