Releases: Exilz/apipeline
v3.0.1 | APIPeline
3.0.1
ℹ️ The plugin has been renamed and is now APipeline. This version works almost exactly like the previous one, except for minor breaking changes. This plugin can now be used on the browser, in node.js and on react-native !
Breaking changes
- You now must supply the
fetchMethod
option in your API options. This is required since the plugin can now be used in any javascript project. - You now must set your caching driver either through the 3rd parameter of your api instantiation, or with the
setCacheDriver
method.
📖 Take a look at the documentation for some pointers about how to set these values depending on where you intend to use the plugin.
Features
- Your favorite API wrapper is now available everywhere from react-native to your webapps running javascript on the client and/or the server !
- New option :
encodeParameters
: this automatically encodes your utf8 characters in yourqueryParameters
andpathParameters
Bugfixes & improvements
- Prevent a silent error when the network request failed
multiRemove
method is not required anymore when creating your own cache driver- Some unnecessary logic has been circumvented when caching is disabled, improving overall performance
- Some typings errors and imprecisions have been changed
Warning
- Your users will lose their current cache when switching to this version, unless you were using the
cachePrefix
option.
v2.3.0
Features
- Add
responseMiddleware
option, letting you alter your API responses. Just like your regularmiddlewares
option, you can configure this at the API / services / fetch level. - Add a dedicated method for each HTTP method available, so you can write more concise code (
api.get
,api.post
...).api.fetch
is still available.
Miscellaneous
- Now using expo to supply the demo, added some features to it.
v2.2.0
Features
- An SQLite driver is now baked-in by default with this plugin ! Just install the native dependencies and set it as your custom driver. Read more in the docs.
💡 The SQLite driver's performances are significantly better than
AsyncStorage
's. Its usage is recommended for more complex apps that need faster caching. Moreover, it bypassesAsyncStorage
's 6mb limitation on android, which might be important if you need to store large amount of data.
This implementation is still in its early form, feel free to build on it and submit PR to improve it.
Bugfixes
- Cache size capping should always remove the oldest item.
Miscellaneous
- Typings corrections for typescript users.
- Documentation was starting to get too big and has been split up in multiple files.
v2.1.0
Features
- Add
ignoreHeadersWhenCaching
option. This is available at API, service and fetch options level.
Enabling this will make sure you'll use your cached data when you're firing the same request but with different headers. This is useful if you need to sign all your API calls with the current date for example.
v2.0.0
Breaking change
- Your endpoint's parsed path is now available without its query parameters in your middlewares' signature.
The third argument supplied to the middleware is now an object with
both the fullPath as it used to be and your path without its query
parameters.
This can be useful in some cases, when generating authentication
headers, for instance.
Features
- You can now pass an undefined value to both
queryParameters
andpathParameters.
They will simply be ignored during the parsing of your paths. This is
is much easier than having to create an intermediate var with your
fetch options since you don’t have to care whether your variable is
defined or not.
v1.2.0
Features
- Add
rawData
key for services & fetch options, allowing you to fetch anything, not just JSON data whilst keeping the caching logic
Bugfixes
- Empty domain or prefix won't raise an error
disableCache
key of services & fetch options will work properly, regardless of how it's enabled
v1.1.1
v.1.1.0
v.1.1.0-rc.2
chore(package): bump to 1.1.0-rc.2
v.1.1.0-rc.1
doc(README): update README with latest changes