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): should not recompute if computed does not track reactive data #12341

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Nov 7, 2024

revert #11931 re-fix #11929
close #12337

Copy link

github-actions bot commented Nov 7, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+3 B) 38 kB (+4 B) 34.2 kB (+12 B)
vue.global.prod.js 159 kB (+3 B) 57.9 kB (+3 B) 51.4 kB (-21 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.9 kB (+3 B) 18.3 kB (-2 B) 16.7 kB (+5 B)
createApp 55 kB (+3 B) 21.3 kB 19.4 kB (+7 B)
createSSRApp 59 kB (+3 B) 23 kB (+1 B) 20.9 kB (-59 B)
defineCustomElement 59.8 kB (+5 B) 22.8 kB (+1 B) 20.8 kB (+3 B)
overall 68.7 kB (+3 B) 26.3 kB 24 kB (-16 B)

Copy link

pkg-pr-new bot commented Nov 7, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@12341

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@12341

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@12341

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@12341

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@12341

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@12341

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@12341

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@12341

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@12341

vue

pnpm add https://pkg.pr.new/vue@12341

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@12341

commit: bf6500d

@linzhe141
Copy link
Contributor

Maybe this modification will be simpler

export function triggerRef(ref: Ref): void {
  // ref may be an instance of ObjectRefImpl
  if ((ref as unknown as RefImpl).dep) {
    // add
    if ((ref as unknown as RefImpl).dep.computed) {
      refreshComputed((ref as unknown as RefImpl).dep.computed!)
    }
    ...
  }
}

@edison1105 edison1105 changed the title fix(reactivity): force trigger computed fix(reactivity): should not recompute if computed does not track reactive data Nov 7, 2024
@edison1105 edison1105 added ready to merge The PR is ready to be merged. scope: reactivity and removed ready to merge The PR is ready to be merged. labels Nov 7, 2024
@edison1105 edison1105 marked this pull request as draft November 7, 2024 07:33
@edison1105 edison1105 marked this pull request as ready for review November 7, 2024 08:01
@vuejs vuejs deleted a comment from vue-bot Nov 7, 2024
@vuejs vuejs deleted a comment from vue-bot Nov 7, 2024
@vuejs vuejs deleted a comment from vue-bot Nov 7, 2024
@edison1105
Copy link
Member Author

/ecosystem-ci run

@edison1105 edison1105 added the ready to merge The PR is ready to be merged. label Nov 7, 2024
@vue-bot
Copy link
Contributor

vue-bot commented Nov 7, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success success
nuxt success success
pinia failure success
primevue 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The PR is ready to be merged. scope: reactivity
Projects
None yet
4 participants