Comments (8)
I can look into adding an internal mobx like fallback when Proxies are not available. The fallback would display a warning. If it is using the fallback, you would need to use predefined stores just like with mobx to avoid expando props.
Edit: The API and the async nature would remain the same
from observer-util.
Sure, thanks for all the help and support you provided during my tryst with nx-observe. Its a wonderful library and I am eagerly hoping it sees wide usage.
We have been able to adapt our code to use MobX for the time being, but like I said, its not as transparent and so we have kept the dependencies to a minimum to allow us to switch over to nx-observe when RN starts supporting it.
from observer-util.
Ouch, Proxies can't be polyfilled. The polyfills are using getter/setters (just like mobx). This means that expando properties, delete operations and loops won't work. for of
loops can be hacked around to work, but the rest is impossible to do as far as I know.
from observer-util.
😯 the product I am working on aims to have cross platform flux store.
I am following up with RN team on this. Apparently, only Android devices and iOS 9 and lower are impacted. They use iOS8 JSC engine on Android, which doesn't have native Proxies among several other things. We cannot afford to lose Android platform.
Looks like JS disparities will never stop haunting us... Hate to look out for another store simply because I am stuck in a time where RN hasn't updated JSC in over two years...
The features which cannot be polyfilled are what give nx-observe the edge over Mobx. The only alternative I am left with is to go back to immutable based store which will screw up member access simplicity. Imagine store.auth.user
vs store.getIn(["auth", "user"])
. 😞
The greatest irony would be by the time the product is out, native Proxy maybe supported in some form in RN 😒.
from observer-util.
I know, it is really a struggle. I think your original issue with mobx (conditionals not being observed) is fixed though. It has nothing to do with proxies. Maybe you could give it another go.
from observer-util.
Compared to nx-observe, I find MobX complicated to work with. Things like expandos which are key to our application work ootb here, while we had several scary moments with extendObservable
. The fact is, Proxy makes meta programming much easier than earlier workarounds, plain and simple.
from observer-util.
I am closing this issue now. I will open a more general issue for partial legacy platform support when I have some time. (Full support for pre ES6 platforms is not possible.)
Thanks for opening it though, I didn't know that RN uses an old JSC on Android.
from observer-util.
Thx for all the support and bug finds. It was extremely helpful!
I will let you know, if I make some kind of legacy feature.
from observer-util.
Related Issues (20)
- Mutating observables in reactions is forbidden HOT 2
- 4.2.0 broke something HOT 3
- Trap "toJSON" to allow serialization of proxies HOT 2
- Deeply observe object HOT 12
- Documentation suggestion HOT 2
- Is it possible to receive the type of change when observing a value? HOT 9
- Observables arrays don't appear to observe correctly HOT 3
- Question about scheduler batching and observe optimizations. HOT 2
- Problem when changing whole objects HOT 1
- Understanding reactions HOT 1
- Angular 7 Integration HOT 1
- Not sure I'm understanding this at all HOT 4
- Object.defineProperty should trigger reactions HOT 3
- computed properties no cache? HOT 3
- Observing through a Proxy HOT 2
- `construct` trap fails for observed constructors HOT 1
- Bug or user error? Copying observable to other position in array converts it to the raw item
- should observe explicit array length changes
- Shallow observing HOT 1
- rawToProxy WeakMap.set is never called
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from observer-util.