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

Allow formData to be transformed async for each file #2033

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gugiserman
Copy link

No description provided.

@gugiserman gugiserman marked this pull request as ready for review September 20, 2021 22:12
@enyo
Copy link
Collaborator

enyo commented Sep 21, 2021

Hi @gugiserman . Thanks for you PR, but due to browser restrictions simply adding async is not as easy. I need to check whether webpack + babel properly transforms this and if it increases the bundle size considerably.

@gugiserman
Copy link
Author

gugiserman commented Sep 21, 2021

Hi @gugiserman . Thanks for you PR, but due to browser restrictions simply adding async is not as easy. I need to check whether webpack + babel properly transforms this and if it increases the bundle size considerably.

Hey @enyo , I was expecting that answer already, no worries! I didn't have the time to properly test the async support but I needed this fork to hotfix a project I'm working on ASAP and it worked over there. Coincidence? Who knows. Then I decided to leave the PR here to discuss with all first.

I was going to leave it as draft, I don't know why I marked as ready for review. My bad 😃 (If you can revert it, please feel free to do so, or close it and I can come back later on).

As soon as I have the time I will push the unit tests I added and take a good in-depth look at the final bundle and bring you the results.

Thanks for the quick reply!

@enyo
Copy link
Collaborator

enyo commented Oct 26, 2021

The reason I haven't merged this yet, is because I'm hesitant in piling on feature after feature. Dropzone is pretty heavy as it is at the moment, and I want to avoid running the risk of making it even more unmaintainable.

I see the need for something like this however. I just don't like that now there are two ways to achieve the same thing: either listening to the event, or setting the transform function. That makes me wonder whether it's even necessary to have the event in the first place... 🤔

PS: if you don't mind removing the yarn.lock file from the PR that would make it easier for me to merge in the future.

@gugiserman
Copy link
Author

gugiserman commented Oct 26, 2021

I see. If the transform works well we could deprecate the event, yeah.

I still didn't have the time to properly address your concerns about the code, I also feel I need to make the code more similar to the rest of the codebase as well as add the missing tests.
I will try to do that next weekend.

About yarn.lock: no worries, I will get rid of it asap.

@gugiserman gugiserman force-pushed the feature/async-transform-file-formdata branch 2 times, most recently from b6ac56c to a3da7c2 Compare October 26, 2021 19:00
@gugiserman gugiserman force-pushed the feature/async-transform-file-formdata branch from a3da7c2 to 3112df8 Compare October 26, 2021 19:03
@enyo
Copy link
Collaborator

enyo commented Oct 27, 2021

Regarding the await/async code that's not an issue anymore. Dropzone 6 dropped IE support and it compiles to Promises properly for the browsers that are still needed.

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

Successfully merging this pull request may close these issues.

None yet

2 participants