-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[EPIC]: numerous "modules cycles", AKA circular dependencies #22450
Comments
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions. |
Describe the bug
Probably more a of a bug lurking, since circular dependencies make code fragile.
Node.js doc state:
https://nodejs.org/api/modules.html#modules_cycles
In the branch I'm testing, there are at least 30 module cycles in the extension codebase.
To get an initial list run
npx madge --circular --extensions ts,js ./
at the root of the repo.Beyond the dangers of hidden/waiting bugs, the cycles prevent HMR (hot module reloading) and React Refresh from working. This issue is likely contributing to longer load times for users and longer extension build times for devs.
@brad-decker suggests, and I agree, that the cycles may also prevent tree-shaking and dead code removal from working fully.
Expected behavior
No response
Screenshots/Recordings
No response
Steps to reproduce
Run
npx madge --circular --extensions ts,js ./
at the root of the repo.Error messages or log output
No response
Version
Build type
Other (please specify exactly where you obtained this build in "Additional Context" section)
Browser
Other (please elaborate in the "Additional Context" section)
Operating system
Other (please elaborate in the "Additional Context" section)
Hardware wallet
No response
Additional context
No response
Severity
This affects everyone, including users (from the extension's size to load time to unknown/lurking bugs) and devs building MetaMask (as they can't use HMR).
It is tech debt and the bill is overdue.
The text was updated successfully, but these errors were encountered: