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): handle keyof operator with indexed object #11581

Merged

Conversation

Disservin
Copy link
Contributor

fixes #11580

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.2 kB 34.6 kB 31.2 kB
vue.global.prod.js 147 kB 54.1 kB 48.1 kB

Usages

Name Size Gzip Brotli
createApp 49.7 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.2 kB 24.5 kB 22.3 kB

@Disservin
Copy link
Contributor Author

Vue doesn't support the case where the prop key is a symbol, so I didn't bother fixing the current logic which will return String in this case
i.e

const sym = Symbol('uniqueKey');

const props = defineProps<{
  [sym]: string;
}>()

Error: [@vue/compiler-sfc] Unsupported computed key in type referenced by a macro

@Disservin Disservin changed the title fix(compiler-sfc): handle keyof operator with index object fix(compiler-sfc): handle keyof operator with indexed object Aug 11, 2024
@edison1105 edison1105 added 🐞 bug Something isn't working ready to merge The PR is ready to be merged. scope: sfc ready for review This PR requires more reviews and removed ready to merge The PR is ready to be merged. labels Aug 12, 2024
@yyx990803 yyx990803 merged commit fe00815 into vuejs:main Aug 15, 2024
11 checks passed
@Disservin Disservin deleted the fix-11580-runtime-prop-type-of-keyof-nested branch August 15, 2024 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working ready for review This PR requires more reviews scope: sfc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runtime prop type of keyof SomeInterface['property'] resolves to Object
3 participants