Skip to content

Releases: kfiroo/react-native-cached-image

v1.4.3

24 Oct 07:26
Compare
Choose a tag to compare
  • Improve the way we create the local image path to avoid collisions - #101

v1.4.2

20 Oct 16:17
Compare
Choose a tag to compare
  • Added typescript definitions - #92
  • Fixed major bug where updating your app version caused images to disappear - #97
  • Validate image is downloaded completely to avoid half downloaded images bug on android - #96

v1.4.1

27 Sep 22:17
Compare
Choose a tag to compare
  • Change NetInfo deprecated change event to the new connectionChange - #76
  • ImageCacheProvider will now correctly prefetch images from nextProps instead of props on componentWillReceiveProps - #87
  • Use the right query-params according to useQueryParamsInCacheKey when generating cached file name - #85
  • Expose ImageCachePreloader - #89

v1.4.0

13 Sep 15:00
Compare
Choose a tag to compare

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 the ImageCacheManager
  • Separate concerns of cache and storage.
    • MemoryCache manages 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-types instead of the deprecated React.PropTypes

v1.3.5

19 Jul 13:30
Compare
Choose a tag to compare
  • 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 cacheLocation prop / ImageCacheProvider.options - #38
  • Added loadingIndicator prop to override the default loading indicator - #53
  • Added fallbackSource prop to set placeholder image when source.uri is null or cached failed, the fallbackSource will be displayed - #53

v1.3.4

05 Jun 13:43
Compare
Choose a tag to compare
  • Filter image types - Make clear that the file type is an compatible image type. 8fc1b74
  • Add key to image to make sure it is reloaded when cached. fff0c9d
  • Export ImageCacheProvider.getCachedImageFilePath.

v1.3.3

20 Apr 17:22
Compare
Choose a tag to compare

Mainly fixes for Android:

  • Use custom renderImage when rendering the loader background image
  • Fix missing key warning on android
  • Fix mkdir errors on android
  • Set isCacheable to false when cacheImage failed
  • Properly fail when response status code is not 20*

v1.3.2: Merge pull request #28 from hhravn/patch-1

12 Apr 09:05
Compare
Choose a tag to compare
  • 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)
}
  • Added ImageCacheProvider.seedCache(local: string, url: string, options: CacheOptions): Promise
    to seed the cache for a given url with a local image. Useful to avoid having to download an image when you have a local copy. (Thanks @Froelund @hhravn)

v1.3.1

04 Apr 10:35
Compare
Choose a tag to compare
  • #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 simple ImageCacheProvider.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

02 Apr 14:18
Compare
Choose a tag to compare

* 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 :)