Refactor for cases when `.rs` needs to influence `.toml`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- build-system
Research direction
Search the codebase for crate.addDependency and inspect the Module definition, LRO generation, and places that pre-emptively add dependencies. Compare the proposed dependency contract with the possible use.addDependency() approach before choosing a design. Done means applying the chosen approach to LRO and all similar dependency-generation sites so .rs generation can determine the required .toml dependencies.
Written by the indexing model from the issue text.
Description
In #745, we moved writing .toml to disk after generating the .rs files. Which works, but it is not the clearest design possible.
We have discussed a few ideas offline, how can refactor it to be better:
Joel: "maybe instead of method(s) taking a crate parameter, we return any dependencies to be added in the Module definition. This formalizes the contract instead of passing crate which might get mutated and you need to know to emit Cargo.toml last"
Anton: "do you think it is a good idea to maybe expand Use to also take care of this? I.e. something like use.addDepencency()?"
Joel: "interesting idea. there is a relationship of sorts there."
If it looks good, we add use.AddDepencency(), use it in LRO, and also update all other places in the similar manner to add their dependencies as needed, i.e. search the code for crate.addDependency and move the logic from the places where we pre-emptively add a dependency ("if crate has clients") to places that need them (i.e. when we generate code for client, call use.addDependency()).
- Dominant language
- Rust
- Stars
- 7
- Forks
- 11
- Avg merge
- 14h 15m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/typespec-rust
-
CodeGen rust
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/typespec-rust#959 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Azure/typespec-rust#1032 ·
-
CodeGen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/typespec-rust#1029 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Azure/typespec-rust#1028 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Azure/typespec-rust#1020 ·
All issues in Azure/typespec-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug team:backend track:services-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cowprotocol/services#4950 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·