Skip to content

Releases: yahoo/fetchr

Fix `xhr` module interface and allow for xhr retries

18 Dec 01:56
Compare
Choose a tag to compare

Upgrading xhr to 2.0.0 broke the interface in the previous version. Fixed now.

Retry logic was never being called. Fixed now.

Updated xhr module to 2.0.0

17 Dec 23:10
Compare
Choose a tag to compare
  • xhr v2.0.0 adds ie8 support

Lodash

13 Dec 00:45
Compare
Choose a tag to compare

We now depend of lodash proper instead of all the lodash micro-libraries.

Remove unused `crumb`

04 Dec 02:13
Compare
Choose a tag to compare
  • Crumb was a special case used internally and so has been removed from code
  • Documentation updated to show how to do CSRF protection generically

Dependency Updates

26 Nov 22:53
Compare
Choose a tag to compare
v0.4.1

0.4.1

`delete` everywhere

13 Oct 17:53
Compare
Choose a tag to compare

We had backwards compatibility for del method but for sanity's sake we removed all traces of it. So now users can only use delete methods on the client/server fetcher interface as well as the data-fetchers' interfaces.

Thanks @ptomasroos

Change `del` method to `delete`

06 Oct 17:27
Compare
Choose a tag to compare

We used del as the delete operation method but we have now standardized the name to delete. So now the CRUD (create, read, update, and delete) methods are all trivial to spell and use.

Feature: Custom http status codes support

03 Oct 18:43
Compare
Choose a tag to compare

Data-fetchers can specify an HTTP error statusCode (400, 404, etc) by tacking on a statusCode property to the error object passed into the callback. If the statusCode property exists on the error object, fetcher middleware will use that HTTP response code.

Data-fetchers can now pass a 3rd meta parameter to their CRUD callbacks. If meta.statusCode is set, then fetcher middleware will use that HTTP response code.

Thanks to @mtscout6 for noticing and implementing this in #22.

Bugfix: Better error handling

01 Oct 22:55
Compare
Choose a tag to compare

Fixed an issue where middleware didn't stop after throwing error. See #18 for more details.

Module export format changed to Fetchr Class

11 Sep 17:58
Compare
Choose a tag to compare

Breaking changes:

  1. Fetchr now exports the class itself, rather than the class creating factory function.

    var Fetcher = require('fetchr')(), //Fetcher class
        fetcher = new Fetcher(); //Fetcher instance

    now becomes

    var Fetcher = require('fetchr'), //Fetcher class
        fetcher = new Fetcher(); //Fetcher instance
  2. addFetcher method renamed to registerFetcher. This is to keep the api somewhat consistent between fetchr and dispatchr.

  3. Fetcher.middleware() should no longer be mounted directly on the app. It should always be mounted on a path.

    app.use(Fetcher.middleware());

    now becomes

    app.use('/api', Fetcher.middleware());
  4. pathPrefix config option renamed to xhrPath.

    • This config option used to be passed into the class creator function, but is now passed into the class upon instantiation.
    • This option's value should point to the exact path the Fetcher.middleware() was mounted on.