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

refactor(reactivity): unnecessarily func call #11328

Merged
merged 4 commits into from
Oct 11, 2024
Merged

Conversation

Sorryhx
Copy link
Contributor

@Sorryhx Sorryhx commented Jul 10, 2024

Hello! There are some trouble when we try to find a value form a reactive array. If the arg was a raw value and the target array had not included it, the findValue function will still execute twice. It's unnecessary I think. Maybe we can resolve it by adding a condition.

@yyx990803
Copy link
Member

Can you provide sample code where this happens? Ideally there should be a test case to demonstrate this.

Copy link

github-actions bot commented Jul 15, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB 38.1 kB 34.2 kB
vue.global.prod.js 160 kB 58 kB 51.5 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 49.1 kB 18.9 kB 17.3 kB
createApp 55.7 kB 21.4 kB 19.6 kB
createSSRApp 59.7 kB 23.1 kB 21 kB
defineCustomElement 60.4 kB 23 kB 20.9 kB
overall 69.4 kB 26.5 kB 24.1 kB

@Sorryhx
Copy link
Contributor Author

Sorryhx commented Jul 16, 2024

Can you provide sample code where this happens? Ideally there should be a test case to demonstrate this.

Hi, Evan. I have added some test cases, and here is the sample code. @yyx990803

@edison1105 edison1105 added ready to merge The PR is ready to be merged. scope: reactivity 🧹 p1-chore Priority 1: this doesn't change code behavior. labels Oct 8, 2024
@edison1105
Copy link
Member

edison1105 commented Oct 8, 2024

It's already fixed by https://github.com/vuejs/core/pull/9511/files#diff-2b8c2b531651dd15cee7c2b11e34972f4a4903c114e94e74c0e94bb10f03ed0fR291, but no related test cases were added in #9511, maybe we should keep the test cases in this PR.

@Sorryhx Sorryhx closed this Oct 8, 2024
@edison1105 edison1105 reopened this Oct 8, 2024
Copy link

pkg-pr-new bot commented Oct 8, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 65e27cf

@Sorryhx
Copy link
Contributor Author

Sorryhx commented Oct 8, 2024

It's already fixed by https://github.com/vuejs/core/pull/9511/files#diff-2b8c2b531651dd15cee7c2b11e34972f4a4903c114e94e74c0e94bb10f03ed0fR291, but no related test cases were added in #9511, maybe we should keep the test cases in this PR.

Sorry for closed, I didn't notice the last part.

@yyx990803 yyx990803 merged commit d96883c into vuejs:main Oct 11, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior. ready to merge The PR is ready to be merged. scope: reactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants