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(watch): handle the deep watch with primitive value #11998

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

Conversation

linzhe141
Copy link
Contributor

@linzhe141 linzhe141 commented Sep 22, 2024

I think #11983 is a bug
fix #11983

Copy link

github-actions bot commented Sep 22, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (+43 B) 38 kB (+7 B) 34.2 kB (-16 B)
vue.global.prod.js 160 kB (+43 B) 58 kB (+6 B) 51.5 kB (+28 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 49 kB 18.9 kB 17.2 kB
createApp 55.6 kB (+43 B) 21.4 kB (+7 B) 19.5 kB (-32 B)
createSSRApp 59.6 kB (+43 B) 23.1 kB (+2 B) 21 kB (+3 B)
defineCustomElement 60.4 kB (+43 B) 22.9 kB (+3 B) 20.9 kB (-53 B)
overall 69.4 kB (+43 B) 26.5 kB (-1 B) 24.1 kB (+61 B)

Copy link

pkg-pr-new bot commented Sep 22, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 1fd3fd7

@linzhe141 linzhe141 changed the title fix(watch): handle functional sources that do not return objects fix(watch): handle functional sources that do not return objects with deep Sep 22, 2024
@skirtles-code
Copy link
Contributor

I think #7167 is similar. I'm not sure why it was closed, it might have been a misunderstanding.

I'm not sure whether this a bug or not. Personally, I think it's an arbitrary choice between two different behaviours. It isn't immediately obvious to me which is better. To be clear, I think the question that we need to answer here is...

  • If deep: true is used and the value is currently a primitive, should it perform the change check?

If we do the check for a function source then I would also expect to do the same for other types of source that can evaluate to a primitive. e.g. a ref:

@linzhe141 linzhe141 marked this pull request as draft September 23, 2024 01:21
@linzhe141 linzhe141 marked this pull request as ready for review September 23, 2024 01:33
@linzhe141 linzhe141 changed the title fix(watch): handle functional sources that do not return objects with deep fix(watch): handle the deep watch when the source is not an object Sep 23, 2024
@edison1105
Copy link
Member

/ecosystem-ci run

@edison1105 edison1105 changed the title fix(watch): handle the deep watch when the source is not an object fix(watch): handle the deep watch with primitive value Sep 23, 2024
@vue-bot
Copy link
Contributor

vue-bot commented Sep 23, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt success success
pinia success 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 failure failure
vuetify success success
vueuse failure success
vue-simple-compiler success success

@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Sep 23, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt success success
pinia success 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 failure failure
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 added the ready for review This PR requires more reviews label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔩 p2-edge-case ready for review This PR requires more reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

watch deep options incorrect action
4 participants