core icon indicating copy to clipboard operation
core copied to clipboard

types(reactivity): optimize the display type of ref

Open yangliguo7 opened this issue 1 year ago • 5 comments

fix #11969

optimize the ref type to better display types in its ide

yangliguo7 avatar Sep 23 '24 06:09 yangliguo7

@yangliguo7 Could you please add a test case for this?

edison1105 avatar Sep 23 '24 09:09 edison1105

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@12005
@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@12005
@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@12005
@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@12005
@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12005
@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@12005
@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@12005
@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@12005
@vue/shared

npm i https://pkg.pr.new/@vue/shared@12005
vue

npm i https://pkg.pr.new/vue@12005
@vue/compat

npm i https://pkg.pr.new/@vue/compat@12005

commit: dafd7dd

pkg-pr-new[bot] avatar Sep 23 '24 09:09 pkg-pr-new[bot]

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38.1 kB 34.3 kB
vue.global.prod.js 158 kB 58 kB 51.6 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.5 kB 18.2 kB 16.7 kB
createApp 54.5 kB 21.3 kB 19.5 kB
createSSRApp 58.7 kB 23 kB 21 kB
defineCustomElement 59.4 kB 22.9 kB 20.8 kB
overall 68.6 kB 26.4 kB 24 kB

github-actions[bot] avatar Sep 23 '24 09:09 github-actions[bot]

@edison1105 ok. i'll see to it

by the way. Is this change too simple to require adding tests?

yangliguo7 avatar Sep 23 '24 10:09 yangliguo7

Wouldn't TypedRef better than TypeRef considering the reason of this type to exist? I see it is exported, so, the name becomes part of the public API, right?

xak2000 avatar Sep 29 '24 19:09 xak2000

Also: is it really necessary to export the intermediate type? Would it work without an export?

All exported types become a part of public API, so the less exported types - the better.

xak2000 avatar Mar 17 '25 19:03 xak2000

/ecosystem-ci run

edison1105 avatar Mar 19 '25 09:03 edison1105

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools :x: failure :white_check_mark: success
pinia :x: failure :white_check_mark: success
nuxt :x: failure :white_check_mark: success
quasar :white_check_mark: success :white_check_mark: success
primevue :x: failure :white_check_mark: success
test-utils :white_check_mark: success :white_check_mark: success
vant :white_check_mark: success :white_check_mark: success
radix-vue :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-simple-compiler :white_check_mark: success :white_check_mark: success
router :white_check_mark: success :white_check_mark: success
vueuse :white_check_mark: success :white_check_mark: success
vuetify :white_check_mark: success :white_check_mark: success
vue-macros :white_check_mark: success :white_check_mark: success
vue-i18n :white_check_mark: success :white_check_mark: success

vue-bot avatar Mar 19 '25 09:03 vue-bot