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: clean up retrieval from data transfer item #114

Merged
merged 1 commit into from
Dec 16, 2024

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
Cleans up the code in the fromDataTransferItem() function so that it is fully type-safe and uses await everywhere for Promises.

Does this PR introduce a breaking change?
No

Other information
Not relevant

@jonkoops jonkoops changed the title Refactor file handle refactor: clean up retrieval from data transfer item Nov 13, 2024
@jonkoops jonkoops marked this pull request as draft November 13, 2024 19:02
@coveralls
Copy link

coveralls commented Nov 13, 2024

Pull Request Test Coverage Report for Build 12183872816

Details

  • 16 of 16 (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 12068096439: 0.0%
Covered Lines: 96
Relevant Lines: 96

💛 - Coveralls

@jonkoops
Copy link
Collaborator Author

This PR builds off the work from #112, so that should be merged first so this can be rebased on top.

@jonkoops jonkoops force-pushed the refactor-file-handle branch 3 times, most recently from a04ee7b to a2a80e8 Compare November 22, 2024 15:28
@jonkoops
Copy link
Collaborator Author

Re-based the PR and cleaned it up a little, I think we're good to go like this. @rolandjitsu can I ask you for a review?

@jonkoops jonkoops marked this pull request as ready for review November 22, 2024 15:32
@jonkoops jonkoops requested a review from rolandjitsu November 22, 2024 15:32
src/file-selector.ts Outdated Show resolved Hide resolved
src/file-selector.ts Outdated Show resolved Hide resolved
src/file-selector.ts Show resolved Hide resolved
src/file-selector.ts Outdated Show resolved Hide resolved
src/file-selector.ts Outdated Show resolved Hide resolved
@jonkoops
Copy link
Collaborator Author

I'll put this PR on hold until we merged the backport under #122, as this is likely to create conflicts.

@jonkoops jonkoops marked this pull request as draft November 26, 2024 16:31
@jonkoops jonkoops force-pushed the refactor-file-handle branch 2 times, most recently from 58fbca4 to 90b9336 Compare November 28, 2024 17:37
@jonkoops jonkoops marked this pull request as ready for review November 28, 2024 17:38
@jonkoops
Copy link
Collaborator Author

@rolandjitsu I've rebased this PR on top of the fixes we backported from master, could I ask you for another pass?

Since the backports included converting the method to use await that enhancement no longer applies here, but the changes still include some additional type-safety fixes and improves the error messages, along with splitting up some of the code a bit more, so I think it is still relevant to land this.

@jonkoops
Copy link
Collaborator Author

As for the advanced errors with details about the handle, I think we could handle (no pun intended) that as a separate feature. Since the original error messages are kinda broken, and I have not seen anyone complain about it I think we can safely assume it is not that important to users, or they just don't get these messages often (or at all).

@jonkoops jonkoops force-pushed the refactor-file-handle branch from 90b9336 to 5ad6a9b Compare November 28, 2024 19:00
src/file-selector.ts Outdated Show resolved Hide resolved
src/file-selector.ts Outdated Show resolved Hide resolved
src/file-selector.ts Show resolved Hide resolved
src/file-selector.ts Show resolved Hide resolved
src/file-selector.ts Show resolved Hide resolved
src/file-selector.ts Outdated Show resolved Hide resolved
@jonkoops jonkoops force-pushed the refactor-file-handle branch from 5ad6a9b to 20a6c2b Compare December 5, 2024 16:24
@jonkoops
Copy link
Collaborator Author

jonkoops commented Dec 5, 2024

@rolandjitsu did another pass and processed your comments, could I ask you for another review?

@jonkoops jonkoops requested a review from rolandjitsu December 5, 2024 16:26
@rolandjitsu rolandjitsu merged commit 91f497a into react-dropzone:beta Dec 16, 2024
5 checks passed
@rolandjitsu
Copy link
Collaborator

@rolandjitsu did another pass and processed your comments, could I ask you for another review?

Sorry for the long wait. Got a bit busy at work.

@jonkoops
Copy link
Collaborator Author

No worries, I know how it is :)

@jonkoops jonkoops deleted the refactor-file-handle branch December 17, 2024 17:14
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.

4 participants