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(types/ref): correct type inference for nested refs #11536

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

jh-leong
Copy link
Member

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

close #11532

Copy link

github-actions bot commented Aug 7, 2024

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
Copy link
Member Author

jh-leong commented Aug 7, 2024

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Aug 7, 2024

📝 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
Copy link
Member Author

jh-leong commented Aug 7, 2024

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Aug 7, 2024

📝 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
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
Member

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

@yyx990803 yyx990803 merged commit 536f623 into vuejs:main Aug 7, 2024
11 checks passed
@jh-leong jh-leong deleted the fix/11532 branch August 7, 2024 03:27
yyx990803 added a commit that referenced this pull request Aug 7, 2024
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