feat(language-core): typed fallthrough attributes#4103
Merged
johnsoncodehk merged 19 commits intovuejs:masterfrom Aug 25, 2024
Merged
feat(language-core): typed fallthrough attributes#4103johnsoncodehk merged 19 commits intovuejs:masterfrom
johnsoncodehk merged 19 commits intovuejs:masterfrom
Conversation
Member
Author
|
I have no idea about #2472 💦 |
d0abf57 to
aab3a8a
Compare
31e60a3 to
b7fdfc3
Compare
ef46670 to
19b0a8b
Compare
c6cab9a to
ab8df96
Compare
This was referenced Aug 16, 2024
|
commit: vue-component-meta
vue-component-type-helpers
@vue/language-core
@vue/language-plugin-pug
@vue/language-server
@vue/language-service
vue-tsc
@vue/typescript-plugin
|
Member
Member
|
Since this feature would significantly impact type checking speed, this feature was changed in ebb8490 to require |
Member
|
This is a minimal reproduction of the case of slow tsc when import { defineComponent } from 'vue';
const Foo = defineComponent({
props: {} as __VLS_TypePropsToOption<{ bar?: string }>,
});
const Bar = defineComponent({
props: {} as __VLS_TypePropsToOption<FooAttrs>,
});
defineComponent({
setup() {
return {};
},
props: {} as __VLS_TypePropsToOption<BarAttrs>,
});
type FooAttrs = __VLS_OmitIndexSignature<Partial<InstanceType<typeof Foo>['$props']>>;
type BarAttrs = __VLS_OmitIndexSignature<Partial<InstanceType<typeof Bar>['$props']>>;
type __VLS_TypePropsToOption<T> = {
[K in keyof T]-?: {} extends Pick<T, K>
? { type: import('vue').PropType<T[K]> }
: { type: import('vue').PropType<T[K]>, required: true }
};
type __VLS_OmitIndexSignature<T> = { [K in keyof T as {} extends Record<K, unknown> ? never : K]: T[K]; }; |
|
Just a question: it seems that when having |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #4049. close #4699.
Should add
Co-authored-by: A5rocks <git@helvetica.moe>as a co-authorEDIT: This now requires adding an option
fallthroughAttributestovueCompilerOptions.