Support for defaultSource
Both iOS and Android. No support for URIs due to library limitations. It also does not make any sense. (As defaultSource should be available immediately, not for going to fetch from a remote location)
Codecov Report
Merging #550 into master will decrease coverage by
11.97%. The diff coverage is63.63%.
@@ Coverage Diff @@
## master #550 +/- ##
===========================================
- Coverage 94.11% 82.14% -11.98%
===========================================
Files 1 1
Lines 17 28 +11
===========================================
+ Hits 16 23 +7
- Misses 1 5 +4
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/index.js | 82.14% <63.63%> (-11.98%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 56c8eff...8451cce. Read the comment docs.
Codecov Report
Merging #550 (1cbcb8b) into main (a7a8643) will increase coverage by
0.57%. The diff coverage is100.00%.
:exclamation: Current head 1cbcb8b differs from pull request most recent head 821ed0d. Consider uploading reports for the commit 821ed0d to get more accurate results
@@ Coverage Diff @@
## main #550 +/- ##
==========================================
+ Coverage 96.29% 96.87% +0.57%
==========================================
Files 1 2 +1
Lines 27 32 +5
Branches 2 0 -2
==========================================
+ Hits 26 31 +5
Misses 1 1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/index.js | 96.42% <100.00%> (ø) |
|
| src/test_util/android_platform.js | 100.00% <100.00%> (ø) |
|
| src/index.tsx |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 4d8c749...821ed0d. Read the comment docs.
Does this act as fallback image as well In case of error loading image ?
Does this act as fallback image as well In case of error loading image ?
Yes
Codecov fails on code specific to Android. Seems like the tests are not running on Android.
@DylanVann This solves the one big issue with this library, would be helpful to review. Thanks 👍
Hello! Thank you so much for this feature: it is very important also for me and my team, as well as for the overall project. Is it possible to fix or merge it in the master? @DylanVann
Any news on this? Thanks.
having defaultSource makes fastImage the best plugin :(
I kind of really need this, any chance this can get merged/released in the near future? Would be really thankful!
@DylanVann Any chance to get some attention here?
I've added more tests to satisfy codecov. Hope it's silenced now.
@danielgindi don't you think defaultSource should also support network images? I can easily see this as a way to load a thumbnail (small kb) while the full image is being downloaded
@enahum Well theoretically you would be correct, but practically no.
If you have such a need - you are most probably doing something wrong:
-
In most cases, such a feature is used in order to have something visible immediately, which means you have to be able to load the image synchronously, and have the dimensions available upfront, and ideally the image should be in the exact dimensions for display to avoid a costly resize operation.
-
If you have the same default image for all images (most common case), then the image should just be local in your app.
-
If you generate the default on the fly (like letters avatar) - it's still local, in memory or cached on disk.
-
Some native libraries have an option to supply separate source for error image. In that case - you probably have a common error image to show for every error. This should be local in your app.
-
If you are showing an image in a list view - then you want it to load fast and be available immediately, for smooth scrolling and to avoid visual glitches.
Now if we care about conforming to the built-in RN Image - then the Image docs say the image should be local or a static image resource. https://reactnative.dev/docs/image.
Can this be merged with the master, please? @danielgindi @DylanVann
Is it possible to finally merge this into master? Thank you in advance @danielgindi @DylanVann
defaultSource up!
+1
@DylanVann I've rebased on master to resolve conflicts. The CI has an issue that's not related to the code (fails on master too).
@danielgindi Does it support v6.1.1? I can't upgrade RN to 0.60+ in a short time but would like to use defaultSource :(
Any chance to merge this? @DylanVann @danielgindi Seems there was no any other issues in this branch?
@neuneed Yes it had some work done on it, seems stable even after latest changes in master. But there's no response from @DylanVann. I also emailed him, but again not response.
Hope this will be merged soon on the master @DylanVann Thank you!
Waiting for this merge too
Waiting for this
eagerly waiting for the feature
@danielgindi could you rebase again, please 🙏
Installing from this PR directly I get the following error from bundler:
error: Error: While trying to resolve module `react-native-fast-image` from file `.../TabNavigator.tsx`, the package `.../node_modules/react-native-fast-image/package.json` was successfully found.
However, this package itself specifies a `main` module field that could not be resolved (`.../node_modules/react-native-fast-image/dist/index.js`.
Indeed, none of these files exist:
* .../node_modules/react-native-fast-image/dist/index.js(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg)
* .../node_modules/react-native-fast-image/dist/index.js/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg)
@rpavlovs I've rebased. Please anyone test this as I haven't tested it with the latest master changes.
Also, @DylanVann I'm getting tired of this. Could you please take a look and merge? Every month you have breaking structural changes which make it difficult to rebase.
I've published this as react-native-fast-image2, as the package is now structure in a way that it cannot be directly installed from git.