Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature/preload callbacks#437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Mickagd wants to merge22 commits intoDylanVann:mainfromSparted:feature/preload-callbacks
Closed

Feature/preload callbacks#437

Mickagd wants to merge22 commits intoDylanVann:mainfromSparted:feature/preload-callbacks

Conversation

@Mickagd
Copy link

We also need this PR to be merged

LuisRodriguezLD, jatsrt, iamolegga, kbrandwijk, amitbravo, gsp-beta-admin, augustbjornberg, SamiChab, AugustGSP, bristoljon, and 23 more reacted with thumbs up emojiAsadAlihp reacted with thumbs down emojiAsadAlihp reacted with laugh emojiLuisRodriguezLD, iamolegga, augustbjornberg, SamiChab, AugustGSP, enahum, Andries-Smit, sergeymorkovkin, cheunjm, jsamr, and 4 more reacted with hooray emojiAsadAlihp reacted with confused emojiAsadAlihp reacted with heart emojiLuisRodriguezLD, iamolegga, augustbjornberg, SamiChab, AugustGSP, sergeymorkovkin, cheunjm, jsamr, kaonis, EyMaddis, and 3 more reacted with rocket emojiAsadAlihp reacted with eyes emoji
doomsowerand others added3 commitsAugust 29, 2018 09:02
# Conflicts:#android/src/main/java/com/dylanvann/fastimage/FastImagePreloaderModule.java#src/index.d.ts#src/index.js
Copy link
Contributor

@guhungryguhungry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please renameFastImagePreloaderModule back toFastImageViewModule and extract method into new class instead from preload()

Ilphrin and TQCasey reacted with thumbs up emoji
importcom.facebook.react.views.imagehelper.ImageSource;

classFastImageViewModuleextendsReactContextBaseJavaModule {
classFastImagePreloaderModuleextendsReactContextBaseJavaModule {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why rename class just like that. I have#425 which edit FastImageViewModule.java

@codecov
Copy link

codecovbot commentedMar 28, 2019
edited
Loading

Codecov Report

Merging#437 (c86abda) intomain (a7a8643) willdecrease coverage by45.01%.
The diff coverage is17.39%.

❗ Current headc86abda differs from pull request most recent head0ee6e1f. Consider uploading reports for the commit0ee6e1f to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@##             main     #437       +/-   ##===========================================- Coverage   96.29%   51.28%   -45.02%===========================================  Files           1        2        +1       Lines          27       39       +12       Branches        2        0        -2     ===========================================- Hits           26       20        -6- Misses          1       19       +18
Impacted FilesCoverage Δ
src/preloaderManager.js15.78% <15.78%> (ø)
src/index.js85.00% <25.00%> (ø)
src/index.tsx

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update4d8c749...0ee6e1f. Read thecomment docs.

@RWOverdijk
Copy link

Hey all! Is this going somewhere?

gsp-beta-admin, augustbjornberg, LuisRodriguezLD, Mickagd, and ArturTimoxin reacted with thumbs up emojiLuisRodriguezLD and augustbjornberg reacted with heart emoji

@augustbjornberg
Copy link

Is this PR still being worked on? Would be such a nice feature to have.

LuisRodriguezLD, iamolegga, krdc, Mickagd, and ArturTimoxin reacted with thumbs up emojiLuisRodriguezLD and akeva001 reacted with heart emoji

@Ilphrin
Copy link

There are some conflicts, I think you should resolve them@Mickagd before@DylanVann can take a look at this PR ^^

LuisRodriguezLD, Mickagd, and ArturTimoxin reacted with thumbs up emoji

@SamiChab
Copy link

Please consider implementing this! It would be so useful!

LuisRodriguezLD, Mickagd, and ArturTimoxin reacted with thumbs up emoji

@RWOverdijk
Copy link

Really happy to see this still moving forward! I can't wait to remove my component hack 😄

Mickagd and LuisRodriguezLD reacted with laugh emojiLuisRodriguezLD reacted with heart emoji

@LuisRodriguezLD
Copy link

Hello. Any update on this?

augustbjornberg, RWOverdijk, and LuisRodriguezLD reacted with eyes emoji

@RWOverdijk
Copy link

@LuisRodriguezLD As far as I can see there are conflicts.

@RWOverdijk
Copy link

I've reimplemented this. Confirmed to work on iOS. Android I'll check later. I'll make a PR when I'm done.

On a sidenote, my solution uses a lot less code so I'm hoping that makes it easier to get it merged.

augustbjornberg and LuisRodriguezLD reacted with heart emoji

@Elindorath
Copy link

Hi@RWOverdijk. Thanks for your work! Could you publish your reimplementation on your fork that we can help to test it and speed up this to get it merged?

We really need this to be compatible with RN v0.60+.

augustbjornberg and joan-saum reacted with thumbs up emojiaugustbjornberg reacted with eyes emoji

@RWOverdijk
Copy link

RWOverdijk commentedOct 15, 2019
edited
Loading

@Elindorath Sure thing. I have to finish android first though. The module is compatible with 0.60+ for me, so I'm not sure what you mean

@joan-saum
Copy link

Hi@RWOverdijk , how is it going with Android ? :) Need any help ?

@sebqq
Copy link

Promise should also return which pictures from array couldn't be fetched, not only how many couldn't be fetched.

@RWOverdijk
Copy link

@joan-saum It's going all right. The biggest problem right now is time and priorities. I can push the iOS stuff at some point this or next week though, maybe someone else can then PR the android stuff to my branch and we can get this thing going!

Sorry for my lack of time... It bothers me as well.

@sebqq
Copy link

Please, consider to also add id to every image, so we can check from react-native side which images failed to load.

@RWOverdijk
Copy link

@sebinq I will not be doing that but you could add that after if you want.

@sebqq
Copy link

@RWOverdijk thanks for info,, I will try.

@RWOverdijk
Copy link

The problem is that my project isn't selling well enough to prioritize this feature (My sales strategy was well calculated but man, am I bad at math.).

@Mickagd
Copy link
Author

We have updated our PR with your last changes.
There is a lot of people that need these changes.
Could you please merge this request@DylanVann ?
Thanks a lot !

clemensmol, bufgix, kaonis, nicomontanari, and sunnhyn reacted with thumbs up emoji

@nguyenphucbao68
Copy link

Please merge this PR. I really need it 👍

bufgix, kaonis, vasylnahuliak, and sunnhyn reacted with thumbs up emoji

@Flictuum
Copy link

Hi guys just a last call if it's possible to merge this PR, we invested time here to bring last changes to the PR and I think this will help a lot of people.
So I hope my words will find you@DylanVann
Thanks a lot for your work and maybe we could help to maintain this package for other needs !

ViewProps,
}from'react-native'

