Avalonia.FuncUI icon indicating copy to clipboard operation
Avalonia.FuncUI copied to clipboard

sketch for adaptive funcui

Open dsyme opened this issue 6 years ago • 4 comments

This is micro sketch for how FuncUI v1 might use adaptive data

dsyme avatar Oct 03 '19 15:10 dsyme

This is not close to complete or even convincing, just putting the basics there to define an adaptivePatch function that, when the return closure is invoked, looks for changes in the adaptive data and applies them as a patch

https://github.com/JaggerJo/Avalonia.FuncUI/pull/21/files#diff-ab3843d5f352bde4083a9cc0f90d3509R565

The diff is not yet computed recursively using other readers, and only deals with property changes. And I haven't actually run the code, just compiled it.

But the idea is there.

dsyme avatar Oct 03 '19 15:10 dsyme

Thanks Don.

Will look into this next week. Would be really cool to make diffing cheaper

JaggerJo avatar Oct 04 '19 08:10 JaggerJo

Will look into this next week. Would be really cool to make diffing cheaper

Just to mention that it does come with costs in the programming model for adaptive views. And also there is an underlying issue about whether to use immutable or mutable data for the model. (The Aardvark people often use an immutable model with a reflection-based technique to diff the model to translate into modifications to ChangeableValue etc., which then cause the incremental view diff'ing to kick in.)

dsyme avatar Oct 04 '19 10:10 dsyme

Just had the time to look into this a bit further, and really like the concept. Getting the API that is exposed to the user simple would be the most challenging part IMO, but maybe I'm wrong.

I don't think it's required for most applications, because view diffing with some tricks is fast enough in most cases (as far as my experience goes). If vNext is ready I might try out a hybrid approach, so one could use an adaptive view for that huge chart, but still use the expressive and simple views for the rest.

JaggerJo avatar Oct 08 '19 20:10 JaggerJo