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(runtime-core): type ExposedKeys removed defined properties on com… #12697

Closed
wants to merge 5 commits into from

Conversation

akotulu
Copy link

@akotulu akotulu commented Jan 13, 2025

Fixes typo made in pull request #3399.

IDEs using Vue language service with TypeScript support will have all the local component variables displayed as red with an error Vue: X does not exist on type. ExposedKeys will compare empty string ('') to extend Exposed type which will always fail cause builtin string can't extend custom class.

Tested with:
PHPStrom 2024.3.1.1
TypeScript 5.7.3
Vue LS 2.2.0

@jh-leong
Copy link
Member

This change will break the existing test case in packages-private/dts-test/defineComponent.test-d.tsx. You can verify this by running pnpm run test-dts.

By the way, could you provide a test case or a minimal reproduction to clarify the issue this PR is addressing? Thanks!

Copy link

github-actions bot commented Jan 13, 2025

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38 kB 34.3 kB
vue.global.prod.js 158 kB 57.8 kB 51.5 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.4 kB 18.2 kB 16.6 kB
createApp 54.3 kB 21.2 kB 19.3 kB
createSSRApp 58.5 kB 22.9 kB 20.9 kB
defineCustomElement 59.2 kB 22.8 kB 20.7 kB
overall 68.4 kB 26.3 kB 24 kB

Copy link

pkg-pr-new bot commented Jan 13, 2025

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-ssr

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

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12697

@vue/compiler-sfc

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

npm i https://pkg.pr.new/vue@12697

@vue/compat

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

commit: 980cd03

@edison1105 edison1105 added the need more info Further information is requested label Jan 14, 2025
@DC240
Copy link

DC240 commented Jan 14, 2025

This change will break the existing test case in packages-private/dts-test/defineComponent.test-d.tsx. You can verify this by running pnpm run test-dts.

By the way, could you provide a test case or a minimal reproduction to clarify the issue this PR is addressing? Thanks!

I can confirm this issue using Webstorm LTS 2024.2.5 Build #WS-242.24807.6
I created a reproduction repo: https://github.com/DC240/12697-runtime-core-error-reproduction

Screenshot 2025-01-14 at 10 40 52

It is however, only the case if I'm using class based components using vue-facing-decorator. Using the composition API, the component resolves correctly. We have a lot of older projects at our company for which there is no budget to convert them to composition API, so for us it is a pretty common and annoying problem.

Screenshot 2025-01-14 at 10 46 03

@akotulu
Copy link
Author

akotulu commented Jan 14, 2025

It took whole weekend to figure out where this issue with Intellij ideas came from. I will look at the tests when I have time again. Probably end of the week.

@DC240
Copy link

DC240 commented Jan 20, 2025

It took whole weekend to figure out where this issue with Intellij ideas came from. I will look at the tests when I have time again. Probably end of the week.

Do you have any updates on this by any chance?

@edison1105 edison1105 added wait changes and removed need more info Further information is requested labels Jan 21, 2025
@akotulu
Copy link
Author

akotulu commented Jan 22, 2025

Fixed the test.

Copy link

netlify bot commented Feb 6, 2025

Deploy Preview for vue-next-template-explorer failed. Why did it fail? →

Name Link
🔨 Latest commit d106429
🔍 Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/67a47957cdb889000811536d


// @ts-expect-error shouldn't be exposed
vm.c
vm.a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is not proper, both a and b should be exposed, see line 1618.

@akotulu
Copy link
Author

akotulu commented Feb 6, 2025

Trying to reproduce the issue weeks later fails with or without the modification. Language server doesn't display the errors anymore. There hasn't been any PHPStorm update, kinda of magic what is going on. Also thanks for pointing out the test was invalid, should have read the docks more carefully beforehand.

@akotulu akotulu closed this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants