An update on Object.observe

Andrea Giammarchi andrea.giammarchi at gmail.com
Tue Nov 3 13:09:59 UTC 2015


Just to be clear:

  1. I am very happy O.o is gone
  2. in my experience it's repeatedly clear that whatever proposal that
cannot be polyfilled will have hard time to be widely adopted.

As example, O.o has never been in other browsers so, unless you are
targeting Chrome and Chrome only, it's kinda a bad choice. Maybe it would
have been adopted more if it was cross platform?

Who knows, and let's move forward!

Best Regards



On Tue, Nov 3, 2015 at 11:26 AM, Alexander Jones <alex at weej.com> wrote:

> In my opinion, the fundamental record type we build our JS on should be
> getting dumber, not smarter. It feels inappropriate to be piling more
> difficult-to-reason-about mechanisms on top before reeling in exotic host
> objects. With Proxy out of the bag, I'm not so hopeful for the humble
> Object anymore.
>
>
> On Tuesday, 3 November 2015, Andrea Giammarchi <
> andrea.giammarchi at gmail.com> wrote:
>
>> Sure thing, meanwhile polymer or other libraries need to pollute getters
>> and setters and the rest of the web have been trying to polyfill it for at
>> least 6 years now *
>>
>> The reason is not widely "abused" is that it never made it as standard
>> and as it is feels like an outdated spec. Proxy would give us that and much
>> more, unfortunately proxies do not play so well cross environment. For
>> instance, I've tried to use them in GJS ( Gtk+3 JavaScript bindings ) and
>> while Object.prototype.watch always works, proxied GObjects fail to be used
>> like these were just GObjects.
>>
>> That might be a specific env problem though, but having a way to watch
>> properties, specially in two ways bindings scenarios, is a very needed
>> common thing.
>> As example, in DOMClass I'm replacing native getters/setters to be
>> notified about changes, it doesn't feel right even if it works.
>>
>> All this is over-off-topic though, so I might just stop.
>>
>> Best Regards
>>
>>
>>
>> * just few examples since 2009
>> https://gist.github.com/eligrey/384583
>> https://gist.github.com/adriengibrat/b0ee333dc1b058a22b66
>> question in SO
>> http://stackoverflow.com/questions/1029241/javascript-object-watch-for-all-browsers
>> http://deploytonenyures.blogspot.co.uk/2013/02/objectwatch-polyfill.html
>>
>> https://code.google.com/p/chtor/source/browse/chtor/chrome/js/object-watch.js?spec=svn2c00820d48169bb678a00447e295fb31dcf448ed&r=2c00820d48169bb678a00447e295fb31dcf448ed
>>
>> yes, I've done that too
>> in 2009
>> http://webreflection.blogspot.co.uk/2009/01/internet-explorer-object-watch.html
>> and recently https://gist.github.com/WebReflection/366dc38574dc526308b5
>>
>>
>>
>> On Tue, Nov 3, 2015 at 2:11 AM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
>>
>>> On 11/2/15 4:55 PM, Andrea Giammarchi wrote:
>>>
>>>> I agree with Benoit and I think there is a reason
>>>> `Object.prototype.watch` is still in Firefox and  won't go away any time
>>>> soon
>>>>
>>>
>>> As far as I know the only reason it's there and hasn't been removed is
>>> because it's used to implement debugger watchpoints [1].  And the only
>>> reason it's web-exposed is because SpiderMonkey has not prioritized being
>>> able to expose APIs to privileged code but not the web (something that
>>> think should get fixed).
>>>
>>> -Boris
>>>
>>> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=934669
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss at mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151103/0a635fce/attachment.html>


More information about the es-discuss mailing list