Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilePond get all the urls at once #1857

Merged
merged 6 commits into from Mar 13, 2022
Merged

FilePond get all the urls at once #1857

merged 6 commits into from Mar 13, 2022

Conversation

robertorinaldi-dev
Copy link
Contributor

FileUpload becomes very slow if there are many files.

This is due to the fact that the getUploadedFileUrl function is called for each of them.

Replacing it with a single getUploadedFilesUrl function that is called only once solves the problem.

I also reorganized the part of the code that creates the array of files to be passed to the component in order to avoid repetitions.

@danharrin
Copy link
Member

Instead of getUploadedFilesUrl(), maybe it should be getUploadedFileUrls()? Sounds like slightly better grammar to me.

Also, no breaking changes for the Media Library plugin, right?

@danharrin danharrin marked this pull request as draft March 11, 2022 18:09
@danharrin danharrin added the enhancement New feature or request label Mar 11, 2022
@robertorinaldi-dev
Copy link
Contributor Author

Yes, in BaseFileUpload getUploadedFileUrls calls the function getUploadedFileUrlUsing for each file as it was before.
It is only from Alpine that instead of calling it once for each file it is called once for all.

PS: I'm using Spatie Media Library plugin

@danharrin danharrin marked this pull request as ready for review March 13, 2022 12:14
@danharrin danharrin merged commit 4ec050b into filamentphp:2.x Mar 13, 2022
@danharrin
Copy link
Member

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants