-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Ignore Dynamic Resource Opt out Preferences #10794
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
Conversation
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.
Pull Request Overview
This PR enforces the use of the dynamic resource optimization code path regardless of the developer’s opt-out setting. The changes modify several conditionals to always bypass the opt-out branch and update the default switch value accordingly.
- In ResourceReferenceExpression.cs, the removal code is now wrapped in an unreachable "if (false)" block with appropriate pragmas.
- In ResourceDictionary.cs, similar modifications are applied to disable the opt-out logic across multiple methods.
- In AppContextDefaultValues.cs, the default value of the DisableDynamicResourceOptimization switch is changed from true to false.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ResourceReferenceExpression.cs | Replaced the conditional opt-out check with an unreachable branch using pragmas. |
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ResourceDictionary.cs | Applied the unreachable branch pattern in multiple resource-related methods to enforce optimizations. |
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/AppContextDefaultValues.cs | Updated the default value of the dynamic resource optimization switch. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10794 +/- ##
===================================================
+ Coverage 13.47139% 13.53328% +0.06189%
===================================================
Files 3317 3317
Lines 665596 665537 -59
Branches 74679 74666 -13
===================================================
+ Hits 89665 90069 +404
+ Misses 573326 572870 -456
+ Partials 2605 2598 -7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
/backport to release/10.0-preview4 |
Started backporting to release/10.0-preview4: https://github.com/dotnet/wpf/actions/runs/14591755428 |
@harshit7962 backporting to "release/10.0-preview4" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Ignore DR Optimization preferences
.git/rebase-apply/patch:55: trailing whitespace.
.git/rebase-apply/patch:68: trailing whitespace.
.git/rebase-apply/patch:89: trailing whitespace.
.git/rebase-apply/patch:225: trailing whitespace.
warning: 4 lines add whitespace errors.
Using index info to reconstruct a base tree...
M src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ResourceDictionary.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ResourceDictionary.cs
CONFLICT (content): Merge conflict in src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ResourceDictionary.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Ignore DR Optimization preferences
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
Description
The changes here are intended to disregard developers' preferences regarding the
DisableDynamicResourceOptimization
switch. Regardless of the value set for this app context switch, the goal is to execute the code path that includes the recent optimizations introduced in #10532. This is because the optimizations will be part of the preview release, and our aim is to gather as many hits as possible.cc:/ @batzen
Regression
None
Testing
Local Build Pass
Risk
By enforcing the execution of the optimized code path, we might encounter unforeseen issues that could have been mitigated using the switch. However, collecting such issues is beneficial to refine the optimizations before the final release, if needed.
Microsoft Reviewers: Open in CodeFlow