Skip to content
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

[Binding SG] Split bindings source generated code into multiple files #23116

Merged

Conversation

jkurdek
Copy link
Member

@jkurdek jkurdek commented Jun 18, 2024

Description of Change

This is a follow-up to #21725, contributes to #22384

This change generates each SetBinding in a separate file allowing for more granular caching.

FIXES

#23551

@jkurdek jkurdek requested a review from a team as a code owner June 18, 2024 13:25
@jkurdek jkurdek changed the title Split Bindings source generated code into multiple files Split bindings source generated code into multiple files Jun 18, 2024
simonrozsival
simonrozsival previously approved these changes Jun 18, 2024
@jonathanpeppers
Copy link
Member

FYI the changes here were part of:

But we lost them by accident during a rebase.

simonrozsival
simonrozsival previously approved these changes Jun 19, 2024
@PureWeen PureWeen added the area-xaml XAML, CSS, Triggers, Behaviors label Jun 20, 2024
@simonrozsival simonrozsival force-pushed the split-generated-code-into-multiple-files branch from bb77840 to 8ae059f Compare June 24, 2024 16:33
@simonrozsival simonrozsival dismissed stale reviews from StephaneDelcroix and themself via caad347 June 24, 2024 20:08
@simonrozsival simonrozsival force-pushed the split-generated-code-into-multiple-files branch from caad347 to 5c535d0 Compare June 25, 2024 10:49
@simonrozsival
Copy link
Member

simonrozsival commented Jun 25, 2024

There was a problem with the Essentials.Sample.Server.WebAuthenticator.csproj sample project - the Binding Source Generator was loaded from the .buildtasks directory, and it produced code even though the project didn't reference MAUI at all. I cannot reproduce this with the same project when it is outside of the MAUI repository.

I am not sure if this is due to a presence of Directory.Build.targets or some other implicit behavior of MSBuild, but I don't think this is an issue outside of the MAUI repository. I suppressed the analyzers with an MSBuild property in that particular project for now.

Alternatively, we can change the SG to only generate the common code if the project actually references Microsoft.Maui.Controls.dll. Feedback is welcome.

@simonrozsival simonrozsival changed the title Split bindings source generated code into multiple files [Binding SG] Split bindings source generated code into multiple files Jun 25, 2024
@simonrozsival simonrozsival enabled auto-merge (squash) July 2, 2024 16:52
@simonrozsival simonrozsival merged commit c564156 into dotnet:net9.0 Jul 2, 2024
48 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2024
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-xaml XAML, CSS, Triggers, Behaviors fixed-in-net9.0-nightly This may be available in a nightly release!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants