Uploaded image for project: 'Documentation'
  1. Documentation
  2. TIDOC-1895

Alloy: Models & Collections: Update docs to reflect Backbone 1.1.2 support

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 4.0.0
    • Component/s: Guides
    • Labels:
      None
    • Story Points:
      21
    • Sprint:
      2015 Sprint 01 Documentation

      Description

      Alloy 1.6 will add support for Backbone 1.1.2. However, because of breaking changes in Backbone, 0.9.2 will remain the default for version the 1.6.0 release. (Future versions will make 1.1.2 the default, deprecate 0.9.2, and eventually remove support for 0.9.2.)

      A new config.json key has been added to specify that an app uses 1.1.2. Add

      "backbone": "1.1.2"

      Supported versions are 0.9.2 and 1.1.2.

      Due to breaking change in the Backbone library, existing apps may not run without modification. Backbone changes that must be accounted for:

      • Passing {silent:true} suppresses change:attr events entirely, thus a data-bound view will not be updated to reflect the changes. The sql sync adapter passed this option by default. It has been updated to no longer pass that option when Backbone 1.1.2 is used (still passed with 0.9.2). If you want the new behavior, you will need to pass this option with each fetch() or extend the collection.
      • Backbone collections no longer emit the 'reset' event after fetch, which means data-bound views will not update automatically after a fetch(). This could break existing apps. To use old functionality, pass {reset: true} when calling fetch() or extend the collection. The following sample code to extend the collection (commented out) has been added to the new-model template.

      // For Backbone v1.1.2, uncomment the following to override the
      // fetch method to account for a breaking change in Backbone.
      /*
      fetch: function(options) {
      	options = options ? _.clone(options) : {};
      	options.reset = true;
      	return Backbone.Collection.prototype.fetch.call(this, options);
      }
      */
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bhatfield Benjamin Hatfield (Inactive)
                Reporter:
                skypanther Tim Poulsen
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration