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

Change Paths option maxRecursionDepth default value #1029

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Emiyaaaaa
Copy link
Collaborator

For performance improvements in most cases, I think we could reduce the default values of maxRecursionDepth

PS: In TypeScript, also have a similar function to determine whether a type is deeply-nested or not, that value is 5(reduced to 3 after [email protected])
image

@Emiyaaaaa Emiyaaaaa changed the title Change Paths option maxRecursionDepth default value. Change Paths option maxRecursionDepth default value Jan 2, 2025
@@ -53,7 +53,7 @@ export type PathsOptions = {
};

type DefaultPathsOptions = {
maxRecursionDepth: 10;
maxRecursionDepth: 5;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Emiyaaaaa This only affects cases where depth is greater than 5, right?
And this would also be a breaking change for cases where depth is greater than 5, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breaking change

yes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only affects cases where depth is greater than 5

yes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea, similar to what is mentioned in the description, is that when the depth recursion reaches a certain number (I think it can be 5), it can be assumed that the user input type is an infinite nested type and we can stop the recursion early, the previous 10 is ts maximum limit of recursion for our implementation code

If that's okay, I need to figure out how to explain the a option in the comments.

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.

2 participants