-
Notifications
You must be signed in to change notification settings - Fork 577
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
Avoid circular imports #6814
Avoid circular imports #6814
Conversation
fce8d21
to
0d2c58f
Compare
0d2c58f
to
cc651a3
Compare
@gagik I recognize these are a lot of changes, but most were pretty mechanical. I'd love to get this in soon-ish to avoid the codebase from diverging while I'm PTO 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import
s are much easier to read. And I like that you have isolated the collection accessors in separate files.
What, How & Why?
This closes #6565 by refactoring imports away from the "internal" pattern (which we introduced when we used Rollup to bundle into a single file) and introducing an
indirect
object which gets classes injected once they're initialized. This also untangles the recursively referencing collections accessors introduced with collections in mixed, into separate files.This also adds a dependency in the "madge" tool enabling a new script to check for circular imports:
Although this still fails with three cases of circular references 🤔 I need to decide how to deal with those before adding it as a command which is ran as part of our lint workflow on CI.
☑️ ToDos
Compatibility
label is updated or copied from previous entryCOMPATIBILITY.md
package.json
s (if updating internal packages)Breaking
label has been applied or is not necessary@realm/devdocs
if documentation changes are needed