dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.95k stars 1.7k forks source link

Separate Core MAUI platform and Native Controls #4721

Open Martinn2 opened 2 years ago

Martinn2 commented 2 years ago

Description

MAUI platform SDKs should be separated from Native Controls. It would be used like this:

builder.UseMauiCore()
builder.UseMauiNativeControls()

This way, MAUI might support Linux (and maybe web) just by adding "Maui Core" for now, so support would be easier and faster. To create UI, we would then use Blazor,Microsoft.Maui.Graphics.Controls, or any similar library (for example Syncfusion has a lot of drawn controls).

Also developers who would like to use drawn controls on other platforms would make their projects smaller maybe by removing XAML at all.

Public API Changes


builder.UseMauiCore()
builder.UseMauiNativeControls()

Intended Use-Case

I want to be able to use MAUI without native controls to make it more lightwidth and easier to add new platforms.

jfversluis commented 2 years ago

How is this not the case already? For instance Comet is already using core without using the "XAML controls" so to speak, as does Microsoft.Maui.Graphics.Controls. What are you missing right now that prevents you from doing this?

Martinn2 commented 2 years ago

Yes I know but even if you use maui graphics, all the handlers and mappers will still be part MAUI right ? Being able not to add those might make apps a little more lightwidth.

Furthermore, If MAUI team decides in future to support Linux, web or whatever platform, they will have to implement all the handler and mappers for native controls.

I want an architecture where MAUI team can be like "On linux we support just SDK but NOT NATIVE CONTROLS" if community wants, use maui graphics or whatever to do the rendering. This architecture would make support for new platforms much faster.

PrestigeDevop commented 2 years ago

Meet WebWindow, a cross-platform webview library for .NET Core

It's like Electron, but without bundling Node.js or Chromium, and without most of the the APIs

Martinn2 commented 2 years ago

@PrestigeDevop Yes, this is similar concept. If MAUI is split the way I suggest it would be easy build your library above MAUI and linux support for MAUI would be done. IMHO we need drawn controls not only Blazor, as your library has

osnipezzini commented 2 years ago

So come on, instead of having a complete SDK to write so much for Linux, android, windows, ios... , do you want us to write linux screens by hand?? so if so use pure GTK#.

What's the need to have a half SDK? I do want to write linux screens using XAML, otherwise you don't even need to add linux if you need to do it separately. Today I use pure GTK#, but it lacks some things like support for generic types and lists, ease of creating tables, among other things.

MAUI with full linux support would be handy for building these applications.

Martinn2 commented 2 years ago

@osnipezzini With the architecture I suggest we would be able to use all the newest .NET features (like generics you mentioned) and paint with skia or native drawing library or blazor.

do you want us to write linux screens by hand?? so if so use pure GTK#. Yes, I want to write screens by hand but NOT using GTK#, but using much easier and cross platform way

ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.