Skip to content

Releases: suhaotian/xior

v0.6.1

27 Aug 23:54
Compare
Choose a tag to compare
  • Fix: response interceptors should run only once with error-retry plugin

Full Changelog: v0.6.0...v0.6.1

v0.6.0

27 Aug 14:43
Compare
Choose a tag to compare
  • Fix: response interceptors should run after plugins(Fix #29)

Full Changelog: v0.5.5...v0.6.0

v0.5.5

18 Jul 15:38
Compare
Choose a tag to compare

Change

  • Refactor: content-type detecting code improve and decrease size

Full Changelog: v0.5.4...v0.5.5

v0.5.4

18 Jul 07:47
Compare
Choose a tag to compare

feat(core)

  • feat(core): Support URLSearchParams Fix issues/26

Full Changelog: v0.5.3...v0.5.4

v0.5.3

09 Jul 12:20
Compare
Choose a tag to compare
  • Fix(core): RangeError: Invalid time value. ref issues/23

v0.5.2

09 Jul 03:55
Compare
Choose a tag to compare
  • Fix(core): if params include Date value, call .toISOString() and utils encodeParams support options allowDot: true and arrayFormat: 'indices' | 'repeat' | 'brackets'(default is 'indices'). Fix issues/22 and issues/23

Code example:

import xior, { encodeParams } from 'xior';

const filter = {
  ids: [1, 2, 3],
  dateFrom: new Date(),
  dateTo: new Date(),
};

const http = xior.create({
  paramsSerializer: (params: any) =>
    encodeParams(params, true, null, {
      allowDots: false,
      arrayFormat: 'indices', // 'indices' | 'repeat' | 'brackets'
      serializeDate: (date) => date.toISOString(),
    }),
});

/* 
'indices': { a: ['b', 'c'] } -> 'a[0]=b&a[1]=c'
'brackets': { a: ['b', 'c'] } -> 'a[]=b&a[]=c'
'repeat': { a: ['b', 'c'] } -> 'a=b&a=c'
*/

http.get('https://example.com', { params: { filter } });

Full Changelog: v0.5.1...v0.5.2

v0.5.1

28 May 06:08
Compare
Choose a tag to compare
  • Feat(core): if request config withCredentials: true, before useless, now will set fetch config to credentials: 'include'. Fix issues/19

Full Changelog: v0.5.0...v0.5.1


Thanks @guoyunhe

v0.5.0

19 May 10:19
Compare
Choose a tag to compare

This is a breaking change:

  • Feat(core): The xior class should be CapitalCase, like: Xior. Fix issues/18

Migration

If you always use import xior from 'xior';, you can ignore migration code below.

Before:

import { xior } from 'xior';

Now:

import { Xior } from 'xior';

Thanks

Thanks @guoyunhe feedback 🙌!

Full Changelog: v0.4.3...v0.5.0

v0.4.3

02 May 01:12
Compare
Choose a tag to compare
  • revert minor improvement(unnecessary)

Full Changelog: v0.4.2...v0.4.3

v0.4.2

02 May 00:41
Compare
Choose a tag to compare
  • Feat(new plugin): add token refresh plugin
  • Chore: Update README
  • Refactor: minor improvement

Full Changelog: v0.4.1...v0.4.2