Replies: 4 comments 13 replies
-
That's interesting. How would the remappings and the recursive submodules work? For example in our Is there going to affect in any way the installation speed? |
Beta Was this translation helpful? Give feedback.
-
@andreivladbrg could you explore the possibility of ditching submodules in favor of Node.js dependencies? |
Beta Was this translation helpful? Give feedback.
-
ContextUsing git submodules has started to be a pain in the ass because of the installation times. I've been working on this, and it's a more complex idea than expected. The installation process for External projects can be either foundry or hardhat based. I am not considering brownie here. FoundryIf the external project is foundry-based, it can be installed via:
Any of these versions would require the project to add the following to their remappings file: @openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@prb/math/=node_modules/@prb/math/ Third party dependenciesBy third-party dependencies, I mean the dependencies of the package that's being installed. For 1. no additional installation is required because it will install its dependencies in The json file would look like this: "dependencies": {
"@sablier/v2-core": "x.y.z",
} For 2. and 3. they would also need to manually install The json file would look like this: "dependencies": {
"@openzeppelin/contracts": "x.y.z",
"@prb/math": "x.y.z",
"@sablier/v2-core": "x.y.z",
} Import and usage: import { ISablierV2Lockup } from "@sablier/v2-core/src/interfaces/ISablierV2Lockup.sol";
import { Broker, LockupDynamic, LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; HardhatIf the external project is hardhat-based, it can be installed via:
No other remappings configuration is required. Third-party dependenciesThe same as foundry's 1 and 2. Import and usage: import { ISablierV2Lockup } from "@sablier/v2-core/src/interfaces/ISablierV2Lockup.sol";
import { Broker, LockupDynamic, LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; QuestionShould we "force" our integrators that use Given the requirement of manually installing third-party dependencies for ConclusionsIn case I am not missing something, it's possible to completely switch to NPM packages from git submodules, and in my opinion, it looks like the correct decision. What do you think? |
Beta Was this translation helpful? Give feedback.
-
Closing as we have implemented this proposal in #734. |
Beta Was this translation helpful? Give feedback.
-
See my discussion with Drake Evans on Twitter:
https://twitter.com/DrakeEvansV1/status/1659612843849793573
Beta Was this translation helpful? Give feedback.
All reactions