News for hackers. Stuff that matters.
Re:Object.observe withdrawn from TC39 by lyschoening on Monday November 02, 2015 @03:29PM (#10494960)
Re:Object.observe withdrawn from TC39 by toomim on Monday November 02, 2015 @06:31PM (#10496177)
Indeed, Proxy always seemed like the more general version of Object.observe. It not only "tells you when state changes", but lets you write code to say what that means.

What's the state of Proxy? Are the people behind it still working on it? Are we going to be able to use it? Will it be fast?

Re:Object.observe withdrawn from TC39 by thomasfoster96 on Monday November 02, 2015 @06:37PM (#10496208)
Proxy has already been standardised (in ES6) so it should be coming into browsers soon. It's a little harder to polyfill than O.o though.
Re:Object.observe withdrawn from TC39 by AnkhMorporkian on Monday November 02, 2015 @08:41PM (#10496795)
As far as I know Proxy is impossible to polyfill. There are some patches which make old browser versions of Proxy meet the spec, but I just don't think you can close the Proxy gap with pure javascript.
Re:Object.observe withdrawn from TC39 by pipeep on Tuesday November 03, 2015 @12:16AM (#10497710)
It's possible if you also translate all of the code that uses the polyfilled object by converting every MemberExpression to a function call, but that's probably a nightmare for performance.
Re:Object.observe withdrawn from TC39 by bcherny on Tuesday November 03, 2015 @04:45PM (#10502938)
what happens when i add a property to the object that i'm proxying after the Proxy is already instantiated? you wouldn't be able to detect the addition and add getters/setters for the property unless you use some sort of O.o or dirty checking on the underlying object.

see https://github.com/bcherny/auditable for an implementation, sans O.o.

Re:Object.observe withdrawn from TC39 by pipeep on Sunday November 08, 2015 @11:32PM (#10531409)
If you intercept every MemberExpression on every object, you can solve this (with the exception of eval), but as I said, it would be incredibly slow.
Re:Object.observe withdrawn from TC39 by iamleppert on Wednesday November 04, 2015 @03:11PM (#10509275)
This looks crazy and way more complicated than I would ever want.