Releases: apicase/core
v0.15 release
Migration guide
Removed APIs
Removed Requests+
As we said before, Requests+ features are totally removed in 0.15.
Passing options
won't do anything.
Removed ApiQueue
After Spawner API release, there are no need in ApiQueue
because of duplicated logic.
Removed ApiService
ApiService
is now totally removed from @apicase/core
package. Use @apicase/services
instead.
v0.14 release
New package
Check out @apicase/spawner package that helps you better organise requests queues and create debounced requests.
Deprecations
Requests+ features are now deprecated
Use @apicase/spawner instead
ApiService
moved from @apicase/core
to @apicase/services
Core still has ApiService
but will be totally removed in 0.15.
Also, new ApiService(adapter, options)
syntax is no longer supported in @apicase/services
NOTE: These changes are compatible with previous version.
You'll get soft warnings with migration info.
Backward compatibility will be broken in 0.15
v0.13 release
New features
Service.use(cb)
- calls cb
with a copy of service and returns its result (#14)
You can now move part of logic in "plugins"
Bug fixes
Returned retry
method for fail hooks (#19)
Deprecations
ApiService
now accepts adapter
as a property of options instead of first argument:
- new ApiService(fetch, {
+ new ApiService({
+ adapter: fetch,
url: '/api'
})
You'll get a soft warning. In future releases, it won't work.
It was made to allow changing adapters (may be useful in tests to use fake adapter instead of real)
v0.12 release
New features
- Improved hooks debugging. Now Apicase logs hooks call stack on errors (see changes)
Bug fixes
- none
Other changes
- Fully refactored hooks, fixed request flow.
v0.11 release
v0.10 release
New features
- none
Bug fixes
- Using
done
/fail
in hooks cause request never resolve because of changing promise. Now it works correctly.
Other changes
- none
v0.9 release
New features
- none
Bug fixes
Payload normalisation
You probably could get unexpected behaviour with no headers in request or smth else
It was happening because adapter.convert
was being called before calling before hooks.
Now adapter.convert
is called only inside adapter request.
You can see new behaviour here
Note that
payload.headers.token = token
in hook will cause error if you don't pass headers (noadapter.convert
called).
Usepayload.headers = { ...payload.headers, token }
instead
Other changes
- none
v0.3 beta
New features
- Added interceptors
Changes
- Fetch adapter no longer applies
JSON.stringify
to body object. Use interceptors instead.
v0.2 release
New features
- Adapter now takes additional
instance
option withApicase
instance. It may be useful for high order adapters Apicase.install
andApicase.extend
now takes additionaloptions
argument that will be passed toinstaller
as a second argument