-
-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Ember.ObjectProxy and Ember.ArrayProxy Public (not private) #80
Comments
I would actually like to at least see an addon that restores all the ArrayController / ObjectController / reduceComputed / ObjectProxy / ArrayProxy etc. behavior. This could really help some enterprises with large codebases move to 2.0 at some point in the current century. :) |
@Gaurav0 there is an addon for controllers (ember-legacy-controllers) and views (ember-legacy-views). array/reduce computed are gone, but the macros that represented nearly all of the usage are still present. Just the direct API access to the array/reduce computed classes is gone. Please keep this issue focused on the original topic, object and array proxies. |
👍 I use both ArrayProxy and ObjectProxy on occasion. I think quite a few people also use ember-buffered-proxy which relies on them. |
We also use ObjectProxy and ArrayProxy with the PromiseProxyMixin in places where ED doesn't make sense. Our PromiseArray is as simple as import Ember from 'ember';
export default Ember.ArrayProxy.extend(Ember.PromiseProxyMixin); |
See: RFC/issue emberjs#80 - emberjs/rfcs#80
Wait, I see some changes already: So ObjectProxy is already public, nice. Just need ArrayProxy to be public as well |
One caveat with ObjectProxy is that it is not compatible with removing Ember.get in favor of ES5 getters. |
@pixelhandler I've merged emberjs/ember.js#11970, should this be closed then or are there additional parts to discuss? |
@mixonic awesome thank you sir! all set, closing this up 👍 |
See: RFC/issue emberjs#80 - emberjs/rfcs#80 (cherry picked from commit 97e4441)
See: RFC/issue #80 - emberjs/rfcs#80 (cherry picked from commit 97e4441)
@mixonic @mmun is that why http://emberjs.com/api/classes/Ember.ObjectProxy.html is Private and http://emberjs.com/api/classes/Ember.ArrayProxy.html Public (I use these alot with http://emberjs.com/api/classes/Ember.PromiseProxyMixin.html which is also Public) |
@pixelhandler - |
Ember.ObjectProxy
andEmber.ArrayProxy
are great to use in combination withEmber.PromiseProxyMixin
like Ember Data uses them. However ObjectProxy and ArrayProxy are marked Private API.It would be great for addon developers and app developers alike to be able to use ObjectProxy and ArrayProxy combined with Ember.PromiseProxyMixin to compose attributes of an object that depend on promises e.g. XHR.
Please make ObjectProxy and ArrayProxy public API. I don't believe this combo is only unique to Ember Data. Anyone writing custom data persistence benefits from the same pattern as Ember Data does. Why does this need to be private API?
I understand ObjectController and ArrayController are deprecated and extend ObjectProxy and ArrayProxy respectively. I understand the confusion for new developers using those proxied controllers and I understand that Controllers will be replace with Components in 2.0. However I don't see why the ObjectProxy and ArrayProxy need to be private API.
Is there another way to use PromiseProxyMixin aside from combining a proxy object/array?
Below is the use case I have for a data persistence library…
A utility object (RelatedProxyUtil) with a factory creates proxies, to be used in a computed property:
A helper that uses the proxy util and returns a computed property:
The text was updated successfully, but these errors were encountered: