vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
46.94k stars 8.24k forks source link

fix(watch): handle the deep watch with primitive value #11998

Open linzhe141 opened 1 week ago

linzhe141 commented 1 week ago

I think #11983 is a bug fix #11983

github-actions[bot] commented 1 week ago

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)
pkg-pr-new[bot] commented 1 week ago

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

skirtles-code commented 1 week ago

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 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:

edison1105 commented 1 week ago

/ecosystem-ci run

vue-bot commented 1 week ago

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools :x: failure :x: failure
nuxt :white_check_mark: success :white_check_mark: success
pinia :white_check_mark: success :white_check_mark: success
primevue :white_check_mark: success :white_check_mark: success
quasar :white_check_mark: success :white_check_mark: success
radix-vue :white_check_mark: success :white_check_mark: success
router :white_check_mark: success :white_check_mark: success
test-utils :white_check_mark: success :white_check_mark: success
vant :white_check_mark: success :white_check_mark: success
vite-plugin-vue :white_check_mark: success :white_check_mark: success
vitepress :white_check_mark: success :white_check_mark: success
vue-i18n :white_check_mark: success :white_check_mark: success
vue-macros :x: failure :x: failure
vuetify :white_check_mark: success :white_check_mark: success
vueuse :x: failure :white_check_mark: success
vue-simple-compiler :white_check_mark: success :white_check_mark: success
edison1105 commented 1 week ago

/ecosystem-ci run

vue-bot commented 1 week ago

📝 Ran ecosystem CI: Open

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