expo-observe 57.0.9 → 57.0.10
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/CHANGELOG.md +12 -0
- package/build/ObserveErrorBoundary.d.ts +2 -0
- package/build/ObserveErrorBoundary.d.ts.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/integrations/expo-router/storage.d.ts +1 -1
- package/build/module.d.ts +2 -1
- package/build/module.d.ts.map +1 -1
- package/build/module.web.d.ts +2 -0
- package/build/module.web.d.ts.map +1 -1
- package/build/reportCaughtError.d.ts +9 -0
- package/build/reportCaughtError.d.ts.map +1 -0
- package/build/types.d.ts +34 -0
- package/build/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/OpenTelemetry.swift +2 -4
- package/ios/Tests/OpenTelemetryTests.swift +25 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/{57.0.9/expo.modules.observe-57.0.9-sources.jar → 57.0.10/expo.modules.observe-57.0.10-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/{57.0.9/expo.modules.observe-57.0.9.aar → 57.0.10/expo.modules.observe-57.0.10.aar} +0 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/{57.0.9/expo.modules.observe-57.0.9.module → 57.0.10/expo.modules.observe-57.0.10.module} +23 -23
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.module.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/{57.0.9/expo.modules.observe-57.0.9.pom → 57.0.10/expo.modules.observe-57.0.10.pom} +2 -2
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.10/expo.modules.observe-57.0.10.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha512 +1 -1
- package/package.json +4 -4
- package/src/ObserveErrorBoundary.tsx +5 -0
- package/src/index.ts +5 -0
- package/src/integrations/expo-router/storage.ts +1 -1
- package/src/integrations/expo-router/useObserveForRouter.ts +1 -1
- package/src/integrations/react-navigation/useObserveForReactNavigation.ts +1 -1
- package/src/module.ts +34 -1
- package/src/module.web.ts +10 -0
- package/src/reportCaughtError.ts +57 -0
- package/src/types.ts +38 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.module.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/57.0.9/expo.modules.observe-57.0.9.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 57.0.10 — 2026-08-04
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- Add `Observe.registerIntegration` to register an integration ([#48245](https://github.com/expo/expo/pull/48245), [#48268](https://github.com/expo/expo/pull/48268) by [@Ubax](https://github.com/Ubax))
|
|
18
|
+
- Expose `ObserveErrorBoundary`, a React error boundary that records render-phase errors. ([#47341](https://github.com/expo/expo/pull/47341) by [@tsapeta](https://github.com/tsapeta))
|
|
19
|
+
- Add `reportError` to report caught, non-fatal errors from your own `try`/`catch` blocks. ([#47871](https://github.com/expo/expo/pull/47871) by [@tsapeta](https://github.com/tsapeta))
|
|
20
|
+
|
|
21
|
+
### 🐛 Bug fixes
|
|
22
|
+
|
|
23
|
+
- Fix OTel date conversion ([#48161](https://github.com/expo/expo/pull/48161) by [@Ubax](https://github.com/Ubax))
|
|
24
|
+
|
|
13
25
|
## 57.0.9 — 2026-07-29
|
|
14
26
|
|
|
15
27
|
_This version does not introduce any user-facing changes._
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AppMetricsErrorBoundary as ObserveErrorBoundary, type AppMetricsErrorBoundaryProps as ObserveErrorBoundaryProps, type AppMetricsErrorBoundaryFallbackProps as ObserveErrorBoundaryFallbackProps, } from 'expo-app-metrics';
|
|
2
|
+
//# sourceMappingURL=ObserveErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObserveErrorBoundary.d.ts","sourceRoot":"","sources":["../src/ObserveErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,IAAI,oBAAoB,EAC/C,KAAK,4BAA4B,IAAI,yBAAyB,EAC9D,KAAK,oCAAoC,IAAI,iCAAiC,GAC/E,MAAM,kBAAkB,CAAC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import Observe from './module';
|
|
2
2
|
export { default as AppMetrics } from 'expo-app-metrics';
|
|
3
|
+
export { ObserveErrorBoundary } from './ObserveErrorBoundary';
|
|
4
|
+
export type { ObserveErrorBoundaryProps, ObserveErrorBoundaryFallbackProps, } from './ObserveErrorBoundary';
|
|
3
5
|
export { ObserveInteractiveMarker } from './ObserveInteractiveMarker';
|
|
4
6
|
export type { ObserveInteractiveMarkerProps } from './ObserveInteractiveMarker';
|
|
5
7
|
export { ObserveRoot } from './ObserveRoot';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,6DAA6D;AAC7D,eAAe,OAAO,CAAC;AAEvB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EACzB,aAAa,EACb,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EACV,yBAAyB,EACzB,iCAAiC,GAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,6DAA6D;AAC7D,eAAe,OAAO,CAAC;AAEvB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EACzB,aAAa,EACb,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -14,7 +14,7 @@ export interface RouterIntegrationStorage {
|
|
|
14
14
|
pendingActions: PendingAction[];
|
|
15
15
|
renderedScreensIds: Set<string>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Whether the app had already recorded the first render of the screen
|
|
18
18
|
*/
|
|
19
19
|
hasRecordedInitialTtr: boolean;
|
|
20
20
|
/**
|
package/build/module.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ObserveModule } from './types';
|
|
1
|
+
import type { ObserveIntegrationsConfig, ObserveModule } from './types';
|
|
2
2
|
declare const Observe: ObserveModule;
|
|
3
|
+
export declare function registerIntegrationImpl<K extends keyof ObserveIntegrationsConfig>(target: Pick<ObserveModule, 'addListener' | 'getIntegrations'>, name: K, callback: (config: ObserveIntegrationsConfig[K]) => void): void;
|
|
3
4
|
export default Observe;
|
|
4
5
|
//# sourceMappingURL=module.d.ts.map
|
package/build/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAiB,yBAAyB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIvF,QAAA,MAAM,OAAO,EAAE,aA0Db,CAAC;AAEH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,yBAAyB,EAC/E,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,iBAAiB,CAAC,EAC9D,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC,KAAK,IAAI,GACvD,IAAI,CAeN;AAED,eAAe,OAAO,CAAC"}
|
package/build/module.web.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ declare class ExpoObserveModule extends NativeModule<ObserveModuleEvents> implem
|
|
|
5
5
|
dispatchEvents(): Promise<void>;
|
|
6
6
|
configure(config: ObserveConfig): void;
|
|
7
7
|
getIntegrations(): ObserveIntegrationsConfig;
|
|
8
|
+
registerIntegration<K extends keyof ObserveIntegrationsConfig>(name: K, callback: (config: ObserveIntegrationsConfig[K]) => void): void;
|
|
8
9
|
logEvent(name: string, options?: LogEventOptions): void;
|
|
10
|
+
reportError(error: unknown): void;
|
|
9
11
|
markFirstRender(): void;
|
|
10
12
|
markInteractive(attributes?: MetricAttributes): void;
|
|
11
13
|
setGlobalAttributes(attributes?: ObserveAttributes | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.web.d.ts","sourceRoot":"","sources":["../src/module.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,MAAM,CAAC;AACvD,OAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.web.d.ts","sourceRoot":"","sources":["../src/module.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,MAAM,CAAC;AACvD,OAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG3F,OAAO,KAAK,EACV,aAAa,EACb,yBAAyB,EACzB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,cAAM,iBAAkB,SAAQ,YAAY,CAAC,mBAAmB,CAAE,YAAW,aAAa;IAClF,cAAc;IACpB,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IACtC,eAAe,IAAI,yBAAyB;IAG5C,mBAAmB,CAAC,CAAC,SAAS,MAAM,yBAAyB,EAC3D,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC,KAAK,IAAI,GACvD,IAAI;IAGP,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI;IAGvD,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAGjC,eAAe,IAAI,IAAI;IAGvB,eAAe,CAAC,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI;IAGpD,mBAAmB,CAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI;IAGhE,iBAAiB,CAAC,QAAQ,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;CAC7E;;AAED,wBAAmE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports a caught value as a non-fatal `reportedByUser`-source error through the AppMetrics module,
|
|
3
|
+
* shared by the native and web `Observe.reportError` implementations.
|
|
4
|
+
*
|
|
5
|
+
* Never throws: it's called from a `catch` block, so a failure here (a pathological thrown value, or
|
|
6
|
+
* a native call that rejects the payload) must not turn a handled error into an unhandled one.
|
|
7
|
+
*/
|
|
8
|
+
export declare function reportCaughtError(error: unknown): void;
|
|
9
|
+
//# sourceMappingURL=reportCaughtError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reportCaughtError.d.ts","sourceRoot":"","sources":["../src/reportCaughtError.ts"],"names":[],"mappings":"AAqCA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAYtD"}
|
package/build/types.d.ts
CHANGED
|
@@ -121,6 +121,20 @@ export declare class ObserveModule extends NativeModule<ObserveModuleEvents> {
|
|
|
121
121
|
* call, or an empty object if `configure` has not run yet.
|
|
122
122
|
*/
|
|
123
123
|
getIntegrations(): ObserveIntegrationsConfig;
|
|
124
|
+
/**
|
|
125
|
+
* Invokes a callback once when the named integration configuration becomes available.
|
|
126
|
+
*
|
|
127
|
+
* @param name Integration name.
|
|
128
|
+
* @param callback Function called with the integration configuration.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* Observe.registerIntegration('expo-router', config => {
|
|
133
|
+
* console.log(config);
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
registerIntegration<K extends keyof ObserveIntegrationsConfig>(name: K, callback: (config: ObserveIntegrationsConfig[K]) => void): void;
|
|
124
138
|
/**
|
|
125
139
|
* Records a log event against the current main session. The event is
|
|
126
140
|
* persisted locally and dispatched on the next `dispatchEvents()` flush.
|
|
@@ -131,6 +145,26 @@ export declare class ObserveModule extends NativeModule<ObserveModuleEvents> {
|
|
|
131
145
|
* @param options Optional body, attributes, and severity overrides.
|
|
132
146
|
*/
|
|
133
147
|
logEvent(name: string, options?: LogEventOptions): void;
|
|
148
|
+
/**
|
|
149
|
+
* Reports an error your code caught and handled, recorded as a non-fatal `exception` event. Use it
|
|
150
|
+
* to keep visibility into failures you recover from, which never reach the automatic global handler
|
|
151
|
+
* or an error boundary.
|
|
152
|
+
*
|
|
153
|
+
* The thrown value is normalized: an `Error`'s `name`, `message`, and `stack` are captured; any
|
|
154
|
+
* other value (a string, a plain object) is stringified as the message.
|
|
155
|
+
*
|
|
156
|
+
* @param error The caught value. An `Error` is preferred, but any thrown value is accepted.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* try {
|
|
161
|
+
* await syncCart();
|
|
162
|
+
* } catch (error) {
|
|
163
|
+
* Observe.reportError(error);
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
reportError(error: unknown): void;
|
|
134
168
|
/**
|
|
135
169
|
* Marks the first render of the app. Used to compute the `cold_ttr` and
|
|
136
170
|
* `warm_ttr` metrics.
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE7F;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,kCAAkC,CAAC;IAC7D;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,kCAAkC,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE;QAAE,YAAY,EAAE,yBAAyB,CAAA;KAAE,KAAK,IAAI,CAAC;CAC3E,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IAC1E,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IACtC;;;OAGG;IACH,eAAe,IAAI,yBAAyB;IAC5C;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI;IACvD;;;OAGG;IACH,eAAe,IAAI,IAAI;IACvB;;;;;;;OAOG;IACH,eAAe,CAAC,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI;IACpD;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI;IAChE;;;;;;OAMG;IACH,iBAAiB,CAAC,QAAQ,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;CAC7E"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE7F;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,kCAAkC,CAAC;IAC7D;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,kCAAkC,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE;QAAE,YAAY,EAAE,yBAAyB,CAAA;KAAE,KAAK,IAAI,CAAC;CAC3E,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IAC1E,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IACtC;;;OAGG;IACH,eAAe,IAAI,yBAAyB;IAC5C;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,CAAC,SAAS,MAAM,yBAAyB,EAC3D,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC,KAAK,IAAI,GACvD,IAAI;IACP;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI;IACvD;;;;;;;;;;;;;;;;;;OAkBG;IAEH,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IACjC;;;OAGG;IACH,eAAe,IAAI,IAAI;IACvB;;;;;;;OAOG;IACH,eAAe,CAAC,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI;IACpD;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI;IAChE;;;;;;OAMG;IACH,iBAAiB,CAAC,QAAQ,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;CAC7E"}
|
package/expo-module.config.json
CHANGED
package/ios/OpenTelemetry.swift
CHANGED
|
@@ -193,13 +193,11 @@ let metricNameMap = [
|
|
|
193
193
|
"navigation/tti": "expo.navigation.tti",
|
|
194
194
|
]
|
|
195
195
|
|
|
196
|
-
nonisolated(unsafe) let formatter = ISO8601DateFormatter()
|
|
197
|
-
|
|
198
196
|
private func nsFromISOString(_ dateString: String?) -> UInt64 {
|
|
199
197
|
if let dateString,
|
|
200
|
-
let date =
|
|
198
|
+
let date = try? Date.ISO8601FormatStyle().parse(dateString)
|
|
201
199
|
{
|
|
202
|
-
return UInt64(date.timeIntervalSince1970 *
|
|
200
|
+
return UInt64((date.timeIntervalSince1970 * 1_000).rounded()) * 1_000_000
|
|
203
201
|
}
|
|
204
202
|
return UInt64(Date().timeIntervalSince1970 * 1_000_000_000)
|
|
205
203
|
}
|
|
@@ -148,6 +148,31 @@ struct OpenTelemetryTests {
|
|
|
148
148
|
#expect(otMetric.gauge.dataPoints[0].timeUnixNano == expectedNanos)
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
@Test
|
|
152
|
+
func `toOTMetric converts ISO8601 timestamp with fractional seconds to nanoseconds`() {
|
|
153
|
+
let metric = makeMetric(name: "loadTime", value: 1.0, timestamp: "2026-01-09T12:08:09.123Z")
|
|
154
|
+
let otMetric = metric.toOTMetric()
|
|
155
|
+
|
|
156
|
+
#expect(otMetric.gauge.dataPoints[0].timeUnixNano == 1_767_960_489_123_000_000)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@Test
|
|
160
|
+
func `toOTLogRecord converts ISO8601 timestamp with fractional seconds to nanoseconds`() {
|
|
161
|
+
let log = Event.Log(
|
|
162
|
+
name: "auth.login_failed",
|
|
163
|
+
body: nil,
|
|
164
|
+
timestamp: "2026-01-09T12:08:09.123Z",
|
|
165
|
+
severity: .info,
|
|
166
|
+
attributes: nil,
|
|
167
|
+
droppedAttributesCount: 0,
|
|
168
|
+
sessionId: testSessionId
|
|
169
|
+
)
|
|
170
|
+
let otLog = log.toOTLogRecord()
|
|
171
|
+
|
|
172
|
+
#expect(otLog.timeUnixNano == 1_767_960_489_123_000_000)
|
|
173
|
+
#expect(otLog.observedTimeUnixNano == 1_767_960_489_123_000_000)
|
|
174
|
+
}
|
|
175
|
+
|
|
151
176
|
// MARK: - Event metadata
|
|
152
177
|
|
|
153
178
|
@Test
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bbae40f5d63e1143d2a9f53546626c9b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
946822c31f9a36b0218231ead941854898ef9d69
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b5fcd74bf0510aeaf922700f88527163d0008eace59aa50300943b9546048fdb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7855a6e1140004f0ac22fe076ee070c4088cb57907eaaf44021bfc8b3dd5f66cbd5e19ed408cab3f49ee5c064ce3474c0bd67de2db9e027944d6047e30371a73
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
154acd3c6b6a61610484d27b531f1e8a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f077450dd411aadb15111718ac826c414866df7e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
65469901391b8a198f386f55e272782db1fefc7489c3cd0d1b828c537bf8afc2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3e5beb30e08550e839923f61373d720adcf8f6213f6cfe84e04465e9276eb20cd40a093c55132df402d3bd2ab1e59e6f4c03d0dc5e1db53e28a1418653e16468
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.observe",
|
|
5
5
|
"module": "expo.modules.observe",
|
|
6
|
-
"version": "57.0.
|
|
6
|
+
"version": "57.0.10",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.observe-57.0.
|
|
28
|
-
"url": "expo.modules.observe-57.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.observe-57.0.10.aar",
|
|
28
|
+
"url": "expo.modules.observe-57.0.10.aar",
|
|
29
|
+
"size": 275831,
|
|
30
|
+
"sha512": "3e5beb30e08550e839923f61373d720adcf8f6213f6cfe84e04465e9276eb20cd40a093c55132df402d3bd2ab1e59e6f4c03d0dc5e1db53e28a1418653e16468",
|
|
31
|
+
"sha256": "65469901391b8a198f386f55e272782db1fefc7489c3cd0d1b828c537bf8afc2",
|
|
32
|
+
"sha1": "f077450dd411aadb15111718ac826c414866df7e",
|
|
33
|
+
"md5": "154acd3c6b6a61610484d27b531f1e8a"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"group": "expo.modules.appmetrics",
|
|
62
62
|
"module": "expo.modules.appmetrics",
|
|
63
63
|
"version": {
|
|
64
|
-
"requires": "57.0.
|
|
64
|
+
"requires": "57.0.8"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
{
|
|
@@ -134,13 +134,13 @@
|
|
|
134
134
|
],
|
|
135
135
|
"files": [
|
|
136
136
|
{
|
|
137
|
-
"name": "expo.modules.observe-57.0.
|
|
138
|
-
"url": "expo.modules.observe-57.0.
|
|
139
|
-
"size":
|
|
140
|
-
"sha512": "
|
|
141
|
-
"sha256": "
|
|
142
|
-
"sha1": "
|
|
143
|
-
"md5": "
|
|
137
|
+
"name": "expo.modules.observe-57.0.10.aar",
|
|
138
|
+
"url": "expo.modules.observe-57.0.10.aar",
|
|
139
|
+
"size": 275831,
|
|
140
|
+
"sha512": "3e5beb30e08550e839923f61373d720adcf8f6213f6cfe84e04465e9276eb20cd40a093c55132df402d3bd2ab1e59e6f4c03d0dc5e1db53e28a1418653e16468",
|
|
141
|
+
"sha256": "65469901391b8a198f386f55e272782db1fefc7489c3cd0d1b828c537bf8afc2",
|
|
142
|
+
"sha1": "f077450dd411aadb15111718ac826c414866df7e",
|
|
143
|
+
"md5": "154acd3c6b6a61610484d27b531f1e8a"
|
|
144
144
|
}
|
|
145
145
|
]
|
|
146
146
|
},
|
|
@@ -154,13 +154,13 @@
|
|
|
154
154
|
},
|
|
155
155
|
"files": [
|
|
156
156
|
{
|
|
157
|
-
"name": "expo.modules.observe-57.0.
|
|
158
|
-
"url": "expo.modules.observe-57.0.
|
|
159
|
-
"size":
|
|
160
|
-
"sha512": "
|
|
161
|
-
"sha256": "
|
|
162
|
-
"sha1": "
|
|
163
|
-
"md5": "
|
|
157
|
+
"name": "expo.modules.observe-57.0.10-sources.jar",
|
|
158
|
+
"url": "expo.modules.observe-57.0.10-sources.jar",
|
|
159
|
+
"size": 25679,
|
|
160
|
+
"sha512": "7855a6e1140004f0ac22fe076ee070c4088cb57907eaaf44021bfc8b3dd5f66cbd5e19ed408cab3f49ee5c064ce3474c0bd67de2db9e027944d6047e30371a73",
|
|
161
|
+
"sha256": "b5fcd74bf0510aeaf922700f88527163d0008eace59aa50300943b9546048fdb",
|
|
162
|
+
"sha1": "946822c31f9a36b0218231ead941854898ef9d69",
|
|
163
|
+
"md5": "bbae40f5d63e1143d2a9f53546626c9b"
|
|
164
164
|
}
|
|
165
165
|
]
|
|
166
166
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b057e9ecd96b0189279460eb666492cf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
16bcbd23a0de5a249c4252f5f774b95195f6b788
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a35ee75d8e2a537a38c9ec4ca7a212106b1b8b6cdd800d4cecd335968170ce49
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2e37c246891578fd432e31c74dfb0c5554042d9521de7982e4cc519c6dba2b8cd54d1e2c43a9c4ff8387faab6c46e7d5a7fb6148f4a4f5ceffa87e6e5b54b892
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.observe</groupId>
|
|
11
11
|
<artifactId>expo.modules.observe</artifactId>
|
|
12
|
-
<version>57.0.
|
|
12
|
+
<version>57.0.10</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.observe</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<dependency>
|
|
53
53
|
<groupId>expo.modules.appmetrics</groupId>
|
|
54
54
|
<artifactId>expo.modules.appmetrics</artifactId>
|
|
55
|
-
<version>57.0.
|
|
55
|
+
<version>57.0.8</version>
|
|
56
56
|
<scope>runtime</scope>
|
|
57
57
|
</dependency>
|
|
58
58
|
<dependency>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
981b67b62c31dbb43849b6d98c346478
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5a25369d9d73660bfa44caf5f9d3f374263a7373
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
92353f84909ce88820e3f79a9de6212e76b44a0d868b833e4ed5227ea23f9a46
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
475d468ca12f4827dc945aa11d2cdec8c318bc19156031a36009cd70ad2e6fa970f917a5adb21fe2f02cd990929e69a4367445f2b23ad3497c65b6a399ce6395
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.observe</groupId>
|
|
4
4
|
<artifactId>expo.modules.observe</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>57.0.
|
|
7
|
-
<release>57.0.
|
|
6
|
+
<latest>57.0.10</latest>
|
|
7
|
+
<release>57.0.10</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>57.0.
|
|
9
|
+
<version>57.0.10</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260804071906</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4b435d857aba3f453f5686376cb8a4ad
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
162275d431c7e14fcda4806cfd81573e41998edf
|
package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d87f22a1c91c33f301b4e4ecd28f4ff4acc2b2a3da147086d66a9f4a5e61ed23
|
package/local-maven-repo/expo/modules/observe/expo.modules.observe/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
43c58cd5461183f41b29cb99597f6266bc2e01c4a8db815f6d92f7c3ecbd5f962c115ca511afa8b9d91aba91d124b71dd6b6fbce8c4db08d36f6de90c8e88831
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-observe",
|
|
3
3
|
"title": "Expo Observe",
|
|
4
|
-
"version": "57.0.
|
|
4
|
+
"version": "57.0.10",
|
|
5
5
|
"description": "Expo module that dispatches collected app metrics to EAS Observe",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"types": "build/index.d.ts",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"author": "650 Industries, Inc.",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"expo-app-metrics": "~57.0.
|
|
38
|
+
"expo-app-metrics": "~57.0.8",
|
|
39
39
|
"expo-eas-client": "~57.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@react-navigation/native": "^7.1.33",
|
|
43
43
|
"@testing-library/react-native": "^13.3.0",
|
|
44
44
|
"@types/react": "~19.2.0",
|
|
45
|
-
"expo": "57.0.
|
|
45
|
+
"expo": "57.0.10",
|
|
46
46
|
"expo-module-scripts": "56.0.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"optional": true
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "fb5049481ebd5cadd499c4d1f1d5e47f9ac678be",
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "expo-module build",
|
|
66
66
|
"clean": "expo-module clean",
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import Observe from './module';
|
|
2
2
|
|
|
3
3
|
export { default as AppMetrics } from 'expo-app-metrics';
|
|
4
|
+
export { ObserveErrorBoundary } from './ObserveErrorBoundary';
|
|
5
|
+
export type {
|
|
6
|
+
ObserveErrorBoundaryProps,
|
|
7
|
+
ObserveErrorBoundaryFallbackProps,
|
|
8
|
+
} from './ObserveErrorBoundary';
|
|
4
9
|
export { ObserveInteractiveMarker } from './ObserveInteractiveMarker';
|
|
5
10
|
export type { ObserveInteractiveMarkerProps } from './ObserveInteractiveMarker';
|
|
6
11
|
export { ObserveRoot } from './ObserveRoot';
|
|
@@ -16,7 +16,7 @@ export interface RouterIntegrationStorage {
|
|
|
16
16
|
pendingActions: PendingAction[];
|
|
17
17
|
renderedScreensIds: Set<string>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Whether the app had already recorded the first render of the screen
|
|
20
20
|
*/
|
|
21
21
|
hasRecordedInitialTtr: boolean;
|
|
22
22
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import AppMetrics, { type MetricAttributes } from 'expo-app-metrics';
|
|
2
2
|
import { use, useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
|
+
import { useAssertValueDoesNotChange } from '../../useAssertValueDoesNotChange';
|
|
4
5
|
import { getNavigationMetricParams } from '../navigationConfig';
|
|
5
6
|
import { ObserveRouterIntegrationContext } from './ObserveRouterIntegrationProvider';
|
|
6
7
|
import { emitTTI } from './emitTTI';
|
|
7
8
|
import { getRouterIntegrationConfig, isInitialized } from './init';
|
|
8
9
|
import { buildRoutePattern } from './routeName';
|
|
9
10
|
import { optionalRouter } from './router';
|
|
10
|
-
import { useAssertValueDoesNotChange } from '../../useAssertValueDoesNotChange';
|
|
11
11
|
|
|
12
12
|
type MarkInteractive = (typeof AppMetrics)['markInteractive'];
|
|
13
13
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import AppMetrics, { type MetricAttributes } from 'expo-app-metrics';
|
|
2
2
|
import { use, useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
|
+
import { useAssertValueDoesNotChange } from '../../useAssertValueDoesNotChange';
|
|
4
5
|
import { getNavigationRouteParams } from '../navigationConfig';
|
|
5
6
|
import { ObserveReactNavigationIntegrationContext } from './context';
|
|
6
7
|
import { emitTTI } from './emitTTI';
|
|
@@ -8,7 +9,6 @@ import { getPathname } from './getPathname';
|
|
|
8
9
|
import { getReactNavigationIntegrationConfig, isInitialized } from './init';
|
|
9
10
|
import { optionalReactNavigation } from './reactNavigation';
|
|
10
11
|
import type { NavigationStateLike } from './types';
|
|
11
|
-
import { useAssertValueDoesNotChange } from '../../useAssertValueDoesNotChange';
|
|
12
12
|
|
|
13
13
|
type MarkInteractive = (typeof AppMetrics)['markInteractive'];
|
|
14
14
|
|
package/src/module.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { initRouterIntegration } from './integrations/expo-router/init';
|
|
|
5
5
|
import { isRouterInstalled } from './integrations/expo-router/router';
|
|
6
6
|
import { initReactNavigationIntegration } from './integrations/react-navigation/init';
|
|
7
7
|
import { isReactNavigationInstalled } from './integrations/react-navigation/reactNavigation';
|
|
8
|
-
import
|
|
8
|
+
import { reportCaughtError } from './reportCaughtError';
|
|
9
|
+
import type { ObserveConfig, ObserveIntegrationsConfig, ObserveModule } from './types';
|
|
9
10
|
|
|
10
11
|
const native = requireNativeModule<ObserveModule>('ExpoObserve');
|
|
11
12
|
|
|
@@ -47,6 +48,17 @@ const Observe: ObserveModule = new Proxy(native, {
|
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
if (prop === 'reportError') {
|
|
52
|
+
return (error: unknown) => reportCaughtError(error);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (prop === 'registerIntegration') {
|
|
56
|
+
return <K extends keyof ObserveIntegrationsConfig>(
|
|
57
|
+
name: K,
|
|
58
|
+
callback: (config: ObserveIntegrationsConfig[K]) => void
|
|
59
|
+
) => registerIntegrationImpl(target, name, callback);
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
// On Android, the native module is a JSI host object, so `prop in target` (and `hasOwnProperty`) report
|
|
51
63
|
// `true` for names it doesn't implement — a host object has no `has` hook. `Object.keys(target)`
|
|
52
64
|
// goes through `getPropertyNames`, which lists the module's actual members, so use it to forward
|
|
@@ -58,4 +70,25 @@ const Observe: ObserveModule = new Proxy(native, {
|
|
|
58
70
|
},
|
|
59
71
|
});
|
|
60
72
|
|
|
73
|
+
export function registerIntegrationImpl<K extends keyof ObserveIntegrationsConfig>(
|
|
74
|
+
target: Pick<ObserveModule, 'addListener' | 'getIntegrations'>,
|
|
75
|
+
name: K,
|
|
76
|
+
callback: (config: ObserveIntegrationsConfig[K]) => void
|
|
77
|
+
): void {
|
|
78
|
+
const integrations = target.getIntegrations();
|
|
79
|
+
if (integrations) {
|
|
80
|
+
if (integrations[name]) {
|
|
81
|
+
callback(integrations[name]);
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const subscription = target.addListener('configure', ({ integrations }) => {
|
|
87
|
+
subscription.remove();
|
|
88
|
+
if (integrations?.[name]) {
|
|
89
|
+
callback(integrations[name]);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
61
94
|
export default Observe;
|
package/src/module.web.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NativeModule, registerWebModule } from 'expo';
|
|
2
2
|
import AppMetrics, { type LogEventOptions, type MetricAttributes } from 'expo-app-metrics';
|
|
3
3
|
|
|
4
|
+
import { reportCaughtError } from './reportCaughtError';
|
|
4
5
|
import type {
|
|
5
6
|
ObserveConfig,
|
|
6
7
|
ObserveIntegrationsConfig,
|
|
@@ -15,9 +16,18 @@ class ExpoObserveModule extends NativeModule<ObserveModuleEvents> implements Obs
|
|
|
15
16
|
getIntegrations(): ObserveIntegrationsConfig {
|
|
16
17
|
return {};
|
|
17
18
|
}
|
|
19
|
+
registerIntegration<K extends keyof ObserveIntegrationsConfig>(
|
|
20
|
+
name: K,
|
|
21
|
+
callback: (config: ObserveIntegrationsConfig[K]) => void
|
|
22
|
+
): void {
|
|
23
|
+
// Web does not provide integration configuration or emit `configure` events.
|
|
24
|
+
}
|
|
18
25
|
logEvent(name: string, options?: LogEventOptions): void {
|
|
19
26
|
AppMetrics.logEvent(name, options);
|
|
20
27
|
}
|
|
28
|
+
reportError(error: unknown): void {
|
|
29
|
+
reportCaughtError(error);
|
|
30
|
+
}
|
|
21
31
|
markFirstRender(): void {
|
|
22
32
|
AppMetrics.markFirstRender();
|
|
23
33
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import AppMetrics from 'expo-app-metrics';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The `reportError` payload shape sent to the native AppMetrics module. The native record types
|
|
5
|
+
* `type`/`stacktrace` as optional strings and `message` as a required string, so a non-string value
|
|
6
|
+
* would fail the record decode and drop the report. Every field is normalized to a string here.
|
|
7
|
+
*/
|
|
8
|
+
type NormalizedReportedError = {
|
|
9
|
+
type?: string;
|
|
10
|
+
message: string;
|
|
11
|
+
stacktrace?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** Returns `value` when it's a string, otherwise `undefined`, so non-string fields never reach native. */
|
|
15
|
+
function stringOrUndefined(value: unknown): string | undefined {
|
|
16
|
+
return typeof value === 'string' ? value : undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Normalizes an arbitrary caught value into the fields the native `reportError` expects, the way the
|
|
21
|
+
* global `ErrorUtils` handler does.
|
|
22
|
+
*/
|
|
23
|
+
function normalizeReportedError(error: unknown): NormalizedReportedError {
|
|
24
|
+
// Only a real `Error` contributes name/message/stack, and each only when it's actually a string;
|
|
25
|
+
// an `Error` with non-string fields would otherwise reach the native string fields (e.g. a mutated
|
|
26
|
+
// `message`) and fail the record decode.
|
|
27
|
+
if (error instanceof Error) {
|
|
28
|
+
return {
|
|
29
|
+
type: stringOrUndefined(error.name),
|
|
30
|
+
message: stringOrUndefined(error.message) ?? String(error),
|
|
31
|
+
stacktrace: stringOrUndefined(error.stack),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// Any non-Error throw (a string, a plain object, a number) becomes its stringification, no stack.
|
|
35
|
+
return { message: String(error) };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Reports a caught value as a non-fatal `reportedByUser`-source error through the AppMetrics module,
|
|
40
|
+
* shared by the native and web `Observe.reportError` implementations.
|
|
41
|
+
*
|
|
42
|
+
* Never throws: it's called from a `catch` block, so a failure here (a pathological thrown value, or
|
|
43
|
+
* a native call that rejects the payload) must not turn a handled error into an unhandled one.
|
|
44
|
+
*/
|
|
45
|
+
export function reportCaughtError(error: unknown): void {
|
|
46
|
+
try {
|
|
47
|
+
AppMetrics.reportError({
|
|
48
|
+
source: 'reportedByUser',
|
|
49
|
+
...normalizeReportedError(error),
|
|
50
|
+
isFatal: false,
|
|
51
|
+
});
|
|
52
|
+
} catch (reportingError) {
|
|
53
|
+
if (__DEV__) {
|
|
54
|
+
console.warn('[expo-observe] `reportError` failed to record the error:', reportingError);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -126,6 +126,23 @@ export declare class ObserveModule extends NativeModule<ObserveModuleEvents> {
|
|
|
126
126
|
* call, or an empty object if `configure` has not run yet.
|
|
127
127
|
*/
|
|
128
128
|
getIntegrations(): ObserveIntegrationsConfig;
|
|
129
|
+
/**
|
|
130
|
+
* Invokes a callback once when the named integration configuration becomes available.
|
|
131
|
+
*
|
|
132
|
+
* @param name Integration name.
|
|
133
|
+
* @param callback Function called with the integration configuration.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* Observe.registerIntegration('expo-router', config => {
|
|
138
|
+
* console.log(config);
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
registerIntegration<K extends keyof ObserveIntegrationsConfig>(
|
|
143
|
+
name: K,
|
|
144
|
+
callback: (config: ObserveIntegrationsConfig[K]) => void
|
|
145
|
+
): void;
|
|
129
146
|
/**
|
|
130
147
|
* Records a log event against the current main session. The event is
|
|
131
148
|
* persisted locally and dispatched on the next `dispatchEvents()` flush.
|
|
@@ -136,6 +153,27 @@ export declare class ObserveModule extends NativeModule<ObserveModuleEvents> {
|
|
|
136
153
|
* @param options Optional body, attributes, and severity overrides.
|
|
137
154
|
*/
|
|
138
155
|
logEvent(name: string, options?: LogEventOptions): void;
|
|
156
|
+
/**
|
|
157
|
+
* Reports an error your code caught and handled, recorded as a non-fatal `exception` event. Use it
|
|
158
|
+
* to keep visibility into failures you recover from, which never reach the automatic global handler
|
|
159
|
+
* or an error boundary.
|
|
160
|
+
*
|
|
161
|
+
* The thrown value is normalized: an `Error`'s `name`, `message`, and `stack` are captured; any
|
|
162
|
+
* other value (a string, a plain object) is stringified as the message.
|
|
163
|
+
*
|
|
164
|
+
* @param error The caught value. An `Error` is preferred, but any thrown value is accepted.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* try {
|
|
169
|
+
* await syncCart();
|
|
170
|
+
* } catch (error) {
|
|
171
|
+
* Observe.reportError(error);
|
|
172
|
+
* }
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
// eslint-disable-next-line handle-callback-err -- `error` is the caught value to report, not a Node callback error.
|
|
176
|
+
reportError(error: unknown): void;
|
|
139
177
|
/**
|
|
140
178
|
* Marks the first render of the app. Used to compute the `cold_ttr` and
|
|
141
179
|
* `warm_ttr` metrics.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c1bce9b3e125ffacd471f7aa5cfaaa74
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
90a35ac786aa7cd93fa6ebfc959c5c9602888a7b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
424e6bdbc0186ae58b9363934bebd490ba9a94f5ff31a932a10e81dd16e30986
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
56376d3be3f15954dfb4f0c35e01be556beca3723348fed7bf0adb57af61b8d5919ac7f6cfd6d6814efe5f99ae8bbcd45f2e83a34bd4d25941e9a9496d9449f0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1fe9628babcfb5166c1bf79bcecafbe9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1bf0478b50bb4eb4397e7e4e62a45dcf44ec3071
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
708834f7a493060538fe012ffe57b24cd28c192c06450e241587c429806bcf44
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7a6902e9d954f361187b1fabd32b9e87f55d5fdf1a5b4bc5786a5f83545788f6f5905c94255b966e49236d296fb6f838d18a38f5a399a0b630e9604d80d7b8e3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
20794b910e48f6172172672fe899306e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
da70e11c9df6ea33d6ca930c4e8c1a8b712c0351
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
654a84a63b12eca9a3a921f64eeaa806b9d42676b690236c60300809df7541d8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ac5ad4223c45c5c21f8fecba00c492c1881ed5bfbcbbb4ec72ae377c34ff12f542f6894790af058847782f2aa64c0c8c3625f37ecad2682182916e79145d72e9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bf87a042c159ee8f6ad63910360021bd
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f927ac3c5c171826e55432446f5f6a67bc59e65d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
03e79952adbb9a549f184b48f3304d239fdb4ad22c1b957c02e30f3bfd5bd669
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
69304ce50078d9bccf3b1e7095c38f2cfc27d63ef8eee467c68950847d95e143e9b3c8df3e9993e9eaa7cd69802e13c8191b553f2e397ed27243da611b4251f1
|