microsoft / microsoft/typespec
make defineTypekit resilient to multiple version loaded
Open
compiler:core
design:needed
triaged:core
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Problem is righht now we define the typekit prototype as
```ts
export const TypekitPrototype: Record = {};
```
This object of course would be different if a different version of the `@typespec/compiler` is loaded and the typekits would get registered separately causing errors.
## Solution
1. Check how vitest deals with the custom matchers https://vitest.dev/guide/extending-matchers and see if they do handle this case(might not)
2. A solution we can do is replace `{}` with a `globalThis[Symbol.for('TypeSpec.TypeKitProto')]`
Contributor guide
Assessment
This issue has not been assessed yet.