Move codegen from AssemblyProcessor into Roslyn based solution
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
I've had contact with AssemblyProcessor's codegen for data serializers on two occasions so far and while doable, moving around the code is not very intuitive and the codegen itself often quite fragile, because for the most part its involved in manual IL emit using Mono.Cecil data structures.
The current setup is working well for a lot of cases, but more and more we can find edge cases (especially with generic types) that will require modifications to the how code is generated. It's likely that the complexity of this tool will only increase, the way it's written now, and increase the modification (and debugging) costs even further.
As such I'm proposing to look into alternative approaches like the source generators. This issue will be used for tracking ideas and bottlenecks related to migrating. One of the main things is that we need to be able to come up with a black box design description of the current codegen setup.
The processors to consider for migration:
- AssemblyScanProcessor
- SerializationProcessor
- ModuleInitializerProcessor
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.
Research direction
Start by mapping the current behavior of AssemblyScanProcessor, SerializationProcessor, and ModuleInitializerProcessor, including their Mono.Cecil-based code generation. Read the linked Roslyn source-generators material and produce a black-box design description that identifies migration bottlenecks and edge cases, especially around generic types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- compilers, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100