afeld / backbone-nested

A plugin to make Backbone.js keep track of nested attributes - looking for maintainers! https://github.com/afeld/backbone-nested/issues/157
https://afeld.github.com/backbone-nested/
MIT License
445 stars 83 forks source link

Use _.extend instead of $.extend for node.js compatibility #124

Closed alebedev closed 9 years ago

alebedev commented 9 years ago

deepClone currently uses jQuery.extend. This makes library dependent on jQuery when Backbone model layer only depends on underscore. jQuery dependency makes using model code on server problematic. Could you replace jQuery.extend with _.extend?

afeld commented 9 years ago

No, because _.extend doesn't support deep clones. Loading the jQuery module in Node shouldn't be problematic... what issue are you having?

tomhicks commented 9 years ago

I'm sure the issue is more a semantic and code cleanliness thing than not actually being able to load jQuery as a dependency. I agree with @alebedev here: no model should depend on a DOM manipulation library. I would go as far as saying if you need a deep extend, that you implement it within this library.

afeld commented 9 years ago

I would consider a PR (depending on how much code it adds), but otherwise chalking this up as "if it ain't broke..."