Skip to content

Add React Native support to the Typescript SDK#2955

Merged
JulienLavocat merged 2 commits into
masterfrom
jlvc/fix-react-native
Jul 28, 2025
Merged

Add React Native support to the Typescript SDK#2955
JulienLavocat merged 2 commits into
masterfrom
jlvc/fix-react-native

Conversation

@JulienLavocat
Copy link
Copy Markdown
Contributor

@JulienLavocat JulienLavocat commented Jul 18, 2025

This PR helps to support React Native in the Typescript SDK. We have identified two issues:

  1. Certain versions of React Native exhibit a bug where the constructor mistakenly treats a URL object as a string. This causes an error when the constructor attempts to call .endsWith() on the URL object, leading to runtime errors. This PR adds a .toString() call when passing a URL instance to the URL constructor.
  2. React Native doesn't provide an implementation for TextEncoder and TextDecoder which are used to read/write strings in our binary reader and writer. This PR use introduce the usage of a library for these two types.

Note: this still requires the use of a Polyfill as React Native URL implementation is missing most methods in version older than 0.79 (>= 6 month old)

@JulienLavocat JulienLavocat force-pushed the jlvc/fix-react-native branch from 4b0ab04 to f2440d7 Compare July 18, 2025 16:59
@bfops bfops added release-any To be landed in any release window bugfix Fixes something that was expected to work differently labels Jul 21, 2025
@JulienLavocat JulienLavocat force-pushed the jlvc/fix-react-native branch from fefceb9 to f2440d7 Compare July 21, 2025 19:44
@JulienLavocat JulienLavocat changed the title fix(ts-sdk): use toString() to allow older react native versions to work Add React Native support to the Typescript SDK Jul 21, 2025
@jdetter jdetter requested a review from jsdt July 22, 2025 17:26
@JulienLavocat JulienLavocat force-pushed the jlvc/fix-react-native branch from aca3e88 to 1f01905 Compare July 23, 2025 09:38
@JulienLavocat JulienLavocat force-pushed the jlvc/fix-react-native branch from 1f01905 to 9969a29 Compare July 23, 2025 17:06
@JulienLavocat JulienLavocat force-pushed the jlvc/fix-react-native branch from 9969a29 to 496109d Compare July 24, 2025 17:09
@JulienLavocat JulienLavocat force-pushed the jlvc/fix-react-native branch from 496109d to ad1ebce Compare July 25, 2025 17:11
@JulienLavocat JulienLavocat added this pull request to the merge queue Jul 28, 2025
Merged via the queue into master with commit 2227e0f Jul 28, 2025
25 checks passed
bfops pushed a commit that referenced this pull request Aug 7, 2025
This PR helps to support React Native in the Typescript SDK. We have
identified two issues:

1. Certain versions of React Native exhibit a bug where the constructor
mistakenly treats a URL object as a string. This causes an error when
the constructor attempts to call `.endsWith()` on the URL object,
leading to runtime errors. This PR adds a .toString() call when passing
a URL instance to the URL constructor.
2. React Native doesn't provide an implementation for TextEncoder and
TextDecoder which are used to read/write strings in our binary reader
and writer. This PR use introduce the usage of a library for these two
types.

Note: this still requires the use of a Polyfill as React Native URL
implementation is missing most methods in version older than 0.79 (>= 6
month old)
mamcx pushed a commit that referenced this pull request Aug 26, 2025
This PR helps to support React Native in the Typescript SDK. We have
identified two issues:

1. Certain versions of React Native exhibit a bug where the constructor
mistakenly treats a URL object as a string. This causes an error when
the constructor attempts to call `.endsWith()` on the URL object,
leading to runtime errors. This PR adds a .toString() call when passing
a URL instance to the URL constructor.
2. React Native doesn't provide an implementation for TextEncoder and
TextDecoder which are used to read/write strings in our binary reader
and writer. This PR use introduce the usage of a library for these two
types.

Note: this still requires the use of a Polyfill as React Native URL
implementation is missing most methods in version older than 0.79 (>= 6
month old)
@bfops bfops deleted the jlvc/fix-react-native branch May 6, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes something that was expected to work differently release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants