Upgrade to backbone 0.9.1 and underscore 1.3.1

Offen
#43 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
30/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
express, javascript
Bereich
full-stack, web-dev

Rechercherichtung

Überprüfe zuerst package.json, bones.js und plugin.js und untersuche anschließend die Beispielanwendung auf Kompatibilitätsprobleme. Verifiziere die Abhängigkeitsversionen und die drei im Issue beschriebenen Kernänderungen und bestätige, dass die Beispielanwendung mit den aktualisierten Backbone- und Underscore-Versionen funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
JavaScript
Sterne
481
Forks
39
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus developmentseed/bones

Alle Issues in developmentseed/bones

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.