gmac / backbone.epoxy

Declarative data binding and computed models for Backbone
http://epoxyjs.org
MIT License
615 stars 89 forks source link

Backbone 1.1 support #57

Closed rubenstolk closed 10 years ago

rubenstolk commented 10 years ago

As far as I can see, there is only one issue preventing Epoxy to work with Backbone 1.1 which is the use of constructor overriding for the binding. In Backbone 1.1 we should use the initialize method, something like:

/* REPLACED constructor with initialize

    // Backbone.View constructor override:
    // sets up binding controls around call to super.
    constructor: function(options) {
        _.extend(this, _.pick(options||{}, viewProps));
        viewSuper(this, 'constructor', arguments);
        this.applyBindings();
    },

*/

    initialize: function() {
        this.on('afterRender', function() {
            this.applyBindings();
        }, this);
    },
Prinzhorn commented 10 years ago

What error do you get? Because I am using Backbone 1.1 for a new project and haven't had any problems in the past days with epoxy.

rubenstolk commented 10 years ago

I realize that it must be the combination with Backbone.LayoutManager. Whoever would properly marry LM and Epoxy would be the hero!!!

BR, Ruben Stolk

+919561050034 +31646118037 On Dec 29, 2013 5:23 PM, "Alexander Prinzhorn" notifications@github.com wrote:

What error do you get? Because I am using Backbone 1.1 for a new project and haven't had any problems in the past days with epoxy.

— Reply to this email directly or view it on GitHubhttps://github.com/gmac/backbone.epoxy/issues/57#issuecomment-31315724 .

gmac commented 10 years ago

Sorry @rubenstolk, the union of dissimilar plugins is not an appealing prospect as a library developer... It's the wild-west once you go above the base library, and everyone is on their own release schedule.

worldjoe commented 10 years ago

I have a fix for this in layoutmanager. https://github.com/tbranyen/backbone.layoutmanager/pull/442

gmac commented 10 years ago

Okay, cool – although just for the record, this is the Epoxy community trying to resolve differences, not me trying to impose control over LayoutManager... that could make a really awkward conversation with Tim (@tbranyen) this year at BackboneConf!

worldjoe commented 10 years ago

I'll let Tim know you told me to do it. just kidding of course.

Seriously though, never heard of BackboneConf. I was planning on going to Roost and JQuery in September. Oddly the website says "Coming July 2014", but has no location nor signup page.

gmac commented 10 years ago

Yeah, they did a super late signup last year as well... they may have announced that tentative date six months ago or something.

worldjoe commented 10 years ago

My pull request has been accepted by Tim. :) Now you can use Epoxy with LayoutManager.

tbranyen commented 10 years ago

Yup, I'll be pushing out a 0.10 release very soon. I need to do some housekeeping, but you should be able to use master for now.

rubenstolk commented 10 years ago

You guys are all pretty awesome...