Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
- Prevent Sentry's iOS `-force_load` flag from being dropped when another pod sets `OTHER_LDFLAGS[sdk=鈥` ([#6801](https://github.com/getsentry/sentry-react-native/pull/6801))
- Fix Android build failing with `cannot find symbol ReplayIntegration` when `sentry-android-replay` is excluded ([#6803](https://github.com/getsentry/sentry-react-native/pull/6803))
- Preserve already-quoted React Native bundle script paths in the Expo iOS plugin ([#6796](https://github.com/getsentry/sentry-react-native/pull/6796))
- Register the session replay mask components through the iOS codegen component provider ([#6810](https://github.com/getsentry/sentry-react-native/pull/6810))
- `codegenConfig.ios.componentProvider` now maps `RNSentryReplayMask` and `RNSentryReplayUnmask` to their view classes.
- React Native resolves both components directly. It no longer falls back to the legacy interop layer for view managers, which an app can turn off with `RCT_REMOVE_LEGACY_COMPONENT_INTEROP`.
- Both views now set typed default props. They no longer crash on mount through the provider.

### Dependencies

Expand Down
12 changes: 12 additions & 0 deletions packages/core/ios/Replay/RNSentryReplayMask.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# ifdef RCT_NEW_ARCH_ENABLED
# import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h>
# import <react/renderer/components/RNSentrySpec/Props.h>
# import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h>
// RCTFabricComponentsPlugins needed for RNSentryReplayMaskCls
# import <React/RCTFabricComponentsPlugins.h>
Expand All @@ -30,6 +31,17 @@ @interface RNSentryReplayMask () <RCTRNSentryReplayMaskViewProtocol>
@implementation RNSentryReplayMask

# ifdef RCT_NEW_ARCH_ENABLED
// Fabric requires typed default props, or mounting aborts in -updateProps:oldProps:.
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
static const auto defaultProps
= std::make_shared<const facebook::react::RNSentryReplayMaskProps>();
_props = defaultProps;
}
return self;
}

+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
{
return facebook::react::concreteComponentDescriptorProvider<
Expand Down
12 changes: 12 additions & 0 deletions packages/core/ios/Replay/RNSentryReplayUnmask.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# ifdef RCT_NEW_ARCH_ENABLED
# import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h>
# import <react/renderer/components/RNSentrySpec/Props.h>
# import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h>
// RCTFabricComponentsPlugins needed for RNSentryReplayUnmaskCls
# import <React/RCTFabricComponentsPlugins.h>
Expand All @@ -30,6 +31,17 @@ @interface RNSentryReplayUnmask () <RCTRNSentryReplayUnmaskViewProtocol>
@implementation RNSentryReplayUnmask

# ifdef RCT_NEW_ARCH_ENABLED
// Fabric requires typed default props, or mounting aborts in -updateProps:oldProps:.
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
static const auto defaultProps
= std::make_shared<const facebook::react::RNSentryReplayUnmaskProps>();
_props = defaultProps;
}
return self;
}

+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
{
return facebook::react::concreteComponentDescriptorProvider<
Expand Down
6 changes: 6 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@
"jsSrcsDir": "src",
"android": {
"javaPackageName": "io.sentry.react"
},
"ios": {
"componentProvider": {
"RNSentryReplayMask": "RNSentryReplayMask",
"RNSentryReplayUnmask": "RNSentryReplayUnmask"
}
}
},
"swiftpmConfig": {
Expand Down
Loading