[ALOY-1075] Confirm existing adapters support Backbone 1.x

GitHub Issuen/a
Resolution Date2014-10-24T05:34:12.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.6.0
ComponentsModels, Tooling
ReporterTim Poulsen
AssigneeFeon Sua Xin Miao


Specifically, check Mads' REST adapter. Provide guidance on updating adapters that don't work.


  1. Timan Rebel 2014-08-21 Can confirm from experience that Mads' REST adapter is working with Backbone 1.x. What would be nice however is to add a REST adapter to Alloy, based upon Backbone's own sync method.
  2. Feon Sua Xin Miao 2014-09-17 Looked at backbone version 0.9.9, 0.9.10, 1.0.0, 1.1.0, 1.1.1 and 1.1.2. Model apps in the test directory are affected by following changes that break backwards compatibility: *v0.9.10* {quote} Passing \{silent:true\} on change will no longer delay individual "change:attr" events, instead they are silenced entirely. {quote} So silent:true suppresses the change:attr events entirely, view is not updated to reflect the new changes . This could be fixed by remove silent option in adapter. *v1.0.0* {quote} Renamed Collection's "update" to set, for parallelism with the similar model.set(), and contrast with reset. It's now the default updating mechanism after a fetch. If you'd like to continue using "reset", pass \{reset: true\}. {quote} This means that Backbone collections do not emit 'reset' event after fetch, so to use old functionality, pass {reset: true}when calling collection#fetch() will work with existing sql adapter. OR override the fetch method in the model JS file:
           extendCollection : function(Collection) {
               _.extend(Collection.prototype, {
       			fetch: function(options) {
       				options = options ? _.clone(options) : {};
       				options.reset = true;
       				return Backbone.Collection.prototype.fetch.call(this, options);
               return Collection;
  3. Tim Poulsen 2014-09-19 This change will mean existing apps could break unless they are updated. Therefore, I recommend that we * Continue with Backbone 0.9.x as the default in Alloy 1.6 * Provide optional support for 1.1.2 in Alloy 1.6 -- include it, enable setting the version in config.json, and document the new requirements for models if a developer chooses to enable it * Deprecate 0.9.x in Alloy 1.6 -- update the docs, include in release notes * Change to 1.1.2 as the default in 1.7 but continue to ship 0.9.x for backward compatibility
  4. Feon Sua Xin Miao 2014-09-24 ALOY-1074 implements the change.
  5. Tim Poulsen 2014-10-23 Reopen to backport to 1_6_X branch
  6. Eric Wieber 2015-03-25 Verified fixed using: Titanium SDK 4.0.0.v20150323131014 Studio Appc NPM: 0.3.34 Appc CLI 0.2.187 Alloy 1.6.0-alpha Adaptors working as expected using backbone 1.1.2.

JSON Source