Open MantisClone opened 1 year ago
If we (@skiv and I) were to rebuild this system from scratch, we would write it in a functional style, with less OOP and inheritance. We believe a functional style would lend itself to automated static analysis and tree-shaking. But we've already got a system that uses OOP and inheritance, so we're choosing to double down and make it manually composable via dependency injection so that the user chooses the packages that fit their use case.
Problem
Request Network uses config variables at runtime. This means that the package MUST contain code to support all possible configurations even if they're not used.
Proposed Solution
Use dependency injection to empower the user to select the features and dependencies they want. This will involve API BREAKING CHANGES and refactoring package boundaries.
Definition of Done
This issue is an EPIC that encompasses the following subtasks:
request-client.js
to makeepk-signature
depencency injectable (likeweb3-signature
). Unclear why this dependency exists.Example
In the following code snippet, notice that the currencyManager, chains, and balanceDetectors are all injected.
Reference