Add OptIn mode for source generator#1861
Merged
manodasanW merged 23 commits intomasterfrom Nov 8, 2024
Merged
Conversation
…ault based on project
Sergio0694
reviewed
Nov 4, 2024
Member
Sergio0694
left a comment
There was a problem hiding this comment.
Did a first pass (haven't tested it yet), but looks good so far! 🙂
Co-authored-by: Sergio Pedri <sergio0694@live.com>
…CsWinRT into manodasanw/optinMode2
This was referenced Nov 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds a couple new modes for the source generator. The source generator can now either run in
Automode which eventually would be a build task or inOptInmode. By default, in the default mode of true, in WinUI / UWP scenarios, it would run inAutomode. Whereas in the other scenarios, it would run inOptInmode. This allows to address the feedback where it was source generating vtables in scenarios where it is probably not needed. To enable theOptInmode, theGeneratedWinRTExposedTypeand theGeneratedWinRTExposedExternalTypeattributes are added which allows to generate the vtables based on the use of the attributes. These attributes are added only for the .NET 8 and later versions given the upcoming .NET 6 EOL.Contributes to #1814