Migration Guide
This guide will help you migrate from v1.6.0 to v2.0.0.
Thankfully, there are not many breaking changes in this release, but there are a few, and they will be covered here.
Client configuration
The client configuration has been changed to be more flexible and allow for more options in the future.
One of the biggest changes is to the cache
option.
In v1.6.0, the cache
option was actually for the Storage
utilities.
And the Cache
utilities were not configurable.
Also, the storage utilities were only available for data dragon.
In v2.0.0, the cache
option is now a Cache
config, and the
storage
option is now a Storage
config, and they both support
handling of data dragon and API data.
// v1.6.0client.initialize({ // ... (other options) cache: { enable: true, localRoot: 'dev/data' },});// v2.0.0client.initialize({ // ... (other options) storage: { enable: { dragon: true, api: false }, root: 'dev/data' },});
Fetch options
The fetch options have also been changed to accommodate the new features introduced to the client in v2.0.0
Most noticeably, force
has been renamed to ignoreCache
as it is more descriptive of what it does now that the client
has a cache AND a storage medium.
// v1.6.0client.summoner.fetch('id', { region: 'na', cache: true, force: true,});// v2.0.0client.summoner.fetch('id', { region: 'na', cache: true, ignoreCache: true,});
Additionally, there are now two new options: ignoreStorage
and store
.
Which work in a similar way to ignoreCache
and cache
respectively
but for the storage utilities instead of caching.
Next steps
That's it for the migration guide. You are ready to use v2.0.0!
Feel free to check out the rest of the documentation to check out all the other cool new stuff that has been added.
But otherwise, these changes should get the client working the same way it was before.