Skip to content

Upgrade to backbone 0.9.1 and underscore 1.3.1 #43

@asparagino

Description

@asparagino

Hi - we've just put a few hours into upgrading our forked copy of bones to work with backbone 0.9.1 (latest) and underscore 1.3.1.

I'll attempt to add a patch to this comment, but the highlights follow below:

  1. Obviously the versions need to be bumped in Package.json
  •    "underscore": "1.1.x",
    
  •    "underscore": "1.3.x",
     "express": "2.4.4",
    
  •    "backbone": "0.5.1",
    
  •    "backbone": "0.9.1",
    
  1. in bones.js, set the server side jquery library into the imported backbone. Backbone now requires $ to be set, and the previous version was not loading it.

bones.js:
exports.Backbone = require('bones/server/backbone');
+exports.Backbone.setDomLibrary(exports.$);

  1. In plugin.js around lines 56/55 templates must now be passed to the client as a variable, as they're hidden using closure in the new _.template method.
  •            content: 'template = ' + module.exports + ';'
    
  •            // client must now pass escaped template content over, as _ makes it a hidden closure var
    
  •            content: 'var content = \''+escape(content)+'\';template = _.template(unescape(content));'
    

There are some changes to the example app that need to be made to work with these, but these 3 items are the show stoppers and only changes to the bones project core that we needed to make things work again. We made changes in our own app rather than updating the example, so unfortunately I can't share those, but the above should work as a leg up for anyone starting to upgrade the backbone version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions