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(compiler-sfc): infer TS Extract&Exclude runtime type #7339

Merged
merged 2 commits into from Mar 28, 2023
Merged

fix(compiler-sfc): infer TS Extract&Exclude runtime type #7339

merged 2 commits into from Mar 28, 2023

Conversation

sxzz
Copy link
Member

@sxzz sxzz commented Dec 13, 2022

closes #7337
closes #6252

@netlify
Copy link

netlify bot commented Dec 13, 2022

Deploy Preview for vuejs-coverage failed.

Name Link
🔨 Latest commit c7fd75a
🔍 Latest deploy log https://app.netlify.com/sites/vuejs-coverage/deploys/63d2b1157cc13c00084e628f

@netlify
Copy link

netlify bot commented Dec 13, 2022

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 8dc7722
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/6398adcaa4ac130008535755

@netlify
Copy link

netlify bot commented Dec 13, 2022

Deploy Preview for vue-next-template-explorer failed.

Name Link
🔨 Latest commit 8dc7722
🔍 Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/6398adca149f7d0008d07c78

@LinusBorg LinusBorg added the ready to merge The PR is ready to be merged. label Jan 9, 2023
@sodatea
Copy link
Member

sodatea commented Feb 10, 2023

/ecosystem-ci run

@vue-bot
Copy link

vue-bot commented Feb 10, 2023

📝 Ran ecosystem CI: Open

suite result
nuxt ❌ failure
pinia ✅ success
router ✅ success
test-utils ❌ failure
vite-plugin-vue ✅ success
vitepress ✅ success

sxzz added a commit to vue-macros/vue-macros that referenced this pull request Feb 23, 2023
}
return ['null']
case 'Exclude':
if (node.typeParameters && node.typeParameters.params[0]) {
Copy link
Member

@yyx990803 yyx990803 Mar 28, 2023

Choose a reason for hiding this comment

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

Note: this will result in a wider type than it should in the case of Exclude<string | number, string>, however performing the correct analysis for all possible cases is impossible without relying on actual TS inference, so the best we can do is to infer a wider type for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's unlikely to be able to figure out the exact type unless we're using the TS compiler.

@yyx990803 yyx990803 merged commit 6391daf into vuejs:main Mar 28, 2023
9 checks passed
@sxzz sxzz deleted the fix/infer-ts-type branch March 28, 2023 10:52
IAmSSH pushed a commit to IAmSSH/core that referenced this pull request May 14, 2023
topsmart20 added a commit to topsmart20/vue-macros that referenced this pull request Dec 9, 2023
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.
Projects
None yet
5 participants