@bugsee/react-native 7.0.0-beta2 → 7.0.0-beta3
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/README.md +38 -1
- package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapper.m +1 -1
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperTests.m +1 -1
- package/package.json +2 -2
- package/plugin/build/index.js +1 -1
- package/scripts/bugsee-xcode.sh +0 -0
- package/scripts/compose-then-inject.js +0 -0
- package/scripts/hermesc-preserve-js.js +0 -0
- package/scripts/hermesc-preserve-js.sh +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ added.
|
|
|
9
9
|
|
|
10
10
|
## Status: beta
|
|
11
11
|
|
|
12
|
-
This is a beta (`7.0.0-
|
|
12
|
+
This is a beta (`7.0.0-beta3`), built on the 7.x native SDKs, and the iOS SDK it
|
|
13
13
|
bundles is itself a beta. `latest` and `beta` both point at it for now, so a plain
|
|
14
14
|
`yarn add @bugsee/react-native` installs it; the `@beta` form in [Install](#install)
|
|
15
15
|
keeps following betas once a stable release exists. The API can still change
|
|
@@ -89,6 +89,43 @@ running, or a token the backend rejects — without that being an error worth
|
|
|
89
89
|
throwing on. Capture comes up asynchronously, so poll `getStatus()` rather
|
|
90
90
|
than assuming a resolved `launch` means recording has begun.
|
|
91
91
|
|
|
92
|
+
### Reporting render errors
|
|
93
|
+
|
|
94
|
+
Wrap part of the tree (or the whole app) in `<ErrorBoundary>` to report an error thrown while rendering
|
|
95
|
+
and show a fallback instead of an empty screen:
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
import { ErrorBoundary } from '@bugsee/react-native';
|
|
99
|
+
|
|
100
|
+
<ErrorBoundary
|
|
101
|
+
fallback={({ error, componentStack, resetError }) => (
|
|
102
|
+
<ErrorScreen onRetry={resetError} />
|
|
103
|
+
)}
|
|
104
|
+
onError={(error, componentStack) => console.warn('render failed', error)}
|
|
105
|
+
options={{ domain: 'checkout' }}
|
|
106
|
+
>
|
|
107
|
+
<App />
|
|
108
|
+
</ErrorBoundary>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
| Prop | |
|
|
112
|
+
|---|---|
|
|
113
|
+
| `fallback` | What to render after an error: an element, or a function that receives `error`, `componentStack` and `resetError()`. Without it the boundary renders nothing, so give it one. |
|
|
114
|
+
| `onError(error, componentStack)` | Called after the boundary has caught the error, and after it has reported it unless the error was already reported (see the list below). |
|
|
115
|
+
| `onReset(error, componentStack)` | Called when `resetError()` is called, just before the children render again. |
|
|
116
|
+
| `options` | Handled-exception options for the report. `{ domain }` only, as for `Bugsee.logException`. An invalid value logs a warning and the error is reported without options. |
|
|
117
|
+
|
|
118
|
+
What it does and does not do:
|
|
119
|
+
|
|
120
|
+
- The error is reported as a **handled** exception, with the React component stack attached as an extra
|
|
121
|
+
(not as the error's `cause`).
|
|
122
|
+
- An error object the SDK has already reported is not reported again, so a boundary and
|
|
123
|
+
`Bugsee.logException` (or the global handler) do not file the same error twice.
|
|
124
|
+
- `children` is a plain React node. The function-as-children form from 6.x is not supported.
|
|
125
|
+
- Like any React error boundary it only catches errors thrown while **rendering**. Errors in event
|
|
126
|
+
handlers, timers and promises are not caught by it; the global handlers `launch` installs report the
|
|
127
|
+
uncaught ones.
|
|
128
|
+
|
|
92
129
|
### Hiding a view from recordings
|
|
93
130
|
|
|
94
131
|
Wrap anything that must never be recorded in `<BugseeSecure>`:
|
|
@@ -46,7 +46,7 @@ static NSString *BGSRNStringOr(NSDictionary *source, NSString *key, NSString *fa
|
|
|
46
46
|
// test compares the three so they cannot drift.
|
|
47
47
|
return [self wrapperWithIdentity:@{
|
|
48
48
|
@"type" : @"react_native",
|
|
49
|
-
@"version" : @"7.0.0-
|
|
49
|
+
@"version" : @"7.0.0-beta3",
|
|
50
50
|
@"context" : @{},
|
|
51
51
|
}];
|
|
52
52
|
}
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
- (void)testWithoutJsRuntimeCarriesOnlyTypeAndVersion {
|
|
59
59
|
BGSRNWrapper *wrapper = [BGSRNWrapper wrapperWithoutJsRuntime];
|
|
60
60
|
XCTAssertEqualObjects(wrapper.wrapperType, @"react_native");
|
|
61
|
-
XCTAssertEqualObjects(wrapper.wrapperVersion, @"7.0.0-
|
|
61
|
+
XCTAssertEqualObjects(wrapper.wrapperVersion, @"7.0.0-beta3");
|
|
62
62
|
XCTAssertNil(wrapper.wrapperBuild);
|
|
63
63
|
XCTAssertEqual(wrapper.context.count, (NSUInteger)0);
|
|
64
64
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bugsee/react-native",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-beta3",
|
|
4
4
|
"description": "Bugsee SDK for React Native",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.bugsee.com",
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
}
|
|
65
|
-
}
|
|
65
|
+
}
|
package/plugin/build/index.js
CHANGED
|
@@ -213,5 +213,5 @@ function listSchemes(iosRoot) {
|
|
|
213
213
|
}
|
|
214
214
|
return schemes;
|
|
215
215
|
}
|
|
216
|
-
exports.default = (0, config_plugins_1.createRunOncePlugin)(withBugsee, '@bugsee/react-native', '7.0.0-
|
|
216
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withBugsee, '@bugsee/react-native', '7.0.0-beta3');
|
|
217
217
|
//# sourceMappingURL=index.js.map
|
package/scripts/bugsee-xcode.sh
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|