constFastImageViewNativeModule=NativeModules.FastImageView

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This line should remain because it is needed to use "clearMemoryCache" and "clearDiskCache". It also generate a typescript error.

@putuoka
Copy link

how to implement this into my project? because i don't have src folder in my node_modules fast image

@nicomontanari
Copy link

Hi@putuoka, did you download the stable version of the package or did you download it from this pull request?

If you have downloaded the stable version in yournode_modules folder you should see the compiled package in thedist folder, if not you should see the entire project as the below image:

Schermata 2022-05-20 alle 10 41 25

@putuoka
Copy link

Hi@putuoka, did you download the stable version of the package or did you download it from this pull request?

If you have downloaded the stable version in yournode_modules folder you should see the compiled package in thedist folder, if not you should see the entire project as the below image:

Schermata 2022-05-20 alle 10 41 25

Hi@nicomontanari , thanks for the reply. i have downloaded stable version using yarn add react-native-fast-image
what i mean is, in this pull request there is 12 files change one of them isPreloaderManager.tsx which i can't find in my node_modules react-native-fast-image

image

sorry because i'm new with rn i might missing something here. sorry for my english. please enlighten me because i need to use preload promise/callback to know when it done downloading resources and then i can use it as cache with fast images & redux persist

@nicomontanari
Copy link

@putuoka you need to install this package withyarn add DylanVann/react-native-fast-image#pull/437/head ornpm install DylanVann/react-native-fast-image#pull/437/head if you use npm

putuoka reacted with heart emoji

@putuoka
Copy link

putuoka commentedMay 23, 2022
edited
Loading

@putuoka you need to install this package withyarn add DylanVann/react-native-fast-image#pull/437/head ornpm install DylanVann/react-native-fast-image#pull/437/head if you use npm

Hi@nicomontanari i got this error:

error: Error: While trying to resolve module `react-native-fast-image` from file `D:\gcp-app\src\MainApp.js`, the package `D:\gcp-app\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 (`D:\gcp-app\node_modules\react-native-fast-image\dist\index.cjs.js`. Indeed, none of these files exist:

edit: runyarn upgrade --latest into node_modules fast image after that runyarn build i solve that error by doing this but still can't use new preload.

solved!! it's working!! here what i do:

  1. clone original repo not from this pull request
  2. runyarn install no need upgrade to latest. after that changes necessary files according to this pull request.
  3. runyarn build copy "dist" folder to your destination node_modules which has original install of this package

note: it can't preload 151 images. sometimes just 32, sometimes 113
image

@putuoka
Copy link

Btw This pull make FastImage.clearDiskCache() broken

TypeError: Cannot read property 'clearDiskCache' of null

code:

FastImage.clearDiskCache().then(() => {      //preloadComplete(isComplete);      console.log('clear');    });

@patissier-boulanger
Copy link

really need this!

YrenR, crockalet, IsmailM, sarahwiddows, gabrielgallardoe, ilyasssan2, akeva001, robert-go, and skizzo reacted with thumbs up emoji

@knro
Copy link

Any plans yet to merge this? Any forks that have this merged with upstream?

@AlessandroAries
Copy link

Any plans yet to merge this? Any forks that have this merged with upstream?

I added the changes to my fork with the updated stream:#986

@skizzo
Copy link

This would be so nice to have!

@ymc-thzi
Copy link

Had the same need, couldn't patch the PR due to conflicts. I am using another patch to get thecache folder path
With that I wrote a tiny function to get the state and even a progress of the cached images. Maybe this helps someone as a workaround...

  async function checkCacheFolder(cacheFolderPath, expectedImageCount) {    try {      const files = await RNFS.readDir(cacheFolderPath);      const imageCount = files.filter(        file => file.isFile() && file.name.endsWith('.jpg'),      ).length;      if (imageCount === expectedImageCount) {        console.log('Images cache complete');        return;      }      let progress = (imageCount / expectedImageCount) * 100;      console.log(progress.toFixed(0));      setTimeout(() => {       checkCacheFolder(          cacheFolderPath,          expectedImageCount,        );      }, 1000);    } catch (error) {      //Sentry will log that    }  },

@SpartedSparted closed this by deleting the head repositoryJul 17, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@guhungryguhungryguhungry requested changes

@nicomontanarinicomontanarinicomontanari requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

20 participants

@Mickagd@RWOverdijk@augustbjornberg@Ilphrin@SamiChab@LuisRodriguezLD@Elindorath@joan-saum@sebqq@mainginski@nguyenphucbao68@Flictuum@putuoka@nicomontanari@patissier-boulanger@knro@AlessandroAries@skizzo@ymc-thzi@guhungry

[8]ページ先頭

©2009-2025 Movatter.jp