@coralogix/react-native-plugin 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.7.1 (2026-07-09)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - mask session replay views on the New Architecture (Fabric)
6
+
1
7
  ## 0.7.0 (2026-07-06)
2
8
 
3
9
  ### 🚀 Features
package/README.md CHANGED
@@ -467,7 +467,7 @@ import { SessionReplay } from '@coralogix/react-native-plugin';
467
467
  </View>
468
468
  ```
469
469
 
470
- The `SessionReplay.maskView` function accepts a `LayoutChangeEvent` and will mask the view in session replay recordings.
470
+ The `SessionReplay.maskView` function accepts a `LayoutChangeEvent` and will mask the view in session replay recordings. It works on both the legacy and the New Architecture (Fabric).
471
471
 
472
472
 
473
473
  ### Optional - Coralogix Gradle Plugin (Android)
@@ -43,7 +43,8 @@ import com.facebook.react.bridge.WritableMap
43
43
  import com.facebook.react.modules.core.DeviceEventManagerModule
44
44
  import org.json.JSONArray
45
45
  import org.json.JSONObject
46
- import com.facebook.react.uimanager.UIManagerModule
46
+ import com.facebook.react.bridge.UiThreadUtil
47
+ import com.facebook.react.uimanager.UIManagerHelper
47
48
  import java.util.concurrent.ConcurrentHashMap
48
49
 
49
50
  class CxSdkModule(reactContext: ReactApplicationContext) :
@@ -311,11 +312,18 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
311
312
 
312
313
  @ReactMethod
313
314
  override fun maskViewByTag(viewTag: Int) {
314
- val uiManager = reactApplicationContext.getNativeModule(UIManagerModule::class.java)
315
-
316
- uiManager?.addUIBlock { nativeViewHierarchyManager ->
315
+ // Resolve the view through the architecture-agnostic UIManagerHelper so this
316
+ // works on both the legacy (Paper) and New (Fabric) architectures.
317
+ // getNativeModule(UIManagerModule) only exists on Paper; under Fabric it
318
+ // returns null and masking silently no-ops. UIManagerHelper routes by tag:
319
+ // legacy tags -> UIManagerModule, Fabric tags -> FabricUIManager, both
320
+ // exposing UIManager.resolveView(tag).
321
+ val context = reactApplicationContext
322
+ // FabricUIManager.resolveView must be called on the UI thread.
323
+ UiThreadUtil.runOnUiThread {
317
324
  try {
318
- val view = nativeViewHierarchyManager.resolveView(viewTag)
325
+ val uiManager = UIManagerHelper.getUIManagerForReactTag(context, viewTag)
326
+ val view = uiManager?.resolveView(viewTag)
319
327
  view?.maskView()
320
328
  } catch (t: Throwable) {
321
329
  t.printStackTrace()
package/index.cjs.js CHANGED
@@ -537,7 +537,7 @@ function stopJsRefreshRateSampler() {
537
537
  appStateSub = null;
538
538
  }
539
539
 
540
- var version = "0.7.0";
540
+ var version = "0.7.1";
541
541
  var pkg = {
542
542
  version: version};
543
543
 
package/index.esm.js CHANGED
@@ -535,7 +535,7 @@ function stopJsRefreshRateSampler() {
535
535
  appStateSub = null;
536
536
  }
537
537
 
538
- var version = "0.7.0";
538
+ var version = "0.7.1";
539
539
  var pkg = {
540
540
  version: version};
541
541
 
package/ios/CxSdk.swift CHANGED
@@ -351,25 +351,34 @@ class CxSdk: RCTEventEmitter {
351
351
  func maskViewByTag(viewTag: NSNumber,
352
352
  resolve:@escaping RCTPromiseResolveBlock,
353
353
  reject:@escaping RCTPromiseRejectBlock) -> Void {
354
- guard
355
- let bridge = RCTBridge.current(),
356
- let uiManager = bridge.uiManager
357
- else {
358
- reject("MASK_VIEW_ERROR", "no ui manager found, aborting maskViewByTag", nil)
354
+ guard let bridge = RCTBridge.current() else {
355
+ reject("MASK_VIEW_ERROR", "no bridge found, aborting maskViewByTag", nil)
359
356
  return
360
357
  }
361
358
 
362
- RCTExecuteOnUIManagerQueue {
363
- uiManager.addUIBlock { (_, viewRegistry) in
364
- if let view = viewRegistry?[viewTag] as? UIView {
365
- DispatchQueue.main.async {
366
- view.cxMask = true
367
- resolve("view with tag \(viewTag) marked for masking")
368
- }
369
- } else {
370
- reject("MASK_VIEW_ERROR", "view with tag \(viewTag) not found, aborting maskViewByTag", nil)
371
- }
359
+ // View resolution and the cxMask mutation must happen on the main thread.
360
+ DispatchQueue.main.async {
361
+ // New Architecture (Fabric): mounted views live in the component-view
362
+ // registry, not the legacy RCTUIManager registry. Resolve them via the
363
+ // surface presenter; without this, masking silently no-ops on Fabric.
364
+ // The presenter is typed non-null but is absent on the legacy
365
+ // architecture, so bind it through an optional before use.
366
+ let surfacePresenter: (any RCTSurfacePresenterStub)? = bridge.surfacePresenter()
367
+ if let surfacePresenter = surfacePresenter,
368
+ let view = surfacePresenter.findComponentView(withTag_DO_NOT_USE_DEPRECATED: viewTag.intValue) {
369
+ view.cxMask = true
370
+ resolve("view with tag \(viewTag) marked for masking")
371
+ return
372
+ }
373
+
374
+ // Legacy (Paper) architecture.
375
+ if let view = bridge.uiManager?.view(forReactTag: viewTag) {
376
+ view.cxMask = true
377
+ resolve("view with tag \(viewTag) marked for masking")
378
+ return
372
379
  }
380
+
381
+ reject("MASK_VIEW_ERROR", "view with tag \(viewTag) not found, aborting maskViewByTag", nil)
373
382
  }
374
383
  }
375
384
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/react-native-plugin",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Official Coralogix React Native plugin",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",