feat(ct): vue2 plugins#18596
Merged
pavelfeldman merged 2 commits intomicrosoft:mainfrom Dec 19, 2022
Merged
Conversation
f2276e7 to
0eeea66
Compare
pavelfeldman
approved these changes
Nov 8, 2022
| type JsonValue = JsonPrimitive | JsonObject | JsonArray; | ||
| type JsonArray = JsonValue[]; | ||
| type JsonObject = { [Key in string]?: JsonValue }; | ||
| type VueOptions = ComponentOptions<Vue> & { router?: unknown, store?: unknown, [key: string]: unknown }; |
Member
There was a problem hiding this comment.
Why do we special-case router?: unknown, store?: unknown, [key: string]: unknown here?
Contributor
Author
There was a problem hiding this comment.
I changed it to & Record<string, unknown> otherwise the type error below is thrown. This is also to support:
new Vue({
test: 'test', // it is possible to pass any key when creating the Vue object
router,
render: h => h(App),
}).$mount('#app');playwright/index.ts:10:26 - error TS2345: Argument of type '({ Vue, hooksConfig }: { hooksConfig: HooksConfig; Vue: VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<...>, never, never, ...>>>; }) => Promise<...>' is not assignable to parameter of type '(params: { hooksConfig: HooksConfig; Vue: VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<...>, never, never, ...>>>; }) => Promise<...>'.
Type 'Promise<{ test: string; }>' is not assignable to type 'Promise<void | ComponentOptions<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>, ... 7 more ..., ComponentOptionsMixin>>'.
Type '{ test: string; }' is not assignable to type 'void | ComponentOptions<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>, ... 7 more ..., ComponentOptionsMixin>'.
10 beforeMount<HooksConfig>(async ({ Vue, hooksConfig }) => {cf98953 to
243a194
Compare
243a194 to
2fd6b64
Compare
6 tasks
2fd6b64 to
be24c1c
Compare
Contributor
|
@sand4rt Looks like you have a failing build — might be a flake though. Do you mind re-running? |
be24c1c to
06a1f0d
Compare
Contributor
Author
|
@pastelsky I don't think it is related to my changes, but sure |
Contributor
|
I know — was probably flake. Just giving it a gentle nudge since this seems like a pre-req for #18616 |
pavelfeldman
approved these changes
Dec 19, 2022
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.
There is no support for Vue2 plugins (probably because there was no test yet describing/documenting this behaviour) and did some minor refactoring.