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
Use file-relative paths instead of project-relative #10202
Comments
Can you give a reproducible case that shows this error? Imports using this style are part of our style guide. They make refactoring much easier internally to the project. Perhaps we could raise this as an issue with remix? |
Yeah, I can submit a foundry repo and a remix project example. IMO, that's a weird style guide recommendation, as the file is only refactored once. Every importer pays the price of translating project-relative includes. For example, all OpenZeppelin and forge-std includes are file-relative. |
https://github.com/adraffy/optimism-project-relative-issue/blob/main/src/Contract.sol
|
Thank you for the repro case |
You can use the following one-liner to repro in Remix:
This will correctly import via NPM then fail with with: |
I see, so relative paths are going to be more portable. I am curious if the following comment helps for the foundry case: foundry-rs/foundry#3440 (comment) |
Is your feature request related to a problem? Please describe.
These project relative paths:
optimism/packages/contracts-bedrock/src/libraries/Encoding.sol
Line 4 in a4c47fe
Describe the solution you'd like
Should be changed to file relative paths:
Additional context
For example, these files cannot be used in Remix as the npm imports cannot disambiguate "src/"
This also causes issues with Foundry, where the same file is imported twice causing
T != T
errors.The text was updated successfully, but these errors were encountered: