fabulous-dev / Fabulous

Declarative UI framework for cross-platform mobile & desktop apps, using MVU and F# functional programming
https://fabulous.dev
Apache License 2.0
1.15k stars 122 forks source link

Platform specific build of view - SwiftUI and Jetpack Compose #437

Closed timahrentlov closed 5 years ago

timahrentlov commented 5 years ago

Google and Apple seems to have decided that a declarative UI is the future. Flutter, Jetpack Compose and SwiftUI is replacing the more traditional UI's.

Could Fabulous be extended to embrace these new frameworks? Is it feasible with platform specific view build functions ? Written in SwiftUI, Jetpack Compose, etc. ? Or Forms for that matter? Separating the V from the M(V)U for optimal UI platform integration?

Happypig375 commented 5 years ago

You can always write platform specific renderers for Xamarin Forms and plug these native frameworks into your app through Xamarin.

TimLariviere commented 5 years ago

Is it feasible with platform specific view build functions ?

Short answer: Yes.

The implementation of the M-U part is fairly platform agnostic (though there is still some XF specific stuff in there - would require some changes in Fabulous to support complete platform agnostic). This is pretty much what Elmish already does. Fabulous mostly forked this part. So maybe, we should consider dropping the fork part and take a dependency on Elmish instead?

Written in SwiftUI, Jetpack Compose, etc. ?

That's where it gets complicated. Fabulous is F# -- F# is .NET.

Supporting other .NET UI frameworks like Xamarin Android/iOS, WPF, Avalonia, Uno is possible (but a whole lot of work - for each one of them) Supporting non-.NET UI frameworks is another story.

Things to consider here:

timahrentlov commented 5 years ago

Tim, thank you for that elaborate take. It will be interesting to see how Xamarin with will fit into a future with an increasingly focus on declarative UI's.

One question though. You write "Supporting non-.NET UI frameworks is another story." Does that mean that Fabulous adopting an engine like flutter represents an easier path ? Xamarin below for platform integration. Fabulous in the middle, expressing its UI in the same single file using flutter widgets on the top ? It sounds like a lot of work too :)

TimLariviere commented 5 years ago

You write "Supporting non-.NET UI frameworks is another story." Does that mean that Fabulous adopting an engine like flutter represents an easier path ?

@timahrentlov No. I meant that it's technically feasible for Fabulous to support other .NET UI frameworks. But it doesn't necessarily mean we will support them, though I'd like to try to allow it.

For non-.NET UI frameworks, it's most likely we won't even be able to communicate with these frameworks without an insane amount of work. Xamarin does that for Objective-C/Swift and Java, but they've been at it for years. :)

timahrentlov commented 5 years ago

Thanks Tim. I'm trying to form an overview of how Xamarin and in turn Fabulous will fit into a declarative future where one can no longer assume that for example Apple's SwiftUI is just a wrapper around UIKit (https://wwdcbysundell.com/2019/swiftui-relationship-to-uikit-appkit/)

However, it does seem to me that MVU is better suited for this future than the current MVVM track Xamarin is on. Would be great if Fabulous could turn these lemons into lemonade. The word "MVUCross" keeps popping into my head :p

Again, thank you for your time Tim.