New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for ender.js #322
support for ender.js #322
Conversation
Compatibility with Ender.js is usually defined on the Ender side of things, and not the libraries Ender targets. Just being a CommonJS-compliant module should be good enough for this. |
Do I get this right that you say any library which provides or will provide the basis for backbone must implement |
Sorry, didn't look at the commit closely enough -- you're quite right. |
Thanks, merged to master with some implementation tweaks at: 4070364 |
Thanks |
Am sorry, in my code I didn't use Backbone.sync, but we need to normalize $.ajax. I see the following differencies: |
I'm pulling out Ender.js support for the time being until the signatures of the ajax methods are normalized to what jQuery and Zepto use. There are also other areas where Ender needs to be tested with Backbone. It's not fully baked support yet, so it's better if we remove the Ender reference until the tests are in. Removed in 1d4484d |
np. i pinged ender.js guys a couple of days ago -- they added |
@samuelclay: can you at least leave |
argh. stupid jQuery signature is wrong. |
@ded What's the status of reqwest on this? Is there a clear path as far as the changes that should be made to reqwest? I would be happy to issue a pull request for whatever those changes are, if a decision can be made. |
Reqwest 0.4.0 brings a compat mode so Ender can now speak the strange alien language of jQuery/Zepto. $.ajax.compat({
url: 'path/to/data.json?foo=bar',
dataType: 'json',
contentType: 'application/json',
success: function() {
// whatever
}
}); or to install this as the default mode then put this at the top of your code somewhere: $.ajax.compat && $.ender({ ajax: $.ajax.compat }); See the readme or source for gory details. A Backbone user may want to confirm that all is well in the Backbone/Ender love nest? For best compatibility it may be good to do this in return ($.ajax.compat || $.ajax)(_.extend(params, options)); or, better still create a reference to it at init so it's not checked each time: var $ = root.jQuery || root.Zepto || root.ender;
var $ajax = $.ender && $.ajax && $.ajax.compat ? $.ajax.compat : $.ajax; and use |
Please, consider applying.
TIA,
--Vladimir