-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Change SystemInformation from static to regular class #3168
Change SystemInformation from static to regular class #3168
Conversation
Thanks vgromfeld for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
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.
This is GREAT! Thanks!
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.
Think we may just want to go the full path of providing the Singleton pattern ourselves no?
Also, we should make sure this is based off the dev/7.0.0 branch as it'd be a breaking change.
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
We need to merge master on 7.0. |
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/SystemInformation/SystemInformationPage.xaml.cs
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.
Why are radial gauge changes part of this PR?
@skendrot apparently our 7.0 branch is out of date, so I'm going to investigate this and hopefully once we update, this gets cleaned-up again. |
Alright, I updated the 7.0 branch, but I think there's still another change bleeding through? @azchohfi I'm not seeing the option on GitHub showing the PR branch is out of date and need to update again from the dev/7.0.0 branch? Maybe @vgromfeld needs to reset this manually? |
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.
Everything looks good except for the merge issues
@michael-hawker I will do a manual rebase on 7.0 branch to keep only my commits. Edit: Done |
58e9874
to
35c617d
Compare
Looks good. Has documentation been updated? |
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.
Loved it. Does this still reduces the toolkit impact on a blank application by ~3.5 MB (x86, release)?
@azchohfi Yes. The impact is the same. |
@skendrot I've created Update SystemInformation documentation in the doc repository. @michael-hawker I'm not seeing any dev/7 branch in the documentation repository. Should we create one ? |
@vgromfeld thanks! I've created a new doc branch, commented on that PR. I need to investigate the doc build failing still though. |
Thanks @vgromfeld for this! Let us know if you find any other similar optimizations we can do in other places too! |
Change SystemInformation from static to regular class (CommunityToolkit#3168)
This PR is a first step to address #3145.
It reduces the toolkit impact on a blank application by ~3.5 MB (x86, release)
PR Type
What kind of change does this PR introduce?
What is the current behavior?
SystemInformation
is astatic
class. It contains astatic LocalObjectStorageHelper
instance.This
static
"root" prevents the .Net Native compiler from removing this code from the generated code when not used.LocalObjectStorageHelper
is pullingJSON.Net
which has a big impact on the generated code size.What is the new behavior?
SystemInformation
has been changed to a regular class. It will be the responsibility of the user to use it as a singleton if needed. This approach allows us to reduce the toolkit impact on the applications whenSystemInformation
is not used.This is a breaking change.
Size in Kb, x86 release build, no compilation directive
PR Checklist
Other information
The test code. The zip contains two builds of the library (before/after) the proposed change and two blank apps with a dependency on the library but not consuming anything from it.
TestApp.zip