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
feat(utils): Allow text encoder/decoder polyfill from global __SENTRY__ #11283
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Sorry, I deleted these not knowing it would impact downstream. To be fair, I think this is a neater solution than before where we had to pass them around as options and then arguments.
@@ -57,6 +57,8 @@ export interface InternalGlobal { | |||
defaultCurrentScope: Scope | undefined; | |||
defaultIsolationScope: Scope | undefined; | |||
globalMetricsAggregators: WeakMap<Client, MetricsAggregator> | undefined; | |||
encodePolyfill?: (input: string) => Uint8Array; | |||
decodePolyfill?: (input: Uint8Array) => string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave a comment about what these should be used for!
…__ (getsentry#11283) The TextEncoder option was removed in getsentry#10701 because all of the newly supported platforms support TextEncoder/Decoder. Sadly that's not true for React Native, yet. TextEncoder will be included in the next release of RN with Hermes. See the PR facebook/hermes@3863a36#diff-4bf4a4ab271f254baf2097be87be98333ec69eb2d41e074b81147656c33145eb We can not drop support of all the previous RN versions in the RN SDK v6 (the next major). To avoid passing the encoder option around the SDK, I propose adding polyfill properties to the global __SENTRY__ object which RN can use.
The TextEncoder option was removed in #10701 because all of the newly supported platforms support TextEncoder/Decoder.
Sadly that's not true for React Native, yet. TextEncoder will be included in the next release of RN with Hermes. See the PR facebook/hermes@3863a36#diff-4bf4a4ab271f254baf2097be87be98333ec69eb2d41e074b81147656c33145eb
We can not drop support of all the previous RN versions in the RN SDK v6 (the next major).
To avoid passing the encoder option around the SDK, I propose adding polyfill properties to the global SENTRY object which RN can use.