Blob constructor is not spec compliant
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.3k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 4
説明
Description
The constructor for React Native's Blob has a comment:
"Currently we only support creating Blobs from other Blobs."
BlobManager confirms this:
"Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supported"
This API is not spec compliant, since this is what the Blob specification specifies:
(Constructed from) "An iterable object such as an Array, having ArrayBuffers, TypedArrays, DataViews, Blobs, strings, or a mix of any of such elements, that will be put inside the Blob. Strings should be well-formed Unicode, and lone surrogates are sanitized using the same algorithm as String.prototype.toWellFormed()."
Steps to reproduce
- Try to call:
new Blob(new Uint8Array([
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23,
]);
See that RN doesn't support Blobs composed of anything but Blobs or strings.
React Native Version
0.73.6
Affected Platforms
Runtime - Android, Runtime - iOS
Output of npx react-native info
N/A
Stacktrace or Logs
N/A
Reproducer
N/A
Screenshots and Videos
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず packages/react-native/Libraries/Blob/Blob.js と packages/react-native/Libraries/Blob/BlobManager.js を読み、特にコンストラクタと既存のサポートされていない入力の処理を確認します。Android と iOS での現在の動作を確認したうえで、既存の Blob と文字列のサポートを維持しながら、Blob の構築で issue に記載されている iterable な入力型を受け入れられることを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react-native
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100