Releases: kfiroo/react-native-cached-image
v1.4.3
v1.4.2
v1.4.1
- Change
NetInfodeprecatedchangeevent to the newconnectionChange- #76 ImageCacheProviderwill now correctly prefetch images fromnextPropsinstead ofpropsoncomponentWillReceiveProps- #87- Use the right query-params according to
useQueryParamsInCacheKeywhen generating cached file name - #85 - Expose
ImageCachePreloader- #89
v1.4.0
NOTE: v1.4.0 contains a lot of breaking changes - please read the readme
This is a major release that has a lot of breaking changes.
All changes came from community requests, I took all the PRs and Issues discussions and compiled them into this new version.
If anyone has anything to add/comment this is the place.
- Move all cache logic to
ImageCacheManager - Introduce
ImageCacheProvider- a top-level component that provides an entry point for customization over theImageCacheManager - Separate concerns of
cacheandstorage.MemoryCachemanages the caching of URLs, this means that for each URL there is an entry in the cache with its expiration date, local file path, etc. - all decisions are made based on the url cache layer.- fs layer has no knowledge of the cache layer and is orchestrated by the
ImageCacheManager
- Use ES6 classes instead of the deprecated
React.createClass - Use
prop-typesinstead of the deprecatedReact.PropTypes
v1.3.5
- Use a temporary file when downloading an image so that if the download is accidentally interrupted it will not produce a disabled file - #44
- Added the ability to set a custom cache folder location using
cacheLocationprop /ImageCacheProvider.options- #38 - Added
loadingIndicatorprop to override the default loading indicator - #53 - Added
fallbackSourceprop to set placeholder image whensource.uriis null or cached failed, thefallbackSourcewill be displayed - #53
v1.3.4
v1.3.3
v1.3.2: Merge pull request #28 from hhravn/patch-1
- Added
ImageCacheProvider.getCacheInfo()to retrieve info about the cache in the following format: (Thanks @gameboyVito @youhan26)
{
files: [], // an array of all files in the cache represented by their `fs.stat()` result
size: 0 // size of cache in bytes (see example)
}v1.3.1
- #20 - remove illegal characters from cached images path
Possible breaking change
- #19 - All cached items are now under a single sub dir
const SUB_DIR_PATH = 'subDirPath';so we can implement a simpleImageCacheProvider.clearCache
This will cause images that are already cached to be downloaded again to the new location.
NOTE: If you need an easy way to cleanup old images let me know please.
v1.3.0
* This is a minor release because current installations will break after upgrading.
As noted by @Froelund here react-native-fs is not maintained anymore, but its author points to react-native-fetch-blob as an alternative here
ImageCacheProvider now uses react-native-fetch-blob to download the images and save then locally.
NOTE: In order to upgrade you would need to install react-native-fetch-blob and uninstall react-native-fs unless you still need it see here :)