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

refactor!: split file handles into seperate function #126

Merged
merged 1 commit into from
Feb 23, 2025

Conversation

jonkoops
Copy link
Collaborator

What kind of change does this PR introduce?

  • Bug Fix
  • Feature
  • Refactoring
  • Style
  • Build
  • Chore
  • Documentation
  • CI

Did you add tests for your changes?

  • Yes, my code is well tested
  • Not relevant

If relevant, did you update the documentation?

  • Yes, I've updated the documentation
  • Not relevant

Summary
Removes the handling of FileSystemFileHandle arrays from the fromEvent() function, and moves it to a dedicated fromFileHandles() function purposefully made for handling this data type. This reduces the need to handle polymorphic input and narrow down what the exact type should be in fromEvent(). Additionally, this allows bundlers to more effectively tree-shake the module in case the other code is never used. The JSDoc on the function itself has also been improved with additional details for the consumer.

Does this PR introduce a breaking change?
Yes, arrays of FileSystemFileHandle are now handled in a dedicated fromFileHandles() function. Users that were previously using fromEvent() will now have to use this dedicated function instead.

Other information
This also removes the notice that this feature is experimental, promoting fromFileHandles() to a stable API in the next major.

Signed-off-by: Jon Koops <[email protected]>

BREAKING CHANGE: Arrays of `FileSystemFileHandle` are now handled in a dedicated `fromFileHandles()` function.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12412031215

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 12352595240: 0.0%
Covered Lines: 95
Relevant Lines: 95

💛 - Coveralls

@jonkoops jonkoops requested a review from rolandjitsu December 19, 2024 12:13
@jonkoops
Copy link
Collaborator Author

@rolandjitsu could I get your input on this PR? If you are enjoying the holidays don't worry, this can all certainly wait until next year.

@rolandjitsu
Copy link
Collaborator

@rolandjitsu could I get your input on this PR? If you are enjoying the holidays don't worry, this can all certainly wait until next year.

Sorry for the late reply. Gonna have a look at this now.

@jonkoops jonkoops requested a review from rolandjitsu January 22, 2025 10:54
@jonkoops
Copy link
Collaborator Author

@rolandjitsu can we merge this one as-is, or would you like me to make further changes? I have some other work lined up that I'd like to get in as well.

@rolandjitsu rolandjitsu merged commit 94f1803 into react-dropzone:beta Feb 23, 2025
5 checks passed
Copy link

🎉 This PR is included in version 3.0.0-beta.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jonkoops jonkoops deleted the split-file-handles branch February 23, 2025 18:26
@jonkoops
Copy link
Collaborator Author

Nice, thanks for the merge, I will see if I can dig up some more of the work I had in the pipeline for the next major and get it into shape.

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

Successfully merging this pull request may close these issues.

3 participants