@goliapkg/sentori-react-native 0.9.8 → 0.9.9
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/lib/native.d.ts +7 -0
- package/lib/native.d.ts.map +1 -1
- package/lib/native.js +51 -6
- package/lib/native.js.map +1 -1
- package/lib/replay.d.ts.map +1 -1
- package/lib/replay.js +13 -0
- package/lib/replay.js.map +1 -1
- package/package.json +1 -1
- package/src/native.ts +69 -4
- package/src/replay.ts +21 -0
package/lib/native.d.ts
CHANGED
|
@@ -72,4 +72,11 @@ export declare function captureNativeScreenshotWithMask(maskedIds: string[]): Pr
|
|
|
72
72
|
base64: string;
|
|
73
73
|
mediaType: string;
|
|
74
74
|
}>;
|
|
75
|
+
/** v0.9.9 — diagnostic peek used by the wireframe replay tick. Same
|
|
76
|
+
* four-way distinction as captureNativeScreenshotWithMask. Logged at
|
|
77
|
+
* most once per `startReplay()` (the wrapper in replay.ts gates). */
|
|
78
|
+
export declare function describeWireframeNative(): {
|
|
79
|
+
bound: boolean;
|
|
80
|
+
hasCaptureWireframe: boolean;
|
|
81
|
+
};
|
|
75
82
|
//# sourceMappingURL=native.d.ts.map
|
package/lib/native.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgHH,wBAAgB,eAAe,CAAC,MAAM,EAAE;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,IAAI,CAMP;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAQ5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAMzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IACzC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,IAAI,CAMP;AAED,wBAAgB,eAAe,IAAI,IAAI,CAMtC;AAED,+DAA+D;AAC/D,wBAAgB,uBAAuB,IAAI,IAAI,CAM9C;AAED,yEAAyE;AACzE,wBAAgB,oBAAoB,IAAI,IAAI,GAAG,MAAM,CAOpD;AAED,oEAAoE;AACpE,wBAAgB,sBAAsB,IAAI,IAAI,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAMhF;AAED,iEAAiE;AACjE,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C;AAED;;yBAEyB;AACzB,wBAAgB,wBAAwB,IAAI,IAAI,GAAG;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,CAMA;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,+BAA+B,CACnD,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAoCvD;AAED;;sEAEsE;AACtE,wBAAgB,uBAAuB,IAAI;IACzC,KAAK,EAAE,OAAO,CAAA;IACd,mBAAmB,EAAE,OAAO,CAAA;CAC7B,CAMA"}
|
package/lib/native.js
CHANGED
|
@@ -10,9 +10,23 @@ function native() {
|
|
|
10
10
|
try {
|
|
11
11
|
const core = require('expo-modules-core');
|
|
12
12
|
_native = core.requireNativeModule('Sentori');
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__ && _native !== null) {
|
|
14
|
+
// v0.9.9 — Insight asked for "tell me exactly which functions
|
|
15
|
+
// the iOS pod is currently exposing." Logged once per process
|
|
16
|
+
// (the cached _native short-circuits subsequent calls). Helps
|
|
17
|
+
// distinguish "pod is stale" from "method exists but throws
|
|
18
|
+
// at runtime" in one log line.
|
|
19
|
+
const keys = Object.keys(_native).sort();
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
console.warn('[sentori] native module bound; exposed methods:', keys.join(', ') || '(none)');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
15
25
|
_native = null;
|
|
26
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
27
|
+
// eslint-disable-next-line no-console
|
|
28
|
+
console.warn('[sentori] requireNativeModule("Sentori") threw', e);
|
|
29
|
+
}
|
|
16
30
|
}
|
|
17
31
|
return _native;
|
|
18
32
|
}
|
|
@@ -141,13 +155,44 @@ export function getRecentNativeException() {
|
|
|
141
155
|
*/
|
|
142
156
|
export async function captureNativeScreenshotWithMask(maskedIds) {
|
|
143
157
|
const n = native();
|
|
144
|
-
if (!n
|
|
158
|
+
if (!n) {
|
|
159
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
160
|
+
// eslint-disable-next-line no-console
|
|
161
|
+
console.warn('[sentori] native module not bound — requireNativeModule("Sentori") threw');
|
|
162
|
+
}
|
|
145
163
|
return null;
|
|
146
|
-
try {
|
|
147
|
-
return await n.captureScreenshotWithMask(maskedIds);
|
|
148
164
|
}
|
|
149
|
-
|
|
165
|
+
if (!n.captureScreenshotWithMask) {
|
|
166
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
167
|
+
// eslint-disable-next-line no-console
|
|
168
|
+
console.warn('[sentori] native.captureScreenshotWithMask missing — pod install may be stale');
|
|
169
|
+
}
|
|
150
170
|
return null;
|
|
151
171
|
}
|
|
172
|
+
try {
|
|
173
|
+
const r = await n.captureScreenshotWithMask(maskedIds);
|
|
174
|
+
if (!r && typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
175
|
+
// eslint-disable-next-line no-console
|
|
176
|
+
console.warn('[sentori] native screenshot returned null — no key window / render failed');
|
|
177
|
+
}
|
|
178
|
+
return r;
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
182
|
+
// eslint-disable-next-line no-console
|
|
183
|
+
console.warn('[sentori] native screenshot threw', e);
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** v0.9.9 — diagnostic peek used by the wireframe replay tick. Same
|
|
189
|
+
* four-way distinction as captureNativeScreenshotWithMask. Logged at
|
|
190
|
+
* most once per `startReplay()` (the wrapper in replay.ts gates). */
|
|
191
|
+
export function describeWireframeNative() {
|
|
192
|
+
const n = native();
|
|
193
|
+
return {
|
|
194
|
+
bound: n !== null,
|
|
195
|
+
hasCaptureWireframe: Boolean(n?.captureWireframe),
|
|
196
|
+
};
|
|
152
197
|
}
|
|
153
198
|
//# sourceMappingURL=native.js.map
|
package/lib/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmFH,IAAI,OAA+C,CAAA;AAEnD,SAAS,MAAM;IACb,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,OAAO,CAAA;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAEvC,CAAA;QACD,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAsB,SAAS,CAAC,CAAA;QAClE,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,IAAI,OAAO,KAAK,IAAI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,UAAU,uBAAuB;IAIrC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;IAClB,OAAO;QACL,KAAK,EAAE,CAAC,KAAK,IAAI;QACjB,mBAAmB,EAAE,OAAO,CAAC,CAAC,EAAE,gBAAgB,CAAC;KAClD,CAAA;AACH,CAAC"}
|
package/lib/replay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AA+CA,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC;IAC3B,mCAAmC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAoCrD;AAED,wBAAgB,UAAU,IAAI,IAAI,CAOjC;AA6CD;;2BAE2B;AAC3B,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C"}
|
package/lib/replay.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
// screenshot strip.
|
|
19
19
|
import { startSpan } from '@goliapkg/sentori-core';
|
|
20
20
|
import { getRegisteredMaskQuery } from './mask';
|
|
21
|
+
import { describeWireframeNative } from './native';
|
|
21
22
|
import { isNativeModuleLinked } from './native-loader';
|
|
22
23
|
const TICK_INTERVAL_MS = 1000;
|
|
23
24
|
const RING_SIZE = 60;
|
|
@@ -44,10 +45,22 @@ export function startReplay(opts) {
|
|
|
44
45
|
// — same pattern as other native peers — for Expo Go / unlinked
|
|
45
46
|
// builds.
|
|
46
47
|
if (!isNativeModuleLinked('Sentori') && !isNativeModuleLinked('SentoriModule')) {
|
|
48
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
49
|
+
// eslint-disable-next-line no-console
|
|
50
|
+
console.warn('[sentori] replay: Sentori native module not linked — replay attachments will stay empty');
|
|
51
|
+
}
|
|
47
52
|
// Falls back silently. Replay rings stay empty; captureException
|
|
48
53
|
// simply doesn't attach a replay.
|
|
49
54
|
return;
|
|
50
55
|
}
|
|
56
|
+
// v0.9.9 — log once per start so Insight (or anyone) can confirm
|
|
57
|
+
// whether the native module exposes captureWireframe at all,
|
|
58
|
+
// distinguishing this from "ring never filled because tick threw".
|
|
59
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
60
|
+
const info = describeWireframeNative();
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.warn('[sentori] replay: starting', 'bound=', info.bound, 'hasCaptureWireframe=', info.hasCaptureWireframe);
|
|
63
|
+
}
|
|
51
64
|
_running = true;
|
|
52
65
|
_nativeMod = loadNativeReplay();
|
|
53
66
|
const period = Math.max(MIN_TICK_PERIOD_MS, Math.floor(TICK_INTERVAL_MS / (opts.hz ?? 1)));
|
package/lib/replay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,mEAAmE;AACnE,mEAAmE;AACnE,kEAAkE;AAClE,kEAAkE;AAClE,4DAA4D;AAC5D,EAAE;AACF,gCAAgC;AAChC,kEAAkE;AAClE,iEAAiE;AACjE,+DAA+D;AAC/D,6DAA6D;AAC7D,wDAAwD;AACxD,iEAAiE;AACjE,iEAAiE;AACjE,4DAA4D;AAC5D,wBAAwB;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings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EAAE,CAAC;IACb,KAAK,GAAG,EAAE,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goliapkg/sentori-react-native",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"description": "Sentori SDK for React Native \u2014 JS-layer error capture, native crash handlers (iOS / Android), batched transport, fetch + react-navigation tracing.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://sentori.golia.jp",
|
package/src/native.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* this keeps the SDK usable in pure-JS environments (jest, bun test, web).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
declare const __DEV__: boolean | undefined
|
|
8
|
+
|
|
7
9
|
type SentoriNativeModule = {
|
|
8
10
|
drainPending: () => Promise<string[]>
|
|
9
11
|
setConfig: (config: {
|
|
@@ -58,6 +60,13 @@ type SentoriNativeModule = {
|
|
|
58
60
|
captureScreenshotWithMask?: (
|
|
59
61
|
maskedIds: string[],
|
|
60
62
|
) => Promise<null | { base64: string; mediaType: string }>
|
|
63
|
+
/**
|
|
64
|
+
* v0.9.6 #2 — wireframe view-tree snapshot. iOS walks the
|
|
65
|
+
* UIView hierarchy, paints each node as a rect/text descriptor,
|
|
66
|
+
* intersects with masked nativeIDs. Returns an NDJSON-shaped
|
|
67
|
+
* snapshot string or null on failure.
|
|
68
|
+
*/
|
|
69
|
+
captureWireframe?: (maskedIds: string[]) => null | string
|
|
61
70
|
/**
|
|
62
71
|
* Phase 22 sub-D / sub-E: cross-platform main-thread watchdog.
|
|
63
72
|
* Android: 5 s / 1 s defaults (matches the OS ANR threshold).
|
|
@@ -85,8 +94,22 @@ function native(): SentoriNativeModule | null {
|
|
|
85
94
|
requireNativeModule: <T>(name: string) => T
|
|
86
95
|
}
|
|
87
96
|
_native = core.requireNativeModule<SentoriNativeModule>('Sentori')
|
|
88
|
-
|
|
97
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__ && _native !== null) {
|
|
98
|
+
// v0.9.9 — Insight asked for "tell me exactly which functions
|
|
99
|
+
// the iOS pod is currently exposing." Logged once per process
|
|
100
|
+
// (the cached _native short-circuits subsequent calls). Helps
|
|
101
|
+
// distinguish "pod is stale" from "method exists but throws
|
|
102
|
+
// at runtime" in one log line.
|
|
103
|
+
const keys = Object.keys(_native as object).sort()
|
|
104
|
+
// eslint-disable-next-line no-console
|
|
105
|
+
console.warn('[sentori] native module bound; exposed methods:', keys.join(', ') || '(none)')
|
|
106
|
+
}
|
|
107
|
+
} catch (e) {
|
|
89
108
|
_native = null
|
|
109
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
110
|
+
// eslint-disable-next-line no-console
|
|
111
|
+
console.warn('[sentori] requireNativeModule("Sentori") threw', e)
|
|
112
|
+
}
|
|
90
113
|
}
|
|
91
114
|
return _native
|
|
92
115
|
}
|
|
@@ -230,10 +253,52 @@ export async function captureNativeScreenshotWithMask(
|
|
|
230
253
|
maskedIds: string[],
|
|
231
254
|
): Promise<null | { base64: string; mediaType: string }> {
|
|
232
255
|
const n = native()
|
|
233
|
-
if (!n
|
|
256
|
+
if (!n) {
|
|
257
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
258
|
+
// eslint-disable-next-line no-console
|
|
259
|
+
console.warn(
|
|
260
|
+
'[sentori] native module not bound — requireNativeModule("Sentori") threw',
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
return null
|
|
264
|
+
}
|
|
265
|
+
if (!n.captureScreenshotWithMask) {
|
|
266
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
267
|
+
// eslint-disable-next-line no-console
|
|
268
|
+
console.warn(
|
|
269
|
+
'[sentori] native.captureScreenshotWithMask missing — pod install may be stale',
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
return null
|
|
273
|
+
}
|
|
234
274
|
try {
|
|
235
|
-
|
|
236
|
-
|
|
275
|
+
const r = await n.captureScreenshotWithMask(maskedIds)
|
|
276
|
+
if (!r && typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
277
|
+
// eslint-disable-next-line no-console
|
|
278
|
+
console.warn(
|
|
279
|
+
'[sentori] native screenshot returned null — no key window / render failed',
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
return r
|
|
283
|
+
} catch (e) {
|
|
284
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
285
|
+
// eslint-disable-next-line no-console
|
|
286
|
+
console.warn('[sentori] native screenshot threw', e)
|
|
287
|
+
}
|
|
237
288
|
return null
|
|
238
289
|
}
|
|
239
290
|
}
|
|
291
|
+
|
|
292
|
+
/** v0.9.9 — diagnostic peek used by the wireframe replay tick. Same
|
|
293
|
+
* four-way distinction as captureNativeScreenshotWithMask. Logged at
|
|
294
|
+
* most once per `startReplay()` (the wrapper in replay.ts gates). */
|
|
295
|
+
export function describeWireframeNative(): {
|
|
296
|
+
bound: boolean
|
|
297
|
+
hasCaptureWireframe: boolean
|
|
298
|
+
} {
|
|
299
|
+
const n = native()
|
|
300
|
+
return {
|
|
301
|
+
bound: n !== null,
|
|
302
|
+
hasCaptureWireframe: Boolean(n?.captureWireframe),
|
|
303
|
+
}
|
|
304
|
+
}
|
package/src/replay.ts
CHANGED
|
@@ -20,8 +20,11 @@
|
|
|
20
20
|
import { startSpan } from '@goliapkg/sentori-core';
|
|
21
21
|
|
|
22
22
|
import { getRegisteredMaskQuery } from './mask';
|
|
23
|
+
import { describeWireframeNative } from './native';
|
|
23
24
|
import { isNativeModuleLinked } from './native-loader';
|
|
24
25
|
|
|
26
|
+
declare const __DEV__: boolean | undefined;
|
|
27
|
+
|
|
25
28
|
const TICK_INTERVAL_MS = 1000;
|
|
26
29
|
const RING_SIZE = 60;
|
|
27
30
|
|
|
@@ -55,10 +58,28 @@ export function startReplay(opts: ReplayOptions): void {
|
|
|
55
58
|
// — same pattern as other native peers — for Expo Go / unlinked
|
|
56
59
|
// builds.
|
|
57
60
|
if (!isNativeModuleLinked('Sentori') && !isNativeModuleLinked('SentoriModule')) {
|
|
61
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
62
|
+
// eslint-disable-next-line no-console
|
|
63
|
+
console.warn(
|
|
64
|
+
'[sentori] replay: Sentori native module not linked — replay attachments will stay empty',
|
|
65
|
+
);
|
|
66
|
+
}
|
|
58
67
|
// Falls back silently. Replay rings stay empty; captureException
|
|
59
68
|
// simply doesn't attach a replay.
|
|
60
69
|
return;
|
|
61
70
|
}
|
|
71
|
+
// v0.9.9 — log once per start so Insight (or anyone) can confirm
|
|
72
|
+
// whether the native module exposes captureWireframe at all,
|
|
73
|
+
// distinguishing this from "ring never filled because tick threw".
|
|
74
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
75
|
+
const info = describeWireframeNative();
|
|
76
|
+
// eslint-disable-next-line no-console
|
|
77
|
+
console.warn(
|
|
78
|
+
'[sentori] replay: starting',
|
|
79
|
+
'bound=', info.bound,
|
|
80
|
+
'hasCaptureWireframe=', info.hasCaptureWireframe,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
62
83
|
_running = true;
|
|
63
84
|
_nativeMod = loadNativeReplay();
|
|
64
85
|
const period = Math.max(MIN_TICK_PERIOD_MS, Math.floor(TICK_INTERVAL_MS / (opts.hz ?? 1)));
|