dev-rel icon indicating copy to clipboard operation
dev-rel copied to clipboard

Make type/dep discovery, and use, easier

Open jzaki opened this issue 10 months ago • 2 comments

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:

  1. Trace through and copy existing code use statements and corresponding Nargo.toml [dependencies], or,
  2. Find/navigate definitions from the monorepo source
  3. ~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

jzaki avatar Apr 15 '24 18:04 jzaki