Skip to content
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): handle MaybeDirty recurse #10187

Merged
merged 8 commits into from
Feb 6, 2024

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Jan 23, 2024

fix #10185, still have to add a test case done.

Copy link

github-actions bot commented Jan 23, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.2 kB (-21 B) 34.3 kB (-34 B) 31 kB (+16 B)
vue.global.prod.js 147 kB (-21 B) 53.6 kB (+1 B) 47.9 kB (+60 B)

Usages

Name Size Gzip Brotli
createApp 50.3 kB (-21 B) 19.7 kB (-14 B) 18 kB (+25 B)
createSSRApp 53.6 kB (-21 B) 21 kB (-19 B) 19.1 kB (-3 B)
defineCustomElement 52.6 kB (-21 B) 20.4 kB (-24 B) 18.6 kB (-17 B)
overall 64 kB (-21 B) 24.7 kB (-25 B) 22.4 kB (-53 B)

@johnsoncodehk
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Jan 23, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success success
nuxt success success
pinia success success
quasar failure success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@Doctor-wu
Copy link
Member

Doctor-wu commented Jan 23, 2024

  it('should trigger effect even computed already maybe dirty', () => {
    const fnSpy = vi.fn()
    const v = ref(0)
    const c1 = computed(() => {
      if (v.value === 0) {
        v.value = 1
      }
      return 'foo'
    })
    const c2 = computed(() => c1.value)

    effect(() => {
      fnSpy()
      c2.value
    })
    expect(fnSpy).toBeCalledTimes(1)
    expect(c1.effect._dirtyLevel).toBe(DirtyLevels.Dirty)
    expect(c2.effect._dirtyLevel).toBe(DirtyLevels.MaybeDirty)
    v.value = 2
    expect(fnSpy).toBeCalledTimes(2)
  })

@johnsoncodehk Here's a minimal test, can't push to this pr so I just provide the code 😂

@johnsoncodehk
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Jan 23, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success success
nuxt success success
pinia success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@johnsoncodehk johnsoncodehk marked this pull request as ready for review January 23, 2024 04:25
@yyx990803 yyx990803 merged commit 6c7e0bd into vuejs:main Feb 6, 2024
11 checks passed
lynxlangya pushed a commit to lynxlangya/core that referenced this pull request May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reactivity regression in 3.14.15
4 participants