-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source generated sample registration #22
Source generated sample registration #22
Conversation
UWP compile issue: MainPage.xaml.cs:77 selectedMetadata.Type wasn't updated to SampleControlType? Should be: var controlInstance = Activator.CreateInstance(selectedMetadata.SampleControlType); In CommunityToolkit.Labs.Uwp. didn't see file changed in PR so I couldn't make a suggestion. Otherwise, I think this is pretty cool, and I think good to go! Assuming this is Source Generator V2 vs V1? I also know you wanted @Sergio0694 to take a quick look too for his input as the Source Generator ninja... 😋 |
@michael-hawker Good catch, looks like merged code that didn't get updated. Build validation would be nice here haha. @Sergio0694 Any feedback at all? I could probably make the source generator incremental but this is a pretty slim generator. |
@Arlodotexe I know the main thing with the original source generators is that it doesn't matter if it doesn't do a lot of work if the solution/project is large enough it's still trying to run it on everything all the time. But maybe we won't have a big problem in Labs? |
I had an incremental version at one point, but it was difficult to debug so I swapped to the regular ones. Code should be clean enough to make switching pretty painless if we start seeing issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generator seems fine for what it needs to do, other than it not being incremental. Left a few notes here and there with some questions, but overall it looks ok at least for now. Note for the future, please consider documenting your code better 😅
Common/CommunityToolkit.Labs.Core/CommunityToolkit.Labs.Core.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, just left another couple of nits 👍
…urce-generated-sample-registration Source generated sample registration
Overview
ToolkitSampleAttribute
and generates a method that returns metadata for all found.Functional example
With temporary second sample control added
Attributes
Generated code
Full circle