Avoiding to checkchanges on sub Backbone.Models/Collections #139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While using Backbone.ModelBinder in correlation to backbone-nested, I encountered some weird chrome errors :
When I investigated further, I saw that
backbone-nestedwas generating lots ofcheckChanges()calls due to paths looking like :myrootmodel.attributes.mysubcollection.models.0.attributes.mysubsubcollection.models.0._events.change:anAttribute.0.context.view.regionManager._regions.MyRegion.$el.prevObject.0.lastElementChild.lastElementChild.lastElementChild.contentWindowIt was 1 of these calls which was calling an unauthorized call (from a chrome POV) on
HTMLInputElement.To fix this issue, I propose to avoid calling
checkChanges()on nested objects of typeBackbone.ModelorBackbone.Collection: it seems reasonable to me since it will avoid to declare a huge amount of watchers on complexBackbone.Modelhierarchy.WDYT ?