lyft / domic Goto Github PK
View Code? Open in Web Editor NEWReactive Virtual DOM for Android.
License: Apache License 2.0
Reactive Virtual DOM for Android.
License: Apache License 2.0
It should do same stuff differently so we could profile it (systrace, etc) and compare implementations, right now I just modify sample app and profile that.
Right now I'm thinking about at least 4 options:
Please see this conversation: #33 (comment)
That'll reduce overhead of switchMap.
This is a tracking issue for discussions of the problem.
Android Framework is mutable (duh). Mostly it's fine, however some View/Widget properties can be updated by Framework/user, for example TextView/EditText.text
or CompoundButton.checked
.
CheckBox
:checked
to false
via Domicchecked
to true
checked
to false
via Domic againIf Domic doesn't track state changed by user of the device (read as Android Framework), it will just dismiss the update because it compares it with internal in-memory state.
Current solution is to observe state of such properties and update internal in-memory state thus keeping Domic in sync with Android Framework.
Was discussed with lead of Android UI Framework Adam Powell
Since we pipe all changes through our model, we can expose API that can let user capture and apply captured state.
That can be helpful for state save/restore, reproducing UI from bug reports, etc.
Pointed out by @Tagakov
I wanted to avoid allocation of a func: (T) -> Unit
, but failed to notice that I trade it off with inlining anonymous class instantiation to each call site which is not great
Function should not be inlined.
There is a common problem with async rendering: due to async data arrival and async switching to ui thread you're effectively skipping first frame.
In many cases it's not really a problem because it's very hard to notice one frame without data, especially if default layout state already displays something.
However in some cases like very different default state of the layout compared to the state with data (ie whole content is invisible by default, etc) it can be noticeable.
This GitHub issue tracks possible solutions and general discussion of this problem.
Also related to RxAndroid ReactiveX/RxAndroid#228
Android P introduces new api to pre-compute text layout metrics, so rendering can be done faster.
Since Domic is intended to be used off-main thread this seems like a good api to integrate with.
Docs: https://developer.android.com/reference/android/text/PrecomputedText
ADB Podcast episode where they discuss this api: https://androidbackstage.blogspot.com/2018/05/episode-90-spanspanspanspan.html
That should reduce synchronization and memory allocations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.