-
-
Notifications
You must be signed in to change notification settings - Fork 354
feat(replay): Add SentryMask and SentryUnmask iOS components #4224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
krystofwoldrich
merged 45 commits into
main
from
kw/feat/replay-custom-redact-components
Nov 25, 2024
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
0fc1b42
feat(replay): Add SentryMask and SentryUnmask native components
krystofwoldrich 9933a86
add clang-format
krystofwoldrich e17ac31
apply the formatter
krystofwoldrich 534cbce
Merge remote-tracking branch 'origin/main' into kw/feat/replay-custom…
krystofwoldrich ef863a1
Merge remote-tracking branch 'origin/main' into kw/internal/clag-format
krystofwoldrich d317e1e
Merge branch 'kw/internal/clag-format' into kw/feat/replay-custom-red…
krystofwoldrich eb9d2de
fix clang format
krystofwoldrich cbf400a
add native architecture masks for ios
krystofwoldrich be04dfc
Merge remote-tracking branch 'origin/main' into kw/feat/replay-custom…
krystofwoldrich 77691bd
add js tests
krystofwoldrich 45374be
fix eslint changing the native props interface to type
krystofwoldrich 0a127d2
Fix mask components for non uikit builds
krystofwoldrich 4f5b967
add changelog
krystofwoldrich eb64e8d
fix typo
krystofwoldrich 32c45e4
fix ts3.8 type check test
krystofwoldrich 691f8f4
Merge branch 'kw/fix/type-check' into kw/feat/replay-custom-redact-an…
krystofwoldrich 02bb913
fix new arch build decoupled replay and replay mask
krystofwoldrich 5315bb2
fix missing react native types
krystofwoldrich f07f155
Merge branch 'kw/fix/type-check' into kw/feat/replay-custom-redact-co…
krystofwoldrich 1b1c435
Merge branch 'main' into kw/feat/replay-custom-redact-components
krystofwoldrich cdd3da8
Update mask sample
krystofwoldrich 1170838
fix rn unmask class is added to unmask array
krystofwoldrich 3a9e155
fix tests for custom classes
krystofwoldrich c02d06c
Update samples/react-native/src/App.tsx
krystofwoldrich 9fe9c24
update redact example
krystofwoldrich 845c260
fix changelog and macos sample
krystofwoldrich 2edaeb0
fix rnsentry impl
krystofwoldrich 503c992
Merge branch 'main' into kw/feat/replay-custom-redact-components
krystofwoldrich 4f88064
fix class names tests
krystofwoldrich ddffa75
Merge branch 'kw/feat/replay-custom-redact-components' of github.com:…
krystofwoldrich e0ccb78
Update samples/react-native-macos/src/Screens/PlaygroundScreen.tsx
krystofwoldrich d16bc9a
Merge branch '6.3.0-beta' into kw/feat/replay-custom-redact-components
krystofwoldrich d9cc0d9
fix custom fallback tests
krystofwoldrich e665141
Fix lint and typos
krystofwoldrich 050acad
use mask/unmask classes directly
krystofwoldrich d50ffe2
fix changelog
krystofwoldrich 414590c
Merge branch '6.3.0-beta' into kw/feat/replay-custom-redact-components
krystofwoldrich eb457fc
fix old RN builds, remove ts from shipped package
krystofwoldrich 5965c22
Merge branch '6.3.0-beta' into kw/feat/replay-custom-redact-components
krystofwoldrich b41d759
fix custom mask tests
krystofwoldrich 8eaa867
add native component registry access explanation
krystofwoldrich 4e18dc4
Apply suggestions from code review
krystofwoldrich af13626
fix lint
krystofwoldrich c47fcd2
Merge branch 'main' into kw/feat/replay-custom-redact-components
krystofwoldrich 9b8c546
Update CHANGELOG.md
krystofwoldrich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
13 changes: 13 additions & 0 deletions
13
packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayPostInitTests.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import Sentry | ||
| import XCTest | ||
|
|
||
| final class RNSentryReplayPostInitTests: XCTestCase { | ||
|
|
||
| func testMask() { | ||
| XCTAssertEqual(ObjectIdentifier(RNSentryReplay.getMaskClass()), ObjectIdentifier(RNSentryReplayMask.self)) | ||
| } | ||
|
|
||
| func testUnmask() { | ||
| XCTAssertEqual(ObjectIdentifier(RNSentryReplay.getUnmaskClass()), ObjectIdentifier(RNSentryReplayUnmask.self)) | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,8 @@ | |
|
|
||
| + (void)postInit; | ||
|
|
||
| + (Class)getMaskClass; | ||
|
|
||
| + (Class)getUnmaskClass; | ||
|
|
||
| @end | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #import <Sentry/SentryDefines.h> | ||
|
|
||
| @interface RNSentryReplayBreadcrumbConverterHelper : NSObject | ||
|
|
||
| + (void)configureSessionReplayWithConverter; | ||
|
|
||
| @end |
17 changes: 17 additions & 0 deletions
17
packages/core/ios/RNSentryReplayBreadcrumbConverterHelper.m
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #import "RNSentryReplayBreadcrumbConverterHelper.h" | ||
|
|
||
| #if SENTRY_TARGET_REPLAY_SUPPORTED | ||
| # import "RNSentryReplayBreadcrumbConverter.h" | ||
|
|
||
| @implementation RNSentryReplayBreadcrumbConverterHelper | ||
|
|
||
| + (void)configureSessionReplayWithConverter | ||
| { | ||
| RNSentryReplayBreadcrumbConverter *breadcrumbConverter = | ||
| [[RNSentryReplayBreadcrumbConverter alloc] init]; | ||
| [PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter screenshotProvider:nil]; | ||
| } | ||
|
|
||
| @end | ||
|
|
||
| #endif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #import <Sentry/SentryDefines.h> | ||
|
|
||
| #if SENTRY_HAS_UIKIT | ||
|
|
||
| # import <React/RCTViewManager.h> | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| # import <React/RCTViewComponentView.h> | ||
| # else | ||
| # import <React/RCTView.h> | ||
| # endif | ||
|
|
||
| @interface RNSentryReplayMaskManager : RCTViewManager | ||
| @end | ||
|
|
||
| @interface RNSentryReplayMask : | ||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| RCTViewComponentView | ||
| # else | ||
| RCTView | ||
| # endif | ||
| @end | ||
|
|
||
| #endif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #import <Sentry/SentryDefines.h> | ||
|
|
||
| #if SENTRY_HAS_UIKIT | ||
|
|
||
| # import "RNSentryReplayMask.h" | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| # import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h> | ||
| # import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h> | ||
| // RCTFabricComponentsPlugins needed for RNSentryReplayMaskCls | ||
| # import <React/RCTFabricComponentsPlugins.h> | ||
| # endif | ||
|
|
||
| @implementation RNSentryReplayMaskManager | ||
|
|
||
| RCT_EXPORT_MODULE(RNSentryReplayMask) | ||
|
|
||
| - (UIView *)view | ||
| { | ||
| return [RNSentryReplayMask new]; | ||
| } | ||
|
|
||
| @end | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| @interface | ||
| RNSentryReplayMask () <RCTRNSentryReplayMaskViewProtocol> | ||
| @end | ||
| # endif | ||
|
|
||
| @implementation RNSentryReplayMask | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| + (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider | ||
| { | ||
| return facebook::react::concreteComponentDescriptorProvider< | ||
| facebook::react::RNSentryReplayMaskComponentDescriptor>(); | ||
| } | ||
| # endif | ||
|
|
||
| @end | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| Class<RCTComponentViewProtocol> | ||
| RNSentryReplayMaskCls(void) | ||
| { | ||
| return RNSentryReplayMask.class; | ||
| } | ||
| # endif | ||
|
|
||
| #endif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #import <Sentry/SentryDefines.h> | ||
|
|
||
| #if SENTRY_HAS_UIKIT | ||
|
|
||
| # import <React/RCTViewManager.h> | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| # import <React/RCTViewComponentView.h> | ||
| # else | ||
| # import <React/RCTView.h> | ||
| # endif | ||
|
|
||
| @interface RNSentryReplayUnmaskManager : RCTViewManager | ||
| @end | ||
|
|
||
| @interface RNSentryReplayUnmask : | ||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| RCTViewComponentView | ||
| # else | ||
| RCTView | ||
| # endif | ||
| @end | ||
|
|
||
| #endif | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #import <Sentry/SentryDefines.h> | ||
|
|
||
| #if SENTRY_HAS_UIKIT | ||
|
|
||
| # import "RNSentryReplayUnmask.h" | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| # import <react/renderer/components/RNSentrySpec/ComponentDescriptors.h> | ||
| # import <react/renderer/components/RNSentrySpec/RCTComponentViewHelpers.h> | ||
| // RCTFabricComponentsPlugins needed for RNSentryReplayUnmaskCls | ||
| # import <React/RCTFabricComponentsPlugins.h> | ||
| # endif | ||
|
|
||
| @implementation RNSentryReplayUnmaskManager | ||
|
|
||
| RCT_EXPORT_MODULE(RNSentryReplayUnmask) | ||
|
|
||
| - (UIView *)view | ||
| { | ||
| return [RNSentryReplayUnmask new]; | ||
| } | ||
|
|
||
| @end | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| @interface | ||
| RNSentryReplayUnmask () <RCTRNSentryReplayUnmaskViewProtocol> | ||
| @end | ||
| # endif | ||
|
|
||
| @implementation RNSentryReplayUnmask | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| + (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider | ||
| { | ||
| return facebook::react::concreteComponentDescriptorProvider< | ||
| facebook::react::RNSentryReplayUnmaskComponentDescriptor>(); | ||
| } | ||
| # endif | ||
|
|
||
| @end | ||
|
|
||
| # ifdef RCT_NEW_ARCH_ENABLED | ||
| Class<RCTComponentViewProtocol> | ||
| RNSentryReplayUnmaskCls(void) | ||
| { | ||
| return RNSentryReplayUnmask.class; | ||
| } | ||
| # endif | ||
|
|
||
| #endif |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.