[ALOY-576] Upgrade to Backbone 1.0
GitHub Issue | n/a |
---|---|
Type | Epic |
Priority | Medium |
Status | Resolved |
Resolution | Duplicate |
Resolution Date | 2014-09-26T14:48:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Models, Runtime |
Labels | notable |
Reporter | Tony Lukasavage |
Assignee | Feon Sua Xin Miao |
Created | 2013-03-20T12:45:54.000+0000 |
Updated | 2015-04-13T16:26:56.000+0000 |
Any news? Backbone is 1.1.2 already/
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.
[~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.
Yep. I tried to replace old backbone with new but it broke sql adapter.
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.
This is resolved by ALOY-1074 and its related tickets (e.g. ALOY-1075, ALOY-1148)