-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Spec] Essentials Dependency #19
Comments
I would like to understand and discuss the pros and cons of this. I understand some features are overlapping, but I'm not a fan of the whole Essentials package becoming part of the SDK, specially because Essentials doesn't have interfaces by default, and would cause problems for unit-testing again (something that is being fixed in MAUI). At the end of the day, what other benefits do we have in bringing Essentials in? People can always add Essentials when needed, is it worth considering removing the duplicated APIs from new versions of Essentials itself? |
@akamud I realize that Essentials doesn't provide interfaces out of the box, but is there something about the API design which prevents you from creating your own interfaces for the parts of Essentials you're using? |
Not really, indeed, I always install Essentials.Interfaces right after I install Essentials, I guess the discussion here is more about the philosophical stance that adding Essentials would cause... When people that are new to the platform see Essentials installed with no interfaces, they might be taken to a direction of writing coupled apps that are more difficult to test. (This is an assumption from my part, maybe you have some data that can bring more facts to this discussion?) With that in my mind, I'm more interested in understanding what is the big gain from the SDK point of view, since everything is a "nuget-install" away. I might be underestimating the APIs overlapping problem here too, after all, I'm not a maintainer in any of those projects. Do you see any other advantage with this approach other than fixing the overlapping problem? |
Will the Xamarin.Essentials (XE) become |
The big gain in removing the overlap is that we'll only have to maintain one implementation for each thing which overlaps. Right now, the Forms team and the Essentials team (which themselves overlap a lot) are fixing bugs and improving code in multiple places to do the same things. It also reduces documentation maintenance. Plus combining them reduces the confusion for developers who add Essentials to a Forms project and suddenly have multiple ways to get the screen size, convert colors, etc. Or folks who use the default templates, which already includes Essentials. |
I think I get the whole picture now, thanks for taking the time discussing this :) |
Doesn’t this just mean that Essentials has overlapping features with Xamarin.Forms? And by extension, if Essentials removes the overlapping features, would it still make sense for Forms to add a dependency at that point? |
Related to #1965 |
Description
Take a dependency on the Essentials library. This will eliminate some of the overlap between this SDK and Essentials.
Overlapping APIs
These are APIs which are currently provided by both Forms and Essentials. Any additional functionality which Forms has will be ported to Essentials, and the Essentials APIs will be used.
App Theme
Light and Dark theme info.
Color Converters
Methods for converting color data to and from cross-platform Color.
Device Display Metrics
Informations such as screen size, density, and rotation.
Device Info
This includes information such as the device's Platform and Idiom.
Preferences/Properties
A simple persistent key/value store.
UI Thread Invocation
The Essentials implementation of UI thread access relies on a static MainThead class which is incompatible with multi-window applications on some platforms. We will need to maintain the current Forms Dispatcher pattern or modify Essentials to follow that pattern.
Backward Compatibility
For folks relying on functionality currently provided by Forms which will be dropped in favor of the Essentials version, this will be a breaking change.
Difficulty : Low
This will mostly be a matter of removing the Forms code which is duplicated in Essentials.
The text was updated successfully, but these errors were encountered: