-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
feat: Upgrade target framework from NET Standard 2.0 to .NET 6.0 #393
Conversation
- Removed `xmlns:m` namespace declaration for `UraniumUI.Icons.MaterialSymbols` in `AppShell.xaml`. - Replaced `ImageButton` with `Button` for delete button in `AppShell.xaml`. - Updated `Tab` elements in `AppShell.xaml` to use image icons. - Conditionally set database path in `DataBaseService.cs` based on `NET9_0`. - Added `<AppxSymbolPackageEnabled>false</AppxSymbolPackageEnabled>` to `Dimmer-MAUI.csproj`. - Added new property groups for configurations and target frameworks in `Dimmer-MAUI.csproj`. - Changed active debug framework and profile to Windows in `Dimmer-MAUI.csproj.user`. - Updated version in `Package.appxmanifest` from `0.4.0.0` to `0.5.0.0`. - Updated publish settings in `MSIX-win-x64.pubxml` and `MSIX-win10-x86.pubxml`. - Added new SVG and PNG icon files. - Conditionally compile code for Android and Windows in various services and view models based on `NET9_0`. - Updated `MediaPlaybackControlsView.xaml` to use new image sources and added triggers for shuffle state. - Fixed issues in `SingleSongShellPageD.xaml.cs` and `SingleSongShell.xaml`. - Updated `Parse.csproj` to support multiple target frameworks and added a conditional target framework for Windows. - Added new publish profile `FolderProfile.pubxml`. - Updated `Resources.Designer.cs` to use `StronglyTypedResourceBuilder` version "17.0.0.0".
- AppShell.xaml: Added TouchDownCommand, removed redundant elements. - AppShell.xaml.cs: Made ToggleFlyout calls synchronous, added empty event handler. - SongsManagementService.cs: Explicit constructor call for SongModel. - Dimmer-MAUI.csproj: Changed RuntimeIdentifier to win10-x64. - Dimmer-MAUI.csproj.user: Updated debug settings for Windows. - GeneralStaticUtilities.cs: Added null check for item.FilePath. - LyricsService.cs: Improved null handling, added .lrc parsing. - ArtistsSection.HomePageVM.cs: Handled nullability, added partial methods. - ArtistsPageD.xaml: Added DataTrigger for Label styling. - ArtistsPageD.xaml.cs: Refactored ArtistView_TouchDown. - DimmerWindow.xaml.cs: Updated version subtitle to v0.5.1. - MainPageD.xaml: Added TouchDown event handler, simplified Image binding. - MainPageD: Added isPointerEntered field, implemented PointerEntered method. - SingleSongShellPageD.xaml: Updated IsAnimationPlaying, added SfChipGroup. - SingleSongShellPageD.xaml.cs: Added chip click handler, debugging using directive. - ArtistsPageM.xaml.cs: Removed async from ResetSongs_TapPressed, added background color changes. - Added pragma directives to suppress warnings, added comments for refactoring.
Updated target frameworks and project references: - `ParseLiveQuery.Test.csproj` to `v4.8` - `ParseLiveQuery.csproj` to `net9.0` - Removed `Parse` and `WebSocketSharp` references, added `System.Text.Json` and `websocketsharp.core` - Updated `Parse.csproj` to use `OpenCover` v4.7.1221 Refactored `ParseLiveQueryClient.cs`: - Switched to `System.Text.Json` for JSON parsing - Added `_clientKey` field and updated constructor - Updated methods to use `ParseClient.Instance` for various operations - Adopted file-scoped namespace syntax Updated other client operations: - Replaced `Json.Encode` with `JsonSerializer.Serialize` in `SessionClientOperation.cs` and `UnsubscribeClientOperation.cs` - Updated `SubscribeClientOperation.cs` to use `ParseClient.Instance.CreateObjectWithoutData<T>(null).ClassName` Enhanced `ObjectServiceExtensions.cs`: - Added validation and error handling in `GetFieldForPropertyName` method - Included `System.Diagnostics` namespace Updated Visual Studio solution: - Made compatible with Visual Studio 17 - Removed `ParseLiveQuery.Test` project, added `Parse` project
Updated App.xaml.cs to initialize platform-specific shells and replaced Console.WriteLine with Debug.WriteLine. Enhanced AppShell.xaml and AppShellMobile.xaml with new tabs and routes. Expanded IFlowsService.cs with new methods for user accounts and synchronization. Renamed and refactored FlowService.cs with extensive updates for user authentication, data synchronization, and error handling. Added project references and updated FlowHub-MAUI.csproj and FlowHub-MAUI.sln. Refactored data models in FlowModel.cs and enhanced HomePageVM.cs with new properties and commands. Updated various XAML files for improved UI and data binding. Refactored multiple files in ParseLiveQuery to use file-scoped namespaces, improved formatting, and updated WebSocket implementation. Enhanced MutableObjectState, ParseObject, and related classes with new properties, error handling, and logging. Updated ParseUser.cs and service extensions for better user management.
The changes primarily involve refactoring methods to use block bodies instead of expression bodies across multiple files. This improves readability and maintainability by making the code more consistent and easier to debug. Key changes include: - Refactored methods in various files such as `HomePageVM.cs`, `ConnectClientOperation.cs`, `ParseLiveQueryClient.cs`, `CacheController.cs`, `ParseAddOperation.cs`, `ParseObjectCoder.cs`, `ParseCommandRunner.cs`, `ParseConfiguration.cs`, `ParseObject.cs`, `ParseQuery.cs`, `ParseUser.cs`, `ParseUserController.cs`, `AnalyticsServiceExtensions.cs`, `CloudCodeServiceExtensions.cs`, `ConfigurationServiceExtensions.cs`, `InstallationServiceExtensions.cs`, `ObjectServiceExtensions.cs`, `ParseExtensions.cs`, `ParseFileExtensions.cs`, `ParseQueryExtensions.cs`, `ParseRelationExtensions.cs`, `ParseUserExtensions.cs`, `PushServiceExtensions.cs`, `QueryServiceExtensions.cs`, `RoleServiceExtensions.cs`, `SessionsServiceExtensions.cs`, and `UserServiceExtensions.cs` to use block bodies. - Added logging and debug statements in some files to track changes and improve clarity. - Introduced hardcoded values for user credentials in `HomePageVM.cs` and added logging for user authentication status changes. - Added null checks and validation logic in some methods to ensure robustness.
Will Do Docs later
Thanks for opening this pull request!
|
Amazing, a lot of time must have gone into this. It will take some time to review this, but I've at least been able to start the CI to see how that goes. |
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.
Could you take a look at the failing CI?
Hi ! From what I see, the build fails mainly due to the UnitTest likely looking to validate the previous methods (I can see it mention Please give me some time and I should be committing soon. |
@YBTopaz8 Would you like me to add you to the Parse .NET SDK review team? You'd get a notification when a contributor's PR is ready for review. |
- All Currently Written tests are updated to test the latest code - Parse previously targeted only .NET 9+, now it does .NET6+ - Did some "Todo" along the side. - Ensured all tests while updated, still pass as intended.
- Sets base compatibility to .NET 5+ (versions 5, 6, 7, 8, 9), including support for .NET MAUI, ensuring broader platform compatibility. - Enables compatibility for Live Queries with the updated base compatibility. - Completed most, if not all, TODOs, including implementing additional unit tests to cover newly introduced concepts. - Finalized remaining TODOs and ensured all functionality is thoroughly tested.
I've had this this version running for a while now without issues, but had no tests done. So, now I've just updated Unit Tests, added new ones for new stuff added too, and they all pass now. @mtrezza Hi, Sure it would be a pleasure. Just FYI, I'm updating Live Queries lib too, that way it can target same as Parse, if the community is interested in officially having LQ lib, I'd be glad to give my improvements on it & may throw some updates here and there. Best. |
Great, restarted the CI... contributions are always highly welcome, especially in the .NET SDK, which didn't get much TLC in the past years. |
Had a quick look and a fair few of the changes seem to be linting related - my suggestion would be to revert the File Scoped Namespaces change so it's a bit easier to review, and then address the File namespaces in a sepeate PR (that way this PR can just be the required changes) Would also suggest modularising some of the LiveQuery code into its own files (the diff here has no added files which I think is strange) If you could, could you let me know which classes have been added/changed in this PR (and isn't a lint change) |
Co-authored-by: Daniel <[email protected]>
…anges to test to avoid warnings
Okay, it might be a very long reply;
File: Parse/Utilities/ObjectServiceExtensions.cs
Files: Parse/Infrastructure/Data/ParseDataDecoder.cs & Parse/Infrastructure/Data/ParseObjectCoder.cs
File: Parse/Infrastructure/Execution/ParseCommandRunner.cs
File: Parse/Platform/Objects/MutableObjectState.cs
Files : Parse/Platform/Objects/ParseObjectClass.cs and Parse/Platform/Objects/ParseObjectClassController.cs File: Parse/Utilities/UserServiceExtensions.cs
File: Parse/Infrastructure/Utilities/JsonUtilities.cs
Files: Parse/Platform/Users/ParseUserController.cs , Parse/Platform/Users/ParseCurrentUserController.cs, Parse/Platform/Users/ParseUser.cs
File : Parse/Abstractions/Platform/Objects/IObjectState.cs
Parse/Abstractions/Platform/Objects/IParseObjectController.cs,
Parse/Infrastructure/Utilities/Conversion.cs
Parse/Platform/Security/ParseACL.cs
Added Support for .net 5,6,7,8,9 and MAUI. I updated this Here is a full overview of what's done @dblythy ! Also, about Parse Live Query, I added No file because I believe it's best to keep it as an optional library. If the Parse Community is interested, I can help make it officially its. The Live Queries Lib is online and already having little over 70 downloads in Nugets , no Negative Feedback since it's out and even internally, I've had no issues. If interested, of course, kindly ping me. |
Thank you for providing that documentation @YBTopaz8! No worries, I misunderstood - was thinking the livequery code was part of this PR. Having it as a seperate package is clean. I'll go in again tomorrow and review the classes you mentioned. Appreciate your contribution - this will be a valuable uplift! |
It's a pleasure! I'll Actually try to do a full documentation of what's changed what's added/removed (probably nothing if not bugs) and how to use new methods I added. It's a pleasure to help again, and I appreciate you all! |
I also assumed LiveQuery was part of this PR. So we need to remove that from the PR title, right? |
Yes! I am using it in my project - building a cross plat, cross sync music player app And my sample Maui chat app that uses the latest version of LQ since it's the demo project. I'm fine with waiting as long as it fits the guidelines as well |
That's great that you are using it, so I'd merge this without further ado. @dblythy, fine with you? |
@YBTopaz8 Before we merge, I'd like to confirm with you that this PR doesn't contain any breaking changes, is that correct? If so, we'll release this as a feature release, otherwise we'd release as a major release. |
Correct, this PR does not contain any breaking changes as far as I've checked. It's more of a "facelift," modernizing the codebase and readying it for Live Query integration, so it's good to go. To ensure reliability, I’ve extensively tested it across platforms, including Android WearOS. It worked flawlessly, even in a real-time chat app with full CRUD functionality running across multiple platforms: Here. I also built a native watch app for my cross-platform music app (Here too). If I had a smart fridge, I’d have tested it there too! 😄 |
Do Grant me a moment though. |
Does it? That would quality as a breaking change. I thought the breaking change would come with the next PR where we'll remove the .NET 6 and 7 support? |
Ohh, you would be right indeed! |
Did some research. Currently the Parse .NET SDK is targeting I think this change makes strategic sense because that's the future:
So yes, this is a breaking change. Given that the Parse .NET SDK didn't receive much TLC for years I'd say let's go ahead with this modernization and focus on .NET. Unless this PR still builds when targeting TODOs:
|
This is right ! Since Xamarin has evolved into .NET MAUI and is now unsupported (as of May 1, 2024), the decision to drop netstandard2.0 eliminates reliance on outdated technologies. & Also And I'm pretty sure I fixes to MAUI does fix unity in most if not all cases as they seem to operate pretty much same. & Finally, I fixed the logout issue found in unity only that moved to Maui since they are mostly treated the same as MAUI. I'll add a simple condition to use a vanilla webclient with only the data needed for very simple operations. Expect a final commit fixing that . (Maybe I'll fix the unit test too as well! Finally after months!) |
Just to reassure you, pray least seeing this another around would me
All the changes do here are tested WITH LQ first, then with UTests. I'm wondering how Parse will manage that for .net Will you make it a standalone extension ? Or merge like Parse for Swift Did? You tell me in due time of course! |
It used to freeze app before but doesn't now. - SignUpAsync now returns the Signed up user after completion - Renamed LoginAsync() to LoginWithAsync() and SignUpAsync() to SignUpWithAsync(). - Finished removing old codes. - Possibily fixed all OLD Unity issues.
Unit Tests all run as expected. Logout still fails because I can't mock it properly. I fixed my main issue which was that it would freeze/crash app. And since we opted to release as breaking change, I went ahead and implemented the Todos that required method name changes.. |
Perfection. |
netstandard2.0
to .NET 6
netstandard2.0
to .NET 6netstandard2.0
to .NET 6.0
netstandard2.0
to .NET 6.0# [4.0.0](3.0.2...4.0.0) (2024-12-19) ### Features * Upgrade target framework from NET Standard 2.0 to .NET 6.0 ([#393](#393)) ([1d4ab13](1d4ab13)) ### BREAKING CHANGES * This release requires .NET 6.0 or later and removes compatibility with NET Standard 2.0; Xamarin developers should migrate to .NET MAUI to use this version of the Parse SDK; Unity developers should use the previous SDK version until Unity supports .NET. ([1d4ab13](1d4ab13))
🎉 This change has been released in version 4.0.0 |
Lovely! The one thing with LQ is that I do not have any Unit Tests so in that light, I admit, I do not know what to do best and would appreciate your advice!. Lastly, as mentioned above, there was an interesting issue I spotted that has to do with Cloud Jobs in .NET where they don't pass the sessionToken as param, leading to Parse fxns needed auth to never run. I will open a PR for that in a few. |
I suggest you post this comment on #199 to have a discussion. I noticed that the issue was linked incorrectly, because it was about adding LiveQuery to the SDK, but this PR did not add LiveQuery, so I've reopened it. |
Introduction
Hello Parse Community for .NET,
I am thrilled to submit this PR that helps modernize the Parse SDK for .NET by:
This contribution is a response to one of the most requested features in Parse for .NET: Live Queries. By bridging this gap, I believe Parse can now fully serve the modern .NET ecosystem and attract new developers who seek real-time functionality with minimal complexity and even shine some more light on the Goodies that .NET MAUI offer with this!
Acknowledging Prior Work
Before diving into the specifics, I want to recognize the existing PR feat: Fully support .NET Standard on various platforms.
While this PR doesn’t mention .NET MAUI or Live Queries, it lays the groundwork for compatibility across multiple platforms. I see it as a valuable stepping stone toward modernizing the Parse SDK. My work builds on the same ethos of broadening Parse’s reach while addressing critical developer needs like real-time updates and cross-platform stability.
Why did I finally do this PR?
1. Live Queries for .NET - Finally!
Live Queries have been a critical feature in Parse’s ecosystem, enabling real-time updates to clients. However, .NET developers have been left out of this functionality due to outdated implementations and a lack of modern support (Understandably so; It's no small feat!).
This PR:
2. Parse SDK for .NET 9 and .NET MAUI
.NET MAUI is the future of cross-platform development as per Microsoft, allowing developers to target Android, iOS, Windows, and macOS with a single codebase. Yet, Parse lacked compatibility with this framework—until now at least as I can happily report it working on MAUI devices as low as API 30 (Will test further if need be).
This PR:
HostManifestData
that previously made MAUI integration unstable.I had this ready for a while but wasn't done testing in my "ways" (you will understand just below) so now that I'm very happy and confident of the outcome, I am happily sharing.
(Somewhat) Technical Contributions (The codes might speak better than my words)
This PR makes several key improvements to the SDK and Live Queries:
SDK Enhancements
Async Modernization:
.Unwrap()
,.OnSuccess()
) withasync/await
, improving readability, performance, and maintainability.Error Handling Improvements:
response.length()
ALWAYS throwing an exception because the method isn't supported.Minimal Dependencies:
MAUI Compatibility:
HostManifestData
during initialization.As my Live Queries repo is also ready if needed, I'll just name the Live Queries Enhancements I did as well
WebSocket Overhaul:
System.Net.WebSockets.Client
, and all the related methods, ensuring stability and scalability.Real-Time Reliability:
Feature Parity:
Challenges and My Approach
1. Addressing Legacy Code:
Porting Live Queries from .NET 2 involved unraveling contextually outdated async patterns, undocumented flows, and unsupported APIs. I approached this by:
2. Ensuring Cross-Platform Stability:
MAUI introduces unique challenges, particularly with platform-specific configurations like
HostManifestData
. I resolved this by implementing a manual initialization process that ensures stability across Windows, Android, and macOS.3. Testing and Documentation:
While this PR lacks comprehensive unit tests, I’ve included:
I welcome collaboration to expand test coverage and improve documentation further.
Why No Unit Tests?
I want to address this head-on because I know it’s an important topic.
The truth is:
I’ve never had the opportunity to learn unit testing properly. It’s something I’ve always envied in others who do it effortlessly.
My coding experience has been shaped by a more hands-on, old-school approach—debugging and breaking my code manually to understand and refine it.
While this approach has worked well for me so far, I recognize the value of formalized testing. Most methods in the updated SDK retain the same flow, so I believe existing test suites (if available) would require minimal adjustment. I welcome collaboration from the community to help add meaningful tests.
On Adherence to Guidelines:
While I didn’t strictly follow all project guidelines, I maintained the core functionality and flow of the SDK. My focus was on modernizing outdated patterns and ensuring stability, especially for .NET MAUI compatibility and Live Queries.
Any deviations (e.g., updated async patterns or additional comments) were intentional, aimed at improving readability, maintainability, and scalability. I look forward to working with the community to align this further with Parse’s standards.
Acknowledgments
I want to thank:
Next Steps
This PR is just the beginning. I’m eager to collaborate with the Parse community to:
Final Thoughts
This PR isn’t about pushing a solution; it’s about opening a door. Live Queries, .NET 9 AND MAUI support represent the next step forward for Parse, and I’m excited to help make it happen.
Hopefully at least it helps ANYONE in need and closes that near-decade old issue
Happy coding,
Yvan Brunel
This should first and foremost close #199
Links