-
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
ObjectStorage enhancements #4102
Conversation
…Toolkit package, out of *.Toolkit.Uwp. Replaced Local/BaseObjectStorageHelper classes with ApplicationDataStorageHelper.
Thanks shweaver-MSFT 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 🙌 |
…-toolkit/WindowsCommunityToolkit into shweaver/storage-helpers
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.
Awesome start @shweaver-MSFT! Thanks! 🎉🎉🎉 This is going to be Epic!
Glad everything is pretty much just drop-over and replace for existing users, that's amazing. Really like how that all came together and the extra thought you put into how these things get split, combined again, and a few of the missing features.
I did throw some curve-balls questions into the IFileStorageHelper
discussion now that it's going to open up potential implementations on other platforms. Also maybe identified a couple of gaps. So let's just work through making sure we can solidify any assumptions there and document how things should behave for other future implementations (hopefully our existing UWP and OneDrive based implementations should provide enough context for what's reasonable for a File System to be able to do and what it should provide).
I think all that is mostly additive though, so we should still be pretty close. 🎉
Microsoft.Toolkit.Uwp/Helpers/ObjectStorage/IObjectSerializer.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp/Helpers/ObjectStorage/ApplicationDataStorageHelper.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp/Helpers/ObjectStorage/LocalObjectStorageHelper.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit.Uwp/Helpers/ObjectStorage/SystemSerializer.cs
Outdated
Show resolved
Hide resolved
Microsoft.Toolkit/Helpers/ObjectStorage/ISettingsStorageHelper.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
…-toolkit/WindowsCommunityToolkit into shweaver/storage-helpers
@michael-hawker I think I've responded to everything, let me know if I missed something. I had zero luck getting the nuget package from the PR feed working yesterday, so I'll try again once the latest build completes and spits out a new package |
Closing and re-opening to retrigger build with org name change. |
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
Microsoft.Toolkit/Extensions/ISettingsStorageHelperExtensions.cs
Outdated
Show resolved
Hide resolved
Build errors:
FYI @Sergio0694 there seem to be a lot of build warnings in the azure pipeline for t he Unit Tests for the Source Generators and some things for the HighPerformance package? |
Microsoft.Toolkit.Uwp/Helpers/ObjectStorage/ApplicationDataStorageHelper.cs
Show resolved
Hide resolved
@michael-hawker thanks for the heads up! I've opened #4142 to fix them 😄 |
…rageHelper.cs Co-authored-by: Sergio Pedri <[email protected]>
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
@Sergio0694 @shweaver-MSFT everything set now on this PR once it builds? |
I believe it is! |
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.
Wo-hooooo!! 🎉🎉🎉
Hello @michael-hawker! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉🎉🎉 Woot! |
## Fixes #4102 (comment) <!-- Add the relevant issue number after the "#" mentioned above (for ex: "## Fixes #1234") which will automatically close the issue once the PR is merged. --> <!-- Add a brief overview here of the feature/bug & fix. --> ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more options below that apply to this PR. --> - Maintenance <!-- - Bugfix --> <!-- - Feature --> <!-- - Code style update (formatting) --> <!-- - Refactoring (no functional changes, no api changes) --> <!-- - Build or CI related changes --> <!-- - Documentation content changes --> <!-- - Sample app changes --> <!-- - Other... Please describe: --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> Some HighPerformance/Mvvm unit tests produce warnings when the projects are built. ## What is the new behavior? <!-- Describe how was this issue resolved or changed? --> No more warnings 🙌 ## PR Checklist Please check if your PR fulfills the following requirements: - [X] Tested code with current [supported SDKs](../readme.md#supported) - [X] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link --> - [X] Sample in sample app has been added / updated (for bug fixes / features) - [X] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/CommunityToolkit/WindowsCommunityToolkit-design-assets) - [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/CommunityToolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc... - [X] Tests for the changes have been added (for bug fixes / features) (if applicable) - [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [X] Contains **NO** breaking changes
## Fixes CommunityToolkit/WindowsCommunityToolkit#4102 (comment) <!-- Add the relevant issue number after the "#" mentioned above (for ex: "## Fixes #1234") which will automatically close the issue once the PR is merged. --> <!-- Add a brief overview here of the feature/bug & fix. --> ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more options below that apply to this PR. --> - Maintenance <!-- - Bugfix --> <!-- - Feature --> <!-- - Code style update (formatting) --> <!-- - Refactoring (no functional changes, no api changes) --> <!-- - Build or CI related changes --> <!-- - Documentation content changes --> <!-- - Sample app changes --> <!-- - Other... Please describe: --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> Some HighPerformance/Mvvm unit tests produce warnings when the projects are built. ## What is the new behavior? <!-- Describe how was this issue resolved or changed? --> No more warnings 🙌 ## PR Checklist Please check if your PR fulfills the following requirements: - [X] Tested code with current [supported SDKs](../readme.md#supported) - [X] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link --> - [X] Sample in sample app has been added / updated (for bug fixes / features) - [X] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/CommunityToolkit/WindowsCommunityToolkit-design-assets) - [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/CommunityToolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc... - [X] Tests for the changes have been added (for bug fixes / features) (if applicable) - [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [X] Contains **NO** breaking changes
Fixes #3903
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The ObjectStorage helper interfaces and implementations currently live in the
*.Uwp
package. This means that they are not consumable from NetStandard projects, such as theCommunityToolkit.Graph
package.In addition, the
IObjectStorageHelper
is a mixture of support for both dictionary style settings storage, with some file storage features as well. Currently, supporting both file and folder scenarios is odd/difficult for storage endpoints that don't operate in a similar manner toWindows.Storage.ApplicationData
.Lastly, the support for file storage in
IObjectStorageHelper
is not complete and missing some basic CRUD operations that can make it difficult to work with in real-world application scenarios.What is the new behavior?
I've done a few things:
Deprecated the existing structures in the
Microsoft.Toolkit.Uwp/Helpers/ObjectStorage
folder:BaseObjectStorageHelper
IObjectSerializer
IObjectStorageHelper
LocalObjectStorageHelper
SystemSerializer
Migrated some of the previous structures up into the
Microsoft.Toolkit/Helpers/ObjectStorage
folder so that they are consumable from NetStandard:IObjectSerializer
SystemSerializer
Created new interfaces to replace the functionality defined in the now defunct
IObjectStorageHelper
:ISettingsStorageHelper
- Interop with values as key/value pairs, like a dictionary.IFileStorageHelper
- Interop with a file system to store values in files and folders.Replaced the functionality provided by
BaseObjectStorageHelper
andLocalObjectStorageHelper
with an implementation ofISettingsStorageHelper
andIFileStorageHelper
:ApplicationDataStorageHelper
- Interop with local settings and files throughWindows.Storage.ApplicationData
.Use it like so:
Altogether, this provides a transition path from the previous ObjectStorage constructs to a more granular set of interfaces with identical signatures plus enhanced support for file and folder CRUD operations.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Looking for feedback!