Skip to content
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

types(schema): avoid circular constraint in TSchemaOptions with --incremental by deferring ResolveSchemaOptions<> #13291

Merged
merged 1 commit into from Apr 18, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13129

Summary

Looks like the Omit<> trick we did to avoid TS complaining about circular constraints doesn't work if you set the incremental option in TypeScript 4.9+. With this change TSchemaOptions no longer references itself, so no more circular constraints. We just wrap TSchemaOptions in ResolveSchemaOptions whenever we use it in the schema class.

I wish there was some reasonable way to test this, but the issue doesn't seem to show up in tsd, so our only option would be to manually run a particular version of tsc with --incremental on a script. And I don't think that's necessary, seems easy enough to eyeball that this particular change removes the circular constraint.

Examples

…remental by deferring `ResolveSchemaOptions<>`

Fix #13129
@vkarpov15 vkarpov15 merged commit e411825 into master Apr 18, 2023
3 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-13129 branch April 18, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

circular constraint issue
2 participants