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 #117

Closed
wants to merge 2 commits into from

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.

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.

@jonkoops
Copy link
Collaborator Author

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

expect(files).toHaveLength(0);
});

it("should return an empty array if drag event", async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed this test, as it was doing the exact same thing the test above is doing.

@coveralls
Copy link

coveralls commented Nov 22, 2024

Pull Request Test Coverage Report for Build 12074930766

Details

  • 20 of 20 (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: 95
Relevant Lines: 95

💛 - Coveralls

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

BREAKING CHANGE: Arrays of `FileSystemFileHandle` are now handled in a dedicated `fromFileHandles()` function.
@jonkoops jonkoops closed this Dec 5, 2024
@jonkoops jonkoops deleted the split-file-handles branch December 5, 2024 18:26
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.

2 participants