Releases: dhruvaray/backbone-associations
Releases · dhruvaray/backbone-associations
Backbone-Associations : v0.6.2
- Introducing
collectionOptions
- Can be an options hash or a function which returns an options hash. These options will be utilized while instantiating a new collection of typecollectionType
- Allow leaf nodes of the object graph to be simple Backbone.Model(s) as well.
- Set
parents
property eagerly, so that it is available in the childreninitialize
at the time of graph creation. - Bug fix : Remove references from parents during re-assignment and model
destroy
operations (Issue #111 & #114) - Bug fix : Check for existence (rather than value) for
idAttribute
(Issue #112) - Bug fix : Check for null/undefined v/s legitimate false value scenarios (Issue #137)
- Bug fix : Checks for maps returning null values (Issue #133)
Backbone-Associations v0.6.1
- Bug fix : Add underscore as explicit dependency for BB-Associations in the node.js environment.
- Compatible with Backbone.js v1.1.2.
Backbone-Associations v0.6.0
- Significantly improve event bubbling performance. Only bubble events if objects are listening to those event paths.
- BREAKING CHANGE : nested-change events are not fired by default. To switch them on set Backbone.Associations.EVENTS_NC = true at any point in your application flow.
collectionType
can be a function as well. This makes the API ofrelatedModel
andcollectionType
uniform.- Added support for specifying global scopes. When
relatedModel
andcollectionType
are specified as strings, the global scopes will also be searched for locating the model definition. - Additional attribute -
scope
- can now be specified while defining a relation. Use to it define the scope ofrelatedModel
andcollectionType
string. - Additional attribute -
serialize
- can now be specified while defining a relation. Use this attribute to set an array of attributes (singleton or subset) which will be serialized to the server end-point. - Compatible with Backbone.js v1.1.1.
Backbone-Associations v0.5.5
- Improve event bubbling performance for large object graphs.
- Introduces flags to switch off/on events. Set Backbone.Associations.EVENTS_WILDCARD = false to stop throwing wild-char events. Set Backbone.Associations.EVENTS_NC = false to stop throwing nested-change events. Set Backbone.Associations.EVENTS_BUBBLE = false to conditionally stop events from bubbling up. May be useful when constructing complex object (sub) graphs. After construction the value can be set to true. Note that all of these flags can be toggled at any time during the application flow.
- Introduces isTransient flag to avoid serializing the particular attribute in toJSON().
- Introduces remoteKey for serializing relations to a different key name. Useful in ROR nested-attributes like scenarios.
Backbone Associations v0.5.4
Backbone Associations v0.5.3
Backbone Associations v0.5.2
- Bug fix : Nested collections re-use references.
- Bug fix : Propagate user defined options for nested-change events.
- Bug fix : In a cycle scenario, a call to toJSON inside an event handler would not create the right JSON.
- Increase error handling so that users will not trip up when they mis-type or enter wrong values during relation defintions.
- The map function is now called with a specific AssociatedModel instance (as context). It takes in an additional paramter - which specifies the type of the relatedModel or Collection type. Could be useful in scnearios when you want to generalize the map function across relation types. See this recipe.
- For cycle scenarios, the toJSON method serializes with {id:value} when it detects a cycle. This is a good default. Users can over-ride if necessary. See this recipe.