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 a ref directly nested in reactive #11694

Closed
wants to merge 4 commits into from

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Aug 23, 2024

close #11696

Copy link

github-actions bot commented Aug 23, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 99.1 kB (+51 B) 37.5 kB (+19 B) 33.8 kB (-17 B)
vue.global.prod.js 157 kB (+51 B) 57.3 kB (+16 B) 51 kB (+19 B)

Usages

Name Size Gzip Brotli
createApp 54.5 kB (+51 B) 21.1 kB (+17 B) 19.3 kB (+20 B)
createSSRApp 58.5 kB (+51 B) 22.8 kB (+16 B) 20.8 kB (+7 B)
defineCustomElement 59.2 kB (+51 B) 22.6 kB (+17 B) 20.6 kB (+27 B)
overall 68.1 kB (+51 B) 26.2 kB (+22 B) 23.8 kB (-44 B)

Copy link

pkg-pr-new bot commented Aug 23, 2024

commit: dd1ae3e

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

Open in Stackblitz

@@ -40,6 +40,9 @@ export class Dep {
subsHead?: Link

constructor(public computed?: ComputedRefImpl | undefined) {
// @ts-expect-error
this[ReactiveFlags.SKIP] = true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change ensures the instance of Dep non-reactive.

@@ -82,6 +82,9 @@ class BaseReactiveHandler implements ProxyHandler<Target> {
return
}

// only track its value if target is a ref
if (isRef(target) && key !== 'value') return (target as any)[key]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore: dep, __v_isRef, __v_isShallow, _rawValue, _value

@edison1105 edison1105 closed this Aug 29, 2024
@edison1105 edison1105 deleted the fix/ref-nested-in-reactive branch August 29, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working scope: reactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

access a ref nested in reactive cause "Maximum call stack size exceeded"
1 participant