Skip to content

fix: adds support for nested groups #8

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

phenax
Copy link
Owner

@phenax phenax commented Apr 16, 2022

WIP. Will need to re-write the parser to work better with nested groups without nesting the types to its limits

Copy link

@codeit-ninja codeit-ninja left a comment

Choose a reason for hiding this comment

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

See my comment in the reviewed file, thank you.

@@ -1,10 +1,8 @@
{
"compilerOptions": {

Choose a reason for hiding this comment

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

Why are these lines removed? Could you explain what the reason is behind it without me having to figure it out on my own? Thank you :)

@codeit-ninja
Copy link

codeit-ninja commented Oct 13, 2022

Can we merge this after review please? This is a very good addition .. This also closes both the issues as they seem to relate to what the author of this PR fixed.

Edit:
I just see that you are actualy the author of this package ^^

Why is this PR not merged yet? Maybe issues that need to be resolved?

@phenax
Copy link
Owner Author

phenax commented Oct 13, 2022

@codeit-ninja Unfortunately, this hits the limit of what typescript can handle in terms of nested types. Will need to look into flattening some of the structures there but it's a little complicated to get right.

@codeit-ninja
Copy link

codeit-ninja commented Oct 13, 2022

@phenax It seems to work correctly in my project, I dont hit any limitations?

It correctly shows optional groups, in the picture id is marked as optional, in the typed result I correctly see id as string | undefined.

image

@phenax
Copy link
Owner Author

phenax commented Oct 13, 2022

@codeit-ninja it works for some expressions but there are a lot of cases where ts errors out
part-2022_10_13_23_24_09

@codeit-ninja
Copy link

codeit-ninja commented Oct 13, 2022

@phenax Thats odd, I dont get this warning/error

image

What TS version are you using? I am on 4.5.4. Some people have this error appearently only on TS versions <4 see https://stackoverflow.com/questions/70545982/why-am-i-getting-type-instantiation-is-excessively-deep-and-possibly-infinite

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