mbest / knockout-deferred-updates

Deferred Updates plugin for Knockout <=3.3.0
http://mbest.github.io/knockout-deferred-updates/
134 stars 23 forks source link

Breaks deferEvaluation computed bindings on IE10 with KO 3.1+ #28

Closed cstigler closed 9 years ago

cstigler commented 9 years ago

Starting with Knockout v3.1, the deferred-updates plugin breaks bindings to deferEvaluation computeds on IE10. The bindings are receiving the computed function itself, instead of the value. I have no idea why.

JSFiddle demo (open in IE10): https://jsfiddle.net/cstigler/Lge05opy/1/

That demo uses the latest releases of both Knockout (3.3) and deferred-updates (the current version on master on GitHub). It's broken for me in the official IE10/Win7 virtual machine provided at modern.ie. Weirdly, while it's 100% broken in Knockout 3.3, if I compile Knockout 3.2 using closure-compiler 0.2.0, this bug will not occur. But if I compile KO 3.2 using closure-compiler 0.2.1, it's broken (the official production build is broken).

So my best guess is that the newer versions of closure-compiler are removing something from the KO internals that deferred-updates needs, in this specific case.

mbest commented 9 years ago

Thanks for the report. I'll take a look at this soon.

mbest commented 9 years ago

Fixed.

cstigler commented 9 years ago

@mbest Thank you! I don't totally understand how that fix works, but I'm glad you do!

mbest commented 9 years ago

The problem stemmed from the fact that IE10 and below don't support setting the prototype using __proto__, which means that Knockout must copy properties instead. This makes the object signatures different from browsers that do support __proto__.

cstigler commented 9 years ago

Cool, thanks for the explanation.