[ALOY-576] Upgrade to Backbone 1.0
|Assignee||Feon Sua Xin Miao|
- Far 2014-05-19 Any news? Backbone is 1.1.2 already/
- Andrew McElroy 2014-05-19 So i bugged Tony about this at tiConf NY. If you really have to have backbone version X >= 1.0 then do the following create a directory at the root of your alloy project called lib. then do the following lib/alloy/backbone.js clean and compile your project. congrats. I haven't ran alloy through all its paces to know if that breaks anything, but it didn't appear to break models (which was my motivation), nor views or controllers.
- Tony Lukasavage 2014-05-19 [~sophrinix] is right. The only thing I'm aware of off-hand is that it will likely break the sql adapter. We will try to work this ticket into a version soon, but this workaround should suffice in the meantime.
- Far 2014-05-19 Yep. I tried to replace old backbone with new but it broke sql adapter.
- Timan Rebel 2014-05-23
I grew so frustrated with BackBone 0.9.2 that I decided to fix it myself. I downloaded the latest backbone.js and placed in lib/alloy
The SQL adapter was indeed the problem and the following line is causing the crashes:
(line 176) Backbone 1.0+ does also remove and update models in a collection, not only adds them. It uses the length of the Collection before the fetch, to determine whether and which models need to be deleted. By setting the length of the Collection in the sync adapter, this functionality breaks. The real issue with upgrading will probably lie in the implementation of the developers using Alloy, because several events have changed as well. It's a breaking upgrade for some. If you do want to start using BackBone 1.0+, remove the mentioned line.
model.length = len;
- Tim Poulsen 2014-09-26 This is resolved by ALOY-1074 and its related tickets (e.g. ALOY-1075, ALOY-1148)