Skip to content

Migration steps needed #8

@mmahmood

Description

@mmahmood

Hi,
This is not really an issue. I need help on how to use your code.

I need to migrate my Parse.com app to Parse server now. I am done with the cloud code part, and now need to migrate a Parse-backbone website which was built using Parse JS SDK version 1.3.5. I am looking into my options at the moment. I am using requireJS. Can you please give me simple guidelines to migrate using backbone-parse-es6.
Here's my structure/ code:

Model:

define([
  'parse'
], function(Parse) {
    var InboxObject = Parse.Object.extend("Inbox",{
    initialize: function() {
    }
  });
  return InboxObject;
});

Collection:

define([
  'parse',
  'js/models/inbox'
], function(Parse, InboxObject) {
  var InboxCollection = Parse.Collection.extend({
    model: InboxObject
  });
  return InboxCollection;
});

View:

define([
  'jquery',
  'underscore',
  'parse',
  'js/models/inbox',
  'text!templates/inbox/detailsDialog.html'
], function ($, _, Parse, Inbox, DetailsDialogTemplate) {

    var DetailsDialogView = Parse.View.extend({
      template: _.template(DetailsDialogTemplate),

      el: "#messageDetailViewModal",

      initialize: function() {
        this.render();
        return this;
      },

      events: {
        "click .close": "close",
        "click .cancel": "close",
        "hidden.bs.modal #messageDetailViewModal": "close",
      },


      render: function() {
        var self = this;     
        inboxQuery = new Parse.Query(Inbox);
        inboxQuery.get(this.options.objectId).then(function(inbox){
              // some DB operations
        }, function (error) {
            // report error
        });
        return this;
      },

    });
    return DetailsDialogView;
});

What changes do I need to make if I simply replace parse.js reference with your backbone-parse-inclusive.js? You will save my hours if you assist me in that.

Thanks!
-Mariam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions