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

FileReader#readAsArrayBuffer #36332

Closed
wants to merge 1 commit into from
Closed

FileReader#readAsArrayBuffer #36332

wants to merge 1 commit into from

Conversation

SheetJSDev
Copy link
Contributor

Summary

Fixes a number of issues with third party libraries that use Blob#arrayBuffer or FileReader#readAsArrayBuffer, including #30769 #34402 #20091 #21209

Changelog

[INTERNAL] [FIXED] - Implemented FileReader#readAsArrayBuffer

Test Plan

Added a test which fails against current release but passes after code changes.

Co-authored-by: André Costa Lima <andreclima.pt@gmail.com>
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 1, 2023
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,476,750 -82
android hermes armeabi-v7a 7,798,783 -85
android hermes x86 8,952,666 -76
android hermes x86_64 8,810,191 -82
android jsc arm64-v8a 9,108,043 +38
android jsc armeabi-v7a 8,304,769 +32
android jsc x86 9,158,834 +34
android jsc x86_64 9,418,134 +32

Base commit: a0adf57
Branch: main

@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@lorenc-tomasz
Copy link

+1

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 14, 2023
@facebook-github-bot
Copy link
Contributor

@javache merged this pull request in 5b597b5.

OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Fixes a number of issues with third party libraries that use `Blob#arrayBuffer` or `FileReader#readAsArrayBuffer`, including facebook#30769 facebook#34402 facebook#20091 facebook#21209

## Changelog

[INTERNAL] [FIXED] - Implemented FileReader#readAsArrayBuffer

Pull Request resolved: facebook#36332

Test Plan: Added a test which fails against current release but passes after code changes.

Reviewed By: christophpurrer

Differential Revision: D43907171

Pulled By: javache

fbshipit-source-id: 73d622ec569a282b6394732b9a0dc687b447fb62
const base64 = text.split(',')[1];
const typedArray = toByteArray(base64);

this._result = typedArray.buffer;
Copy link

@cbjs cbjs Sep 8, 2023

Choose a reason for hiding this comment

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

not working on react-native@0.72.4
empty buffer, return typedArray directly is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants