fix(ArrayObservation): ensure patch applied only once#704
fix(ArrayObservation): ensure patch applied only once#704EisenbergEffect merged 3 commits intoaurelia:masterfrom
Conversation
|
Suggest to log an error in console if it detects already patched, explain possible cause (3rd party plugin), and provide a link to suggested solution. Because duplicated aurelia-binding will inevitably introduce weird bug even without duplicated patch on Array.prototype. |
|
@huochunpeng nice suggestion 👍 |
|
I love this idea. One change: could you switch the lookups back to using property access instead of array access? That will probably cause a perf change and since this is a hot code path, I'd rather not change that. |
|
@EisenbergEffect done |
|
Thanks! |
|
Just a reminder that this change should be merged back into v1 in a minor or patch release to work properly😁 |
@EisenbergEffect Did this go into v1 too? @bigopon nice one! :) |
|
working on a 1.7.2 release with this same fix |
fix(ArrayObservation): ensure patch applied only once
|
1.7.2 and 2.1.3 both published with this fix. |
Things may still go horribly wrong if one ended up having two versions of
aurelia-bindingin the final bundle, but at least array patching won't happen twice. Also trim some unnecessary fat outEdit: this will work as long as there is no difference between v1 and v2
ModifyArrayObserver/ModifyCollectionObserver@EisenbergEffect Should we also replace global
karma startwith npm script ?resolves #699