-
Notifications
You must be signed in to change notification settings - Fork 39
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
Restructuring package layout, removing behaviors #76
Conversation
- Renamed StateChangedEventArgs to ProviderStateChangedEventArgs - Moved provider implementations to new providers package
Thanks shweaver-MSFT for opening a Pull Request! The reviewers will test the PR and highlight if there is any merge conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
@michael-hawker @nmetulev I've made some more changes to the package structure based on our convo the other day. I think this setup works nice, but I'd love your feedback :) |
I love this direction and simplifying things - but I think it can be simplified even more. I also like that we are changing the package names already - it's the right time to do it. Few thoughts and comments
cc/ @michael-hawker for his thoughts |
@nmetulev, Love the suggestions! I'll jump on those next and send an update. On 3 though, I was thinking about putting helpers (e.g. RoamingSettings) in that package too, which is why I ended it in Uwp. Does that seem right the right place for them, and does the name change still make sense in that case? I knod of like it as *.Uwp imo |
@nmetulev @michael-hawker I think I've made all of the major changes we discussed. Let me know if I missed anything! |
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.
Added some initial comments, but I think the biggest thing to tackle is how we unravel the dependency on the Graph SDK for basic authentication scenarios. Added a comment in the WindowsProvider PR to give more context: https://github.com/windows-toolkit/Graph-Controls/pull/69/files#r596451587
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.6" /> |
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.
Ah, so we're still relying on this package... hmmm. This is what's pulling in MSAL/ (So if you only want the Windows provider, you're still pulling in MSAL?)
Also, this is the part that's getting rolled into the new Graph SDK which includes everything together... @nmetulev thoughts on if we should try and isolate that for the future vs. knowing eventually we'll pull in the whole Graph SDK... This seems like it's going to be a big problem for consumption of their v2 as we had mentioned.
What pieces are we still referencing from here (besides MSAL)? Like should we have an explicit CommunityToolkit.Net.Authentication.Msal
or something?
I wonder if we investigate the source only style package, so rather than having another DLL for just the single MSAL Provider, it effectively just includes the CS file and it builds as part of the consuming app... 🤔 @Sergio0694 thoughts here? Is this the article you've been looking at for this 'feature'?
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.
I've moved MsalProvider to it's own package, CommunityToolkit.Net.Authentication.Msal
, and it's now based on the official Microsoft.Identity.Client.Extensions.Msal
library.
I looked into the source code only package, but it has an unfortunate side effect of not being able to use project references anymore. Which means I can't reference the msal package from the sample app, because it emits a nuget from build, not a DLL. I think it's probably fine to leave it as a typical, dll-emitting package imo.
Weird build issue:
Looks like target SDK mismatch somewhere? |
No idea on the weird build error. I'll have to look into it more. It started after I added the msal package. |
Hooray! I fixed the build issue :) |
Ah, it's because the packages were no longer multi-targeted but the UWP workaround was still included... @jeromelaban was multi-targeting the .NET Standard packages something done for Uno? Can we just use .NET Standard 2.0 things directly now even in WASM? |
Yes |
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.
I really like this. Few questions and comments, but overall, really good
CommunityToolkit.Net.Authentication.Msal/CommunityToolkit.Net.Authentication.Msal.csproj
Outdated
Show resolved
Hide resolved
CommunityToolkit.Net.Authentication/CommunityToolkit.Net.Authentication.csproj
Outdated
Show resolved
Hide resolved
CommunityToolkit.Net.Authentication/CommunityToolkit.Net.Authentication.csproj
Outdated
Show resolved
Hide resolved
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Graph.Beta" Version="0.39.0-preview" /> |
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.
Just a thought - should we have two packages (one pulling in the beta sdk, and one the v1 sdk)? The source can be all the same, just this csproj will be different.
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.
That sounds pretty slick. Do you think there is any potential for type mismatch if the SDKs deviate much?
Michael and I had talked about splitting on Beta vs v1, this could be a great way to do it. Either way, I'll save that for another PR - #52
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. Yeah, I think it's worth trying.
CommunityToolkit.Uwp.Graph.Controls/CommunityToolkit.Uwp.Graph.Controls.csproj
Outdated
Show resolved
Hide resolved
….Controls.csproj Co-authored-by: Nikola Metulev <[email protected]>
Co-authored-by: Nikola Metulev <[email protected]>
Co-authored-by: Nikola Metulev <[email protected]>
…ntication.csproj Co-authored-by: Nikola Metulev <[email protected]>
…ntication.csproj Co-authored-by: Nikola Metulev <[email protected]>
Co-authored-by: Nikola Metulev <[email protected]>
…Authentication.Msal.csproj Co-authored-by: Nikola Metulev <[email protected]>
…oolkit/Graph-Controls into shweaver/bad-behaviors
Fixes #60
Fixes #67
Fixes #75
Fixes #78
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently, Providers can be declared in XAML leveraging Behaviors SDK.
What is the new behavior?
In this PR I've removed the behaviors references from the Controls package which includes how to declare Graph config from XAML. This means that the GlobalProvider can no longer be configured from XAML.
The new way is to declare in the project's root App.xaml.cs and initialize the GlobalProvider on app launch.
Package shuffle
I've adjusted the package structure to meet a few of our project goals:
The package structure looks like this now:
CommunityToolkit.Net.Authentication
Core constructs for authentication: No Graph SDK, NetStandard
CommunityToolkit.Net.Authentication.Msal
Authentication via Microsoft.Identity.Client.Extensions.Msal package: No Graph SDK, NetStandard
CommunityToolkit.Net.Graph
Graph SDK interaction: Has Beta Graph SDK, NetStandard
CommunityToolkit.Uwp.Graph.Controls
Graph enabled controls and helpers: Has Beta Graph SDK, UWP
Rename
I've renamed
StateChangedEventArgs
toProviderStateChangedEventArgs
for the sake of consistency.PR Checklist
Please check if your PR fulfills the following requirements:
Other information