Skip to content

fix(types/ref): correct type inference for nested refs#11536

Merged
yyx990803 merged 1 commit into
vuejs:mainfrom
jh-leong:fix/11532
Aug 7, 2024
Merged

fix(types/ref): correct type inference for nested refs#11536
yyx990803 merged 1 commit into
vuejs:mainfrom
jh-leong:fix/11532

Conversation

@jh-leong

@jh-leong jh-leong commented Aug 7, 2024

Copy link
Copy Markdown
Member

close #11532

@github-actions

github-actions Bot commented Aug 7, 2024

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.1 kB 34.6 kB 31.1 kB
vue.global.prod.js 147 kB 54 kB 48.1 kB

Usages

Name Size Gzip Brotli
createApp 49.6 kB 19.5 kB 17.8 kB
createSSRApp 53.2 kB 21 kB 19.1 kB
defineCustomElement 51.9 kB 20.2 kB 18.5 kB
overall 63.1 kB 24.5 kB 22.3 kB

@jh-leong

jh-leong commented Aug 7, 2024

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@vue-bot

vue-bot commented Aug 7, 2024

Copy link
Copy Markdown
Contributor

📝 Ran ecosystem CI: Open

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

@jh-leong jh-leong marked this pull request as draft August 7, 2024 01:56
@jh-leong

jh-leong commented Aug 7, 2024

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@vue-bot

vue-bot commented Aug 7, 2024

Copy link
Copy Markdown
Contributor

📝 Ran ecosystem CI: Open

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

@jh-leong jh-leong marked this pull request as ready for review August 7, 2024 02:13
@jh-leong jh-leong added scope: types 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Aug 7, 2024
@Alfred-Skyblue

Copy link
Copy Markdown
Member

Sorry, I didn't notice that you already submitted a PR. I just created #11537. I found that in your PR, you modified the type, but the issue causing #11532 is because when we set a value to a ref, it leads to this._value = ref(xxx), and we didn't unwrap it in the getter. So, this caused the problem in #11532.

@yyx990803

Copy link
Copy Markdown
Member

It's better to align the types with existing runtime behavior, since changing runtime behavior is actually breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A separate type for the setter in Ref<T, S> can lead to nested refs

4 participants