ajax
ajax copied to clipboard
Are there any tests for this?
No, this is un-tested. I've also just started working on then-request which is a successor to ForbesLindesay/ajax and has a much cleaner, simpler API, rather than being a drop in replacement for jQuery.
It's very early days for the development of then-request, but it does mean that I'm unlikely to do much in the way of maintaining ForbesLindesay/ajax.
Is it possible that you keep this jQuerish API and just delegate everything to then-request? I've been looking for a minimalist drop in replacement for $.ajax without much luck.
What we have here does fill that role. If you would like to submit unit tests for this module I will merge them. If you want to maintain it, I'll happily add you as a contributor?
It may be possible to make this delegate to then-request and just be an adapter to create a jQuery-like API. I would suggest waiting until then-request is a bit more stable first though.
I hear you. Let me read some code first. I want to see how much this package covers $.ajax. Hopefully if my eyes haven't been gouged out yet after reading jQuery's code I can throw in some tests.
This doesn't return jQuery's broken promise thingy, but other than that I think it should be fairly complete.
Hi @ForbesLindesay, do you still want help pushing this forward?
:+1: for this being a thing.
then-request is now essentially complete. What I would now be keen for is to re-implement basically this functionality on top of that module, we can then build via browserify for client use and publish on npm for server side use (via the same API people are used to from jQuery). Unfortunately I just don't have the time to work on it at the moment, but I will review and accept pull requests that implement any of the following:
- Add a dependency on then-request
- Keep the jQuery style api but use then-request in place of all interactions with xhr
- Add tests for everything but jsonp that run in node.js (this should be relatively simple, since then-request works in node).
- Add travis-ci and all the badges to the readme (see then-request for an example)
- Remove info about component from the readme (and delete component.json)
- Fix build script in package.json to use
--standaloneand possibly produce an un-minified build as well. - Find a good way to add browser tests for the standalone build, including jsonp (perhaps using selenium)
- Factor jsonp out into a separate module that implements it on both server and client, then perhaps make this depend on that.
Also, if someone does a few of those, I'd be happy to add them as a contributor so they can review & merge other people's pull requests.