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

Fix circular dependencies #164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NanezX
Copy link

@NanezX NanezX commented Feb 10, 2025

Hello @StefanTerdell, hope you are doing well.

First, this is a lot of work to maintain this package alone and it's great!

I saw that this issue #118 is being around a while without a fix, mainly because is not a critical error or something, but still pending.

Basically, we wanted to get rid of the warning logs for circular dependencies. At the moment, I didn't see any run time error while using it on super forms for svelte, but I wanted to remove the logs.

So, this is my contribution to this.

Changes:

  • Move types to a single file: the types used by the parseDef are now on single file. This way the parsers can import it without making a circular dependency.
  • Move the selectParser: the selectParser function to a single file. This require that the return strictly null if the selected parser is the parseDef. Then, inside parseDef, if the return is an strictly null (response === null), then we consider that as call to parseDef again.

These changes make possible to solve the circular dependency. Maybe it's not the pretty solution, but it was the easier in my opinion.

@NanezX NanezX mentioned this pull request Feb 10, 2025
@StefanTerdell
Copy link
Owner

This looks like a solid solution. I think I will have some time to test it this weekend. Stay tuned :)

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