Skip to content

Commit 1a2882e

Browse files
feat: add support for persistent sessions (#5)
1 parent 5e7262a commit 1a2882e

31 files changed

+64
-1925
lines changed

packages/react-native-sdk/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@
6060
"devDependencies": {
6161
"@types/ua-parser-js": "^0.7.36",
6262
"react-native": "0.72.6",
63+
"@react-native-async-storage/async-storage": "1.15.5",
6364
"user-agent-data-types": "^0.4.2"
6465
},
6566
"peerDependencies": {
66-
"react-native": ">=0.70.0"
67+
"react-native": ">=0.70.0",
68+
"@react-native-async-storage/async-storage": ">= 1.15.5"
6769
},
6870
"publishConfig": {
6971
"access": "public"

packages/react-native-sdk/src/config/getWebInstrumentations.ts

-8
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,19 @@ import type { Instrumentation } from '@grafana/faro-core';
33
import {
44
ConsoleInstrumentation,
55
ErrorsInstrumentation,
6-
PerformanceInstrumentation,
76
SessionInstrumentation,
87
ViewInstrumentation,
9-
WebVitalsInstrumentation,
108
} from '../instrumentations';
119

1210
import type { GetWebInstrumentationsOptions } from './types';
1311

1412
export function getWebInstrumentations(options: GetWebInstrumentationsOptions = {}): Instrumentation[] {
1513
const instrumentations: Instrumentation[] = [
1614
new ErrorsInstrumentation(),
17-
new WebVitalsInstrumentation(),
1815
new SessionInstrumentation(),
1916
new ViewInstrumentation(),
2017
];
2118

22-
if (options.enablePerformanceInstrumentation !== false) {
23-
// unshift to ensure that initialization starts before the other instrumentations
24-
instrumentations.unshift(new PerformanceInstrumentation());
25-
}
26-
2719
if (options.captureConsole !== false) {
2820
instrumentations.push(
2921
new ConsoleInstrumentation({

packages/react-native-sdk/src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ export {
1313
getStackFramesFromError,
1414
parseStacktrace,
1515
ViewInstrumentation,
16-
WebVitalsInstrumentation,
1716
SessionInstrumentation,
18-
PerformanceInstrumentation,
1917
} from './instrumentations';
2018
export type { ConsoleInstrumentationOptions, ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';
2119

packages/react-native-sdk/src/instrumentations/index.ts

-12
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,4 @@ export type { ErrorEvent, ExtendedPromiseRejectionEvent } from './errors';
1414

1515
export { ViewInstrumentation } from './view';
1616

17-
export { WebVitalsInstrumentation } from './webVitals';
1817

19-
export {
20-
PersistentSessionsManager,
21-
VolatileSessionsManager,
22-
MAX_SESSION_PERSISTENCE_TIME,
23-
MAX_SESSION_PERSISTENCE_TIME_BUFFER,
24-
SESSION_EXPIRATION_TIME,
25-
SESSION_INACTIVITY_TIME,
26-
STORAGE_KEY,
27-
} from './session';
28-
29-
export { PerformanceInstrumentation } from './performance';

packages/react-native-sdk/src/instrumentations/performance/index.ts

-1
This file was deleted.

packages/react-native-sdk/src/instrumentations/performance/instrumentation.test.ts

-152
This file was deleted.

packages/react-native-sdk/src/instrumentations/performance/instrumentation.ts

-33
This file was deleted.

0 commit comments

Comments
 (0)