-
Notifications
You must be signed in to change notification settings - Fork 116
Chrome 50 breaks this lib #130
Comments
Could you provide a minimal test case that breaks so we can confirm if this is the case? Are there any exceptions in particular being thrown when using it? |
var obj = { foo: 1 };
var observer = new PathObserver(obj, 'foo');
observer.open(function(newValue, oldValue) {
console.log(newValue, oldValue);
});
var obj = { foo: 2 }; The console.log is not called on change, and no there was to errors |
I tested that a work on a Window and Linux, haven't tried on a mac |
I confirm this. ArrayObserver is not working too. In Chrome 50 and FF 44/45 on Windows. var errorFields = [],
observerErrorFields = new ArrayObserver(errorFields);
observerErrorFields.open(function (splices) {
alert("it's work!");
});
errorFields.push("item"); alert is not called on change, and no there was to errors |
I think this problem is caused by problem described in #127 issue |
So what's our alternative ? Is there a any other trick for observing objects ? |
@Bretto @fakrex thanks for confirming. I personally recommend using https://github.com/MaxArt2501/object-observe (for the time being) until it's more clear what the support strategy around the observe-js shim is moving forward. I'm happy to review PRs that attempt to address breakage in Chrome 50 if there are folks actively relying on this for production apps. |
+1 |
@addyosmani Thanks for your comment. If we look at both libraries there are some discussions back and forth comparing the As I can gather (correct me if I am wrong), this library was / is used by Polymer (at least during the 0.5 era) to implement Data Binding. From your comment, can it be inferred as though this not currently used by the Polymer team? If not, how is Polymer (1.0) now checking for property changes? We have built a library around observe-js and that powers multiple apps / sites in production. A rough indication on the road ahead for this library would be super! 👍 |
See: #131. Can a check not be included at the time of library inclusion to display a warning that a manual call is needed? |
Hello, from the source code and the Polymer framework source code, I found the reason. The object-observe is based on dirty check, so we should setup up the loop for object observation and change notification. For example, in Polymer framework, at the end of the file
So, when we use this polyfill for our project, we need manually call for the dirty check.Such as |
After updating to Chrome 50 we are not notified of object changes anymore
The text was updated successfully, but these errors were encountered: