[FEAT] WebView: Full support for new architecture#1060
Merged
marco-saia-datadog merged 2 commits intoDec 11, 2025
Conversation
marco-saia-datadog
force-pushed
the
marcosaia/feat/full-new-arch-webview-support
branch
from
November 28, 2025 15:10
f65d3f7 to
c58580f
Compare
4 tasks
sbarrio
previously approved these changes
Dec 5, 2025
sbarrio
approved these changes
Dec 11, 2025
marco-saia-datadog
deleted the
marcosaia/feat/full-new-arch-webview-support
branch
December 11, 2025 13:27
4 tasks
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.
What does this PR do?
This PR enables Session Replay WebView recordings on the New Architecture and fixes issues related to runtime updates of WebView props. These issues could previously cause the Datadog Event Bridge to detach, resulting in Browser SDK sessions being created independently from the active React Native session.
To address this, the PR removes the legacy JS-based setup of the
DatadogEventBridgeand instead relies entirely on the native SDKs WebView instrumentation.This PR also removes the check for
isWebViewTrackingEnabledin Android old architecture, to properly support instrumentation of multiple WebView instances (thanks to @Woody-FE for their contribution with #1062).Motivation
New Architecture previously required the usage of our legacy approach, by setting up the Datadog Event Bridge JS-side due to missing support for custom native components in
react-native-webviewon Android for new architecture. This approach had side effects, especially when WebView props changed at runtime.By switching to native instrumentation and introducing a workaround to communicate first-party hosts to the native layer, we ensure correct linkage of Browser and React Native sessions, while also enabling WebView Session Replay.
Additional Notes
The Android workaround uses
injectedJavaScriptBeforeContentLoadedto deliver first-party hosts to the native layer, bypassing the limitation of not being able to define custom props for New Architecture native modules inreact-native-webview.iOS does not require this workaround; native instrumentation works as expected.
The legacy JS bridge setup is now removed
Review checklist (to be filled by reviewers)