Skip to content

Conversation

@KazariEX
Copy link
Member

@KazariEX KazariEX commented Oct 27, 2024

re-fix #12095

Expose IsShallowReactive to allow type inference in language tools.

In non-strict mode, undefined extends ShallowRef<infer V, unknown> will be inferred as true, causing UnwrapRef<undefined> to be inferred as unknown. Fix it here by the way.

@github-actions
Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38 kB 34.2 kB
vue.global.prod.js 159 kB 57.9 kB 51.4 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.9 kB 18.3 kB 16.7 kB
createApp 55 kB 21.3 kB 19.4 kB
createSSRApp 59 kB 23 kB 20.9 kB
defineCustomElement 59.8 kB 22.8 kB 20.8 kB
overall 68.7 kB 26.3 kB 24 kB

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 27, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-ssr

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

@vue/compiler-sfc

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 3561e57

@KazariEX KazariEX changed the title fix(types): should wrap the original type with Reactive in DistributeRef fix(types): should wrap the original type with UnwrapNestedRefs in DistributeRef Oct 27, 2024
@edison1105 edison1105 added ready to merge The PR is ready to be merged. scope: types labels Oct 28, 2024
@KazariEX KazariEX changed the title fix(types): should wrap the original type with UnwrapNestedRefs in DistributeRef fix(types): should wrap the top level setup refs with ShallowReactive in DistributeRef Oct 30, 2024
@KazariEX KazariEX changed the title fix(types): should wrap the top level setup refs with ShallowReactive in DistributeRef fix(types): should wrap the top level setup refs with ShallowReactive Oct 30, 2024
@vuejs vuejs deleted a comment from vue-bot Oct 30, 2024
@vuejs vuejs deleted a comment from vue-bot Oct 30, 2024
@vuejs vuejs deleted a comment from vue-bot Oct 30, 2024
@vuejs vuejs deleted a comment from vue-bot Oct 30, 2024
@vuejs vuejs deleted a comment from vue-bot Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge The PR is ready to be merged. scope: types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComputedRef and v-for typescript type inference

2 participants