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

feat(NODE-3875): support recursive schema types #3433

Merged
merged 12 commits into from
Oct 13, 2022

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Oct 4, 2022

Description

What is changing?

Adds a type check to limit recursion to 8 levels of depth. Mutually recursive types are now accepted and stop getting type checking / hinting after a certain depth.

What is the motivation for this change?

Mutually recursive types can be useful for modeling data

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken marked this pull request as ready for review October 5, 2022 16:38
@nbbeeken nbbeeken force-pushed the NODE-3875-type-recursion-fix branch 2 times, most recently from 4cc4b9d to 4656109 Compare October 6, 2022 20:12
@nbbeeken nbbeeken force-pushed the NODE-3875-type-recursion-fix branch from 4656109 to 914ec9d Compare October 6, 2022 20:15
test/types/basic_schema.test-d.ts Show resolved Hide resolved
test/types/union_schema.test-d.ts Show resolved Hide resolved
test/types/community/collection/updateX.test-d.ts Outdated Show resolved Hide resolved
test/types/community/collection/updateX.test-d.ts Outdated Show resolved Hide resolved
baileympearson
baileympearson previously approved these changes Oct 11, 2022
@baileympearson baileympearson added the Team Review Needs review from team label Oct 11, 2022
src/mongo_types.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from dariakp October 12, 2022 15:22
@nbbeeken nbbeeken requested a review from dariakp October 12, 2022 20:20
@dariakp dariakp merged commit 26bce4a into main Oct 13, 2022
@dariakp dariakp deleted the NODE-3875-type-recursion-fix branch October 13, 2022 15:19
ZLY201 pushed a commit to ZLY201/node-mongodb-native that referenced this pull request Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants