It should be possible to rewrite the code to not rely on both TextEncoder and TextDecoder, just like GitHub as done:
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.
It should be possible to rewrite the code to not rely on both TextEncoder and TextDecoder, just like GitHub as done:
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
TextEncoderandTextDecoderare available and only then fallback.