-
Notifications
You must be signed in to change notification settings - Fork 270
Make Typekit cahces use Program and Weakmap #6911
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
base: main
Are you sure you want to change the base?
Conversation
All changed packages have been documented.
|
@@ -172,6 +173,7 @@ defineKit<TypekitExtension>({ | |||
return getEffectiveModelType(this.program, model, filter); | |||
}, | |||
getSpreadType(model) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very confused by the purpose of this typekit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I recall correctly this was so that you can know from a model Foo if what type is spread within it.
model Bar {
value: int32;
}
model Foo {
...Bar;
name: string;
}
getSpreadType(Foo) -> Bar
If there is a better way to do this, I'm happy to switch. I think this was useful in the AdditionalProperties scenario
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean if it was that I would kinda understand but here it just seems to be creating a new record/array model with the same indexer which is not doing what you describe(as far as I understand it).
For resolving the list of models spread you can just check the sourceModels
property not sure we need a typekit for that.
You can try these changes here
|
Some tests were having issues in which caches were keeping information from previous programs. Switching to WeakMap and adding a map layer on program.