dev-rel
dev-rel copied to clipboard
Make type/dep discovery, and use, easier
tl;dr - add types (and maybe other crates) from noir-protocol-circuits
to docs. Either in its Reference section, or like this.
For devs to look up types, and where they're included from, they can:
- Trace through and copy existing code
use
statements and corresponding Nargo.toml[dependencies]
, or, - Find/navigate definitions from the monorepo source
- ~Look up an auto-generated doc reference~ (needed)
Point 1. is okay for copying examples, but not for understanding and context Point 2. the latter is not always clear given the location of different types, and needing to search the monorepo
Eg see ValueNote
:
Nargo.toml -
aztec = {
git="https://github.com/AztecProtocol/aztec-packages/",
tag="aztec-package-v0.33.0",
directory="noir-projects/aztec-nr/value-note"
}
main.nr - use dep::value_note::value_note::ValueNote;
Location - noir-projects/aztec-nr/value-note/src/value_note.nr
Compared to FunctionSelector
:
Nargo.toml -
aztec = {
git="https://github.com/AztecProtocol/aztec-packages/",
tag="aztec-package-v0.33.0",
directory="noir-projects/aztec-nr/aztec"
}
main.nr - use dep::aztec::protocol_types::abis::function_selector::FunctionSelector
Location - noir-projects/noir-protocol-circuits/crates/types/src/abis