feat(utils): Allow text encoder/decoder polyfill from global __SENTRY__#11283
Merged
krystofwoldrich merged 5 commits intodevelopfrom Mar 26, 2024
Merged
feat(utils): Allow text encoder/decoder polyfill from global __SENTRY__#11283krystofwoldrich merged 5 commits intodevelopfrom
krystofwoldrich merged 5 commits intodevelopfrom
Conversation
Contributor
size-limit report 📦
|
added 3 commits
March 26, 2024 12:49
timfish
approved these changes
Mar 26, 2024
Collaborator
timfish
left a comment
There was a problem hiding this comment.
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.
AbhiPrasad
approved these changes
Mar 26, 2024
| defaultIsolationScope: Scope | undefined; | ||
| globalMetricsAggregators: WeakMap<Client, MetricsAggregator> | undefined; | ||
| encodePolyfill?: (input: string) => Uint8Array; | ||
| decodePolyfill?: (input: Uint8Array) => string; |
Contributor
There was a problem hiding this comment.
Let's leave a comment about what these should be used for!
cadesalaberry
pushed a commit
to cadesalaberry/sentry-javascript
that referenced
this pull request
Apr 19, 2024
…__ (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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.