microsoft / microsoft/typespec

make defineTypekit resilient to multiple version loaded

Open
#8,041 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.