Add use of dependent source generator to the Readme (#318)#325
Add use of dependent source generator to the Readme (#318)#325glennawatson merged 1 commit intoreactiveui:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds documentation to the README explaining how to use ReactiveUI.SourceGenerators alongside other source generators, specifically addressing the System.Text.Json source generator compatibility issue discussed in #318.
- Explains Roslyn source generator limitations regarding inter-dependencies and execution order
- Provides a workaround by recommending separate assemblies for dependent source generators
- Clarifies that attributes emitted by one generator aren't visible to others in the same compilation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| so adding `[JsonPropertyName]`/`[JsonInclude]` from `ReactiveUI.SourceGenerators` won’t cause the `System.Text.Json` | ||
| source generator to pick them up in that project. That’s by design of the generator pipeline (no inter-generator dependencies / ordering). | ||
|
|
||
| So `System.Text.Json` needs special care. In the case that you want to Json-serialize `[Reactive]` |
There was a problem hiding this comment.
Corrected spelling of 'Json-serialize' to 'JSON-serialize' for consistency with standard JSON abbreviation capitalization.
| So `System.Text.Json` needs special care. In the case that you want to Json-serialize `[Reactive]` | |
| So `System.Text.Json` needs special care. In the case that you want to JSON-serialize `[Reactive]` |
|
Cool thanks. I'm sure this will help people out. The interdependent source generator thing has tripped me up in the past so it'll help people out |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What kind of change does this PR introduce?
This is a small update to the Readme, based on the discussion System.Text.Json-attribute support #318 concerning how to use ReactiveUI.SourceGenerators with other source generators, specifically System.Text.Json.
What is the current behavior?
There is no mention of this little caveat, possibly causing confusion and increased support work load for the maintainers.
What is the new behavior?
A brief section explaining the background of Roslyn source generator limitations concerning inter-dependencies, and short explanation of how to work around this by placing the dependency source generator in a separate assembly.
What might this PR break?
It's just text in the Readme, so it's unlikely to break anything.
Please check if the PR fulfills these requirements
Other information: N/A