Open
Description
It should be possible to rewrite the code to not rely on both TextEncoder and TextDecoder, just like GitHub as done:
- Decode: https://github.com/github/fetch/blob/a8aa427de0ed808ff26c0e3eb2e59c122c44488a/test/test.js#L79
- Encode: https://github.com/github/fetch/blob/a8aa427de0ed808ff26c0e3eb2e59c122c44488a/test/test.js#L69
By removing the dependency on both APIs, the app's bundle size can be further reduced. Considering that React Native's environment does not provide these APIs, there would be no need to polyfill them anymore. However, we should, by default, check whether TextEncoder
and TextDecoder
are available and only then fallback.