@grafana/faro-react 2.8.2 → 2.10.0
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/dist/bundle/faro-react.iife.js +11 -8
- package/dist/bundle/faro-react.iife.js.map +1 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/defineProperty.js +13 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/objectSpread2.js +26 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/toPrimitive.js +15 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/toPropertyKey.js +10 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/typeof.js +17 -0
- package/dist/cjs/_virtual/_rolldown/runtime.js +24 -0
- package/dist/cjs/dependencies.js +20 -4
- package/dist/cjs/dependencies.js.map +1 -1
- package/dist/cjs/errorBoundary/FaroErrorBoundary.js +62 -67
- package/dist/cjs/errorBoundary/FaroErrorBoundary.js.map +1 -1
- package/dist/cjs/errorBoundary/const.js +7 -4
- package/dist/cjs/errorBoundary/const.js.map +1 -1
- package/dist/cjs/errorBoundary/index.js +6 -8
- package/dist/cjs/errorBoundary/types.js +0 -1
- package/dist/cjs/errorBoundary/withFaroErrorBoundary.js +17 -15
- package/dist/cjs/errorBoundary/withFaroErrorBoundary.js.map +1 -1
- package/dist/cjs/index.js +480 -108
- package/dist/cjs/instrumentation.js +19 -16
- package/dist/cjs/instrumentation.js.map +1 -1
- package/dist/cjs/profiler/FaroProfiler.js +75 -97
- package/dist/cjs/profiler/FaroProfiler.js.map +1 -1
- package/dist/cjs/profiler/index.js +4 -6
- package/dist/cjs/profiler/withFaroProfiler.js +20 -15
- package/dist/cjs/profiler/withFaroProfiler.js.map +1 -1
- package/dist/cjs/router/index.js +26 -21
- package/dist/cjs/router/initialize.js +30 -26
- package/dist/cjs/router/initialize.js.map +1 -1
- package/dist/cjs/router/types.js +20 -16
- package/dist/cjs/router/types.js.map +1 -1
- package/dist/cjs/router/v4v5/FaroRoute.js +12 -12
- package/dist/cjs/router/v4v5/FaroRoute.js.map +1 -1
- package/dist/cjs/router/v4v5/activeEvent.js +23 -17
- package/dist/cjs/router/v4v5/activeEvent.js.map +1 -1
- package/dist/cjs/router/v4v5/index.js +8 -10
- package/dist/cjs/router/v4v5/initialize.js +36 -34
- package/dist/cjs/router/v4v5/initialize.js.map +1 -1
- package/dist/cjs/router/v4v5/routerDependencies.js +30 -8
- package/dist/cjs/router/v4v5/routerDependencies.js.map +1 -1
- package/dist/cjs/router/v4v5/types.js +0 -1
- package/dist/cjs/router/v6v7/FaroRoutes.js +42 -59
- package/dist/cjs/router/v6v7/FaroRoutes.js.map +1 -1
- package/dist/cjs/router/v6v7/index.js +14 -16
- package/dist/cjs/router/v6v7/initialize.js +34 -32
- package/dist/cjs/router/v6v7/initialize.js.map +1 -1
- package/dist/cjs/router/v6v7/routerDependencies.js +59 -16
- package/dist/cjs/router/v6v7/routerDependencies.js.map +1 -1
- package/dist/cjs/router/v6v7/types.js +0 -1
- package/dist/cjs/router/v6v7/utils.js +27 -32
- package/dist/cjs/router/v6v7/utils.js.map +1 -1
- package/dist/cjs/router/v6v7/withFaroRouterInstrumentation.js +32 -25
- package/dist/cjs/router/v6v7/withFaroRouterInstrumentation.js.map +1 -1
- package/dist/cjs/types.js +0 -1
- package/dist/cjs/utils/index.js +9 -11
- package/dist/cjs/utils/reactVersion.js +24 -18
- package/dist/cjs/utils/reactVersion.js.map +1 -1
- package/dist/esm/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/defineProperty.js +12 -0
- package/dist/esm/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/objectSpread2.js +25 -0
- package/dist/esm/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/esm/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/esm/_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/typeof.js +11 -0
- package/dist/esm/dependencies.js +9 -5
- package/dist/esm/dependencies.js.map +1 -1
- package/dist/esm/errorBoundary/FaroErrorBoundary.js +61 -66
- package/dist/esm/errorBoundary/FaroErrorBoundary.js.map +1 -1
- package/dist/esm/errorBoundary/const.js +7 -3
- package/dist/esm/errorBoundary/const.js.map +1 -1
- package/dist/esm/errorBoundary/index.js +4 -4
- package/dist/esm/errorBoundary/types.js +0 -2
- package/dist/esm/errorBoundary/withFaroErrorBoundary.js +15 -12
- package/dist/esm/errorBoundary/withFaroErrorBoundary.js.map +1 -1
- package/dist/esm/index.js +21 -7
- package/dist/esm/instrumentation.js +20 -15
- package/dist/esm/instrumentation.js.map +1 -1
- package/dist/esm/profiler/FaroProfiler.js +74 -96
- package/dist/esm/profiler/FaroProfiler.js.map +1 -1
- package/dist/esm/profiler/index.js +3 -3
- package/dist/esm/profiler/withFaroProfiler.js +18 -12
- package/dist/esm/profiler/withFaroProfiler.js.map +1 -1
- package/dist/esm/router/index.js +12 -5
- package/dist/esm/router/initialize.js +31 -26
- package/dist/esm/router/initialize.js.map +1 -1
- package/dist/esm/router/types.js +19 -15
- package/dist/esm/router/types.js.map +1 -1
- package/dist/esm/router/v4v5/FaroRoute.js +11 -9
- package/dist/esm/router/v4v5/FaroRoute.js.map +1 -1
- package/dist/esm/router/v4v5/activeEvent.js +18 -16
- package/dist/esm/router/v4v5/activeEvent.js.map +1 -1
- package/dist/esm/router/v4v5/index.js +4 -4
- package/dist/esm/router/v4v5/initialize.js +35 -31
- package/dist/esm/router/v4v5/initialize.js.map +1 -1
- package/dist/esm/router/v4v5/routerDependencies.js +13 -9
- package/dist/esm/router/v4v5/routerDependencies.js.map +1 -1
- package/dist/esm/router/v4v5/types.js +0 -2
- package/dist/esm/router/v6v7/FaroRoutes.js +41 -26
- package/dist/esm/router/v6v7/FaroRoutes.js.map +1 -1
- package/dist/esm/router/v6v7/index.js +5 -5
- package/dist/esm/router/v6v7/initialize.js +33 -29
- package/dist/esm/router/v6v7/initialize.js.map +1 -1
- package/dist/esm/router/v6v7/routerDependencies.js +24 -20
- package/dist/esm/router/v6v7/routerDependencies.js.map +1 -1
- package/dist/esm/router/v6v7/types.js +0 -2
- package/dist/esm/router/v6v7/utils.js +28 -32
- package/dist/esm/router/v6v7/utils.js.map +1 -1
- package/dist/esm/router/v6v7/withFaroRouterInstrumentation.js +33 -25
- package/dist/esm/router/v6v7/withFaroRouterInstrumentation.js.map +1 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/utils/index.js +2 -2
- package/dist/esm/utils/reactVersion.js +20 -17
- package/dist/esm/utils/reactVersion.js.map +1 -1
- package/dist/types/dependencies.d.ts +7 -4
- package/dist/types/errorBoundary/FaroErrorBoundary.d.ts +15 -13
- package/dist/types/errorBoundary/const.d.ts +5 -2
- package/dist/types/errorBoundary/index.d.ts +5 -4
- package/dist/types/errorBoundary/types.d.ts +20 -17
- package/dist/types/errorBoundary/withFaroErrorBoundary.d.ts +6 -3
- package/dist/types/index.d.ts +24 -11
- package/dist/types/instrumentation.d.ts +11 -8
- package/dist/types/profiler/FaroProfiler.d.ts +24 -22
- package/dist/types/profiler/index.d.ts +3 -3
- package/dist/types/profiler/withFaroProfiler.d.ts +6 -3
- package/dist/types/router/index.d.ts +14 -7
- package/dist/types/router/initialize.d.ts +5 -2
- package/dist/types/router/types.d.ts +23 -20
- package/dist/types/router/v4v5/FaroRoute.d.ts +6 -3
- package/dist/types/router/v4v5/activeEvent.d.ts +8 -5
- package/dist/types/router/v4v5/index.d.ts +5 -4
- package/dist/types/router/v4v5/initialize.d.ts +8 -5
- package/dist/types/router/v4v5/routerDependencies.d.ts +10 -7
- package/dist/types/router/v4v5/types.d.ts +16 -13
- package/dist/types/router/v6v7/FaroRoutes.d.ts +6 -3
- package/dist/types/router/v6v7/index.d.ts +6 -5
- package/dist/types/router/v6v7/initialize.d.ts +11 -8
- package/dist/types/router/v6v7/routerDependencies.d.ts +14 -11
- package/dist/types/router/v6v7/types.d.ts +57 -58
- package/dist/types/router/v6v7/utils.d.ts +7 -4
- package/dist/types/router/v6v7/withFaroRouterInstrumentation.d.ts +11 -10
- package/dist/types/types.d.ts +24 -18
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/reactVersion.d.ts +11 -8
- package/package.json +17 -21
- package/dist/bundle/types/dependencies.d.ts +0 -4
- package/dist/bundle/types/errorBoundary/FaroErrorBoundary.d.ts +0 -14
- package/dist/bundle/types/errorBoundary/const.d.ts +0 -2
- package/dist/bundle/types/errorBoundary/index.d.ts +0 -4
- package/dist/bundle/types/errorBoundary/types.d.ts +0 -19
- package/dist/bundle/types/errorBoundary/withFaroErrorBoundary.d.ts +0 -3
- package/dist/bundle/types/index.d.ts +0 -11
- package/dist/bundle/types/instrumentation.d.ts +0 -9
- package/dist/bundle/types/profiler/FaroProfiler.d.ts +0 -24
- package/dist/bundle/types/profiler/FaroProfiler.test.d.ts +0 -1
- package/dist/bundle/types/profiler/index.d.ts +0 -3
- package/dist/bundle/types/profiler/withFaroProfiler.d.ts +0 -3
- package/dist/bundle/types/router/index.d.ts +0 -7
- package/dist/bundle/types/router/initialize.d.ts +0 -2
- package/dist/bundle/types/router/types.d.ts +0 -24
- package/dist/bundle/types/router/v4v5/FaroRoute.d.ts +0 -3
- package/dist/bundle/types/router/v4v5/activeEvent.d.ts +0 -5
- package/dist/bundle/types/router/v4v5/index.d.ts +0 -4
- package/dist/bundle/types/router/v4v5/initialize.d.ts +0 -5
- package/dist/bundle/types/router/v4v5/routerDependencies.d.ts +0 -7
- package/dist/bundle/types/router/v4v5/types.d.ts +0 -16
- package/dist/bundle/types/router/v6v7/FaroRoutes.d.ts +0 -3
- package/dist/bundle/types/router/v6v7/index.d.ts +0 -5
- package/dist/bundle/types/router/v6v7/initialize.d.ts +0 -8
- package/dist/bundle/types/router/v6v7/routerDependencies.d.ts +0 -11
- package/dist/bundle/types/router/v6v7/types.d.ts +0 -69
- package/dist/bundle/types/router/v6v7/utils.d.ts +0 -4
- package/dist/bundle/types/router/v6v7/withFaroRouterInstrumentation.d.ts +0 -17
- package/dist/bundle/types/types.d.ts +0 -24
- package/dist/bundle/types/utils/index.d.ts +0 -1
- package/dist/bundle/types/utils/reactVersion.d.ts +0 -8
- package/dist/cjs/errorBoundary/index.js.map +0 -1
- package/dist/cjs/errorBoundary/types.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/profiler/FaroProfiler.test.js +0 -75
- package/dist/cjs/profiler/FaroProfiler.test.js.map +0 -1
- package/dist/cjs/profiler/index.js.map +0 -1
- package/dist/cjs/router/index.js.map +0 -1
- package/dist/cjs/router/v4v5/index.js.map +0 -1
- package/dist/cjs/router/v4v5/types.js.map +0 -1
- package/dist/cjs/router/v6v7/index.js.map +0 -1
- package/dist/cjs/router/v6v7/types.js.map +0 -1
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/esm/errorBoundary/index.js.map +0 -1
- package/dist/esm/errorBoundary/types.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/profiler/FaroProfiler.test.js +0 -73
- package/dist/esm/profiler/FaroProfiler.test.js.map +0 -1
- package/dist/esm/profiler/index.js.map +0 -1
- package/dist/esm/router/index.js.map +0 -1
- package/dist/esm/router/v4v5/index.js.map +0 -1
- package/dist/esm/router/v4v5/types.js.map +0 -1
- package/dist/esm/router/v6v7/index.js.map +0 -1
- package/dist/esm/router/v6v7/types.js.map +0 -1
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/types/profiler/FaroProfiler.test.d.ts +0 -1
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import type { ReactRouterLocation } from '../types';
|
|
4
|
-
interface IndexRouteObjectV6DataRouter {
|
|
5
|
-
caseSensitive?: boolean;
|
|
6
|
-
children?: undefined;
|
|
7
|
-
element?: React.ReactNode | null;
|
|
8
|
-
index: true;
|
|
9
|
-
path?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface NonIndexRouteObjectV6DataRouter {
|
|
12
|
-
caseSensitive?: boolean;
|
|
13
|
-
children?: RouteObjectV6DataRouter[];
|
|
14
|
-
element?: React.ReactNode | null;
|
|
15
|
-
index?: false;
|
|
16
|
-
path?: string;
|
|
17
|
-
}
|
|
18
|
-
export type RouteObjectV6DataRouter = IndexRouteObjectV6DataRouter | NonIndexRouteObjectV6DataRouter;
|
|
19
|
-
export interface ReactRouterV6BaseRouteObject {
|
|
20
|
-
action?: (...args: any[]) => any;
|
|
21
|
-
caseSensitive?: boolean;
|
|
22
|
-
hasErrorBoundary?: boolean;
|
|
23
|
-
handle?: any;
|
|
24
|
-
id?: string;
|
|
25
|
-
loader?: (...args: any[]) => any;
|
|
26
|
-
path?: string;
|
|
27
|
-
shouldRevalidate?: (...args: any[]) => any;
|
|
28
|
-
}
|
|
29
|
-
export type ReactRouterV6RouteObject = ReactRouterV6BaseRouteObject & ({
|
|
30
|
-
children?: undefined;
|
|
31
|
-
index: true;
|
|
32
|
-
} | {
|
|
33
|
-
children?: ReactRouterV6RouteObject[];
|
|
34
|
-
index?: false;
|
|
35
|
-
});
|
|
36
|
-
export interface ReactRouterV6RoutesProps {
|
|
37
|
-
children?: ReactNode;
|
|
38
|
-
location?: Partial<ReactRouterLocation> | string;
|
|
39
|
-
routesComponent?: ReactRouterV6RoutesShape;
|
|
40
|
-
}
|
|
41
|
-
export type ReactRouterV6Params<Key extends string = string> = {
|
|
42
|
-
readonly [key in Key]: string | undefined;
|
|
43
|
-
};
|
|
44
|
-
export interface ReactRouterV6RouteMatch<ParamKey extends string = string> {
|
|
45
|
-
params: ReactRouterV6Params<ParamKey>;
|
|
46
|
-
pathname: string;
|
|
47
|
-
pathnameBase: string;
|
|
48
|
-
route: ReactRouterV6RouteObject;
|
|
49
|
-
}
|
|
50
|
-
export type ReactRouterV6CreateRoutesFromChildren = (children: ReactNode) => ReactRouterV6RouteObject[] | RouteObjectV6DataRouter[];
|
|
51
|
-
export type ReactRouterV6MatchRoutes = (routes: ReactRouterV6RouteObject[], location: Partial<ReactRouterLocation> | string, basename?: string | undefined) => ReactRouterV6RouteMatch[] | null;
|
|
52
|
-
export type ReactRouterV6RoutesShape = (props: ReactRouterV6RoutesProps) => ReactElement | null;
|
|
53
|
-
export type ReactRouterV6UseLocation = () => ReactRouterLocation;
|
|
54
|
-
export type ReactRouterV6UseNavigationType = () => 'POP' | 'PUSH' | 'REPLACE';
|
|
55
|
-
export interface ReactRouterV6Dependencies {
|
|
56
|
-
createRoutesFromChildren: ReactRouterV6CreateRoutesFromChildren;
|
|
57
|
-
matchRoutes: ReactRouterV6MatchRoutes;
|
|
58
|
-
Routes: ReactRouterV6RoutesShape;
|
|
59
|
-
useLocation: ReactRouterV6UseLocation;
|
|
60
|
-
useNavigationType: ReactRouterV6UseNavigationType;
|
|
61
|
-
}
|
|
62
|
-
export interface ReactRouterV6DataRouterDependencies {
|
|
63
|
-
matchRoutes: ReactRouterV6MatchRoutes;
|
|
64
|
-
}
|
|
65
|
-
export type EventRouteTransitionAttributes = {
|
|
66
|
-
fromRoute?: string;
|
|
67
|
-
fromUrl?: string;
|
|
68
|
-
};
|
|
69
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ReactRouterLocation } from '../types';
|
|
2
|
-
import type { ReactRouterV6RouteObject } from './types';
|
|
3
|
-
export declare function getNumberOfUrlSegments(url: string): number;
|
|
4
|
-
export declare function getRouteFromLocation(routes: ReactRouterV6RouteObject[], location: ReactRouterLocation): string;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NavigationType } from '../types';
|
|
2
|
-
import type { ReactRouterLocation } from '../types';
|
|
3
|
-
import type { RouteObjectV6DataRouter } from './types';
|
|
4
|
-
interface RouterState {
|
|
5
|
-
historyAction: NavigationType | any;
|
|
6
|
-
location: ReactRouterLocation;
|
|
7
|
-
}
|
|
8
|
-
interface Router {
|
|
9
|
-
state: RouterState;
|
|
10
|
-
routes: RouteObjectV6DataRouter[];
|
|
11
|
-
subscribe(fn: (state: RouterState) => void): () => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* To use with React Router 6.4 data APIs.
|
|
15
|
-
*/
|
|
16
|
-
export declare function withFaroRouterInstrumentation<R extends Router = Router>(router: R): R;
|
|
17
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ReactRouterV4V5Dependencies, ReactRouterV6DataRouterDependencies, ReactRouterV6Dependencies, ReactRouterVersion } from './router';
|
|
2
|
-
export interface ReactRouterV4V5Config {
|
|
3
|
-
version: ReactRouterVersion.V4 | ReactRouterVersion.V5;
|
|
4
|
-
dependencies: ReactRouterV4V5Dependencies;
|
|
5
|
-
}
|
|
6
|
-
export interface ReactRouterV6Config {
|
|
7
|
-
version: ReactRouterVersion.V6;
|
|
8
|
-
dependencies: ReactRouterV6Dependencies;
|
|
9
|
-
}
|
|
10
|
-
export interface ReactRouterV6DataRouterConfig {
|
|
11
|
-
version: ReactRouterVersion.V6_data_router;
|
|
12
|
-
dependencies: ReactRouterV6DataRouterDependencies;
|
|
13
|
-
}
|
|
14
|
-
export interface ReactRouterV7Config {
|
|
15
|
-
version: ReactRouterVersion.V7;
|
|
16
|
-
dependencies: ReactRouterV6Dependencies;
|
|
17
|
-
}
|
|
18
|
-
export interface ReactRouterV7DataRouterConfig {
|
|
19
|
-
version: ReactRouterVersion.V7_data_router;
|
|
20
|
-
dependencies: ReactRouterV6DataRouterDependencies;
|
|
21
|
-
}
|
|
22
|
-
export interface ReactIntegrationConfig {
|
|
23
|
-
router?: ReactRouterV4V5Config | ReactRouterV6Config | ReactRouterV6DataRouterConfig | ReactRouterV7Config | ReactRouterV7DataRouterConfig;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getMajorReactVersion, isReactVersionAtLeast, isReactVersionAtLeast16, isReactVersionAtLeast17, isReactVersionAtLeast18, isReactVersionAtLeast19, reactVersion, reactVersionMajor, } from './reactVersion';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const reactVersion: string;
|
|
2
|
-
export declare const reactVersionMajor: number | null;
|
|
3
|
-
export declare const isReactVersionAtLeast19: boolean;
|
|
4
|
-
export declare const isReactVersionAtLeast18: boolean;
|
|
5
|
-
export declare const isReactVersionAtLeast17: boolean;
|
|
6
|
-
export declare const isReactVersionAtLeast16: boolean;
|
|
7
|
-
export declare function getMajorReactVersion(): number | null;
|
|
8
|
-
export declare function isReactVersionAtLeast(version: number): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errorBoundary/index.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AAA/C,sHAAA,6BAA6B,OAAA;AAEtC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAU1B,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA","sourcesContent":["export { faroErrorBoundaryInitialState } from './const';\n\nexport { FaroErrorBoundary } from './FaroErrorBoundary';\n\nexport type {\n FaroErrorBoundaryFallbackRender,\n FaroErrorBoundaryProps,\n FaroErrorBoundaryState,\n ReactNodeRender,\n ReactProps,\n} from './types';\n\nexport { withFaroErrorBoundary } from './withFaroErrorBoundary';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errorBoundary/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\n\nimport type { PushErrorOptions } from '@grafana/faro-web-sdk';\n\nexport type ReactNodeRender = () => ReactNode;\n\nexport type ReactProps = Record<string, any>;\n\nexport type FaroErrorBoundaryFallbackRender = (error: Error, resetError: VoidFunction) => ReactElement;\n\nexport interface FaroErrorBoundaryProps {\n beforeCapture?: (error: Error | null) => void;\n children?: ReactNode | ReactNodeRender;\n fallback?: ReactElement | FaroErrorBoundaryFallbackRender;\n onError?: (error: Error) => void;\n onMount?: VoidFunction;\n onReset?: (error: Error | null) => void;\n onUnmount?: (error: Error | null) => void;\n pushErrorOptions?: PushErrorOptions;\n}\n\nexport interface FaroErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n"]}
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iDAA0G;AAAjG,kHAAA,iBAAiB,OAAA;AAAE,8HAAA,6BAA6B,OAAA;AAAE,sHAAA,qBAAqB,OAAA;AAShF,qDAAqD;AAA5C,mHAAA,gBAAgB,OAAA;AAEzB,uCAA4D;AAAnD,wGAAA,YAAY,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAGvC,mCAekB;AAdhB,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,wGAAA,cAAc,OAAA;AACd,4GAAA,kBAAkB,OAAA;AAClB,oHAAA,0BAA0B,OAAA;AAC1B,oHAAA,0BAA0B,OAAA;AAC1B,oHAAA,0BAA0B,OAAA;AAC1B,wHAAA,8BAA8B,OAAA;AAC9B,oHAAA,0BAA0B,OAAA;AAC1B,wHAAA,8BAA8B,OAAA;AAC9B,2HAAA,iCAAiC,OAAA;AACjC,yHAAA,+BAA+B,OAAA;AAC/B,yHAAA,+BAA+B,OAAA;AAC/B,uHAAA,6BAA6B,OAAA;AA4B/B,iCASiB;AARf,6GAAA,oBAAoB,OAAA;AACpB,8GAAA,qBAAqB,OAAA;AACrB,gHAAA,uBAAuB,OAAA;AACvB,gHAAA,uBAAuB,OAAA;AACvB,gHAAA,uBAAuB,OAAA;AACvB,gHAAA,uBAAuB,OAAA;AACvB,qGAAA,YAAY,OAAA;AACZ,0GAAA,iBAAiB,OAAA;AAGnB,sDAwE+B;AAvE7B,oGAA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GAAA,QAAQ,OAAA;AACR,wGAAA,QAAQ,OAAA;AACR,2GAAA,WAAW,OAAA;AACX,wGAAA,QAAQ,OAAA;AACR,wGAAA,QAAQ,OAAA;AACR,wGAAA,QAAQ,OAAA;AACR,gHAAA,gBAAgB,OAAA;AAChB,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,wGAAA,QAAQ,OAAA;AACR,2GAAA,WAAW,OAAA;AACX,mHAAA,mBAAmB,OAAA;AACnB,wGAAA,QAAQ,OAAA;AACR,8GAAA,cAAc,OAAA;AACd,oGAAA,IAAI,OAAA;AACJ,+GAAA,eAAe,OAAA;AACf,6HAAA,6BAA6B,OAAA;AAC7B,iHAAA,iBAAiB,OAAA;AACjB,0HAAA,0BAA0B,OAAA;AAC1B,uGAAA,OAAO,OAAA;AACP,mHAAA,mBAAmB,OAAA;AACnB,wHAAA,wBAAwB,OAAA;AACxB,uHAAA,uBAAuB,OAAA","sourcesContent":["export { FaroErrorBoundary, faroErrorBoundaryInitialState, withFaroErrorBoundary } from './errorBoundary';\nexport type {\n FaroErrorBoundaryFallbackRender,\n FaroErrorBoundaryProps,\n FaroErrorBoundaryState,\n ReactNodeRender,\n ReactProps,\n} from './errorBoundary';\n\nexport { ReactIntegration } from './instrumentation';\n\nexport { FaroProfiler, withFaroProfiler } from './profiler';\nexport type { FaroProfilerProps } from './profiler';\n\nexport {\n FaroRoute,\n FaroRoutes,\n NavigationType,\n ReactRouterVersion,\n createReactRouterV4Options,\n createReactRouterV5Options,\n createReactRouterV6Options,\n createReactRouterV6DataOptions,\n createReactRouterV7Options,\n createReactRouterV7DataOptions,\n setReactRouterV4V5SSRDependencies,\n setReactRouterV6SSRDependencies,\n setReactRouterV7SSRDependencies,\n withFaroRouterInstrumentation,\n} from './router';\nexport type {\n ReactRouterHistory,\n ReactRouterLocation,\n ReactRouterV4V5ActiveEvent,\n ReactRouterV4V5Dependencies,\n ReactRouterV4V5RouteShape,\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './router';\n\nexport type {\n ReactIntegrationConfig,\n ReactRouterV4V5Config,\n ReactRouterV6Config,\n ReactRouterV7Config,\n ReactRouterV7DataRouterConfig,\n} from './types';\n\nexport {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\n isReactVersionAtLeast19,\n reactVersion,\n reactVersionMajor,\n} from './utils';\n\nexport {\n faro,\n allLogLevels,\n BaseExtension,\n BaseInstrumentation,\n BaseTransport,\n browserMeta,\n buildStackFrame,\n ConsoleInstrumentation,\n ConsoleTransport,\n createInternalLogger,\n createPromiseBuffer,\n createSession,\n deepEqual,\n defaultExceptionType,\n defaultEventDomain,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n ErrorsInstrumentation,\n FetchTransport,\n genShortID,\n getCurrentTimestamp,\n getDataFromSafariExtensions,\n getInternalFaroFromGlobalObject,\n getStackFramesFromError,\n getTransportBody,\n getWebInstrumentations,\n globalObject,\n initializeFaro,\n internalGlobalObjectKey,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isInternalFaroOnGlobalObject,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n InternalLoggerLevel,\n LogLevel,\n makeCoreConfig,\n noop,\n parseStacktrace,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n ViewInstrumentation,\n WebVitalsInstrumentation,\n userActionDataAttribute,\n} from '@grafana/faro-web-sdk';\n\nexport type {\n Faro,\n API,\n APIEvent,\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BeforeSendHook,\n BrowserConfig,\n Config,\n ConsoleTransportOptions,\n ErrorEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n ExtendedPromiseRejectionEvent,\n Extension,\n FetchTransportOptions,\n FetchTransportRequestOptions,\n GlobalObject,\n Instrumentation,\n Instrumentations,\n InternalLogger,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n Meta,\n MetaAPI,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n OTELApi,\n Patterns,\n PushErrorOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n UnpatchedConsole,\n ExceptionEventExtended,\n UserActionImportance,\n} from '@grafana/faro-web-sdk';\n"]}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const dependencies_1 = require("../dependencies");
|
|
4
|
-
const FaroProfiler_1 = require("./FaroProfiler");
|
|
5
|
-
describe('FaroProfiler', () => {
|
|
6
|
-
let mockSpan;
|
|
7
|
-
let mockChildSpan;
|
|
8
|
-
let startSpanCalls;
|
|
9
|
-
let setSpanMock;
|
|
10
|
-
let activeContextMock;
|
|
11
|
-
let withMock;
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
mockSpan = { end: jest.fn() };
|
|
14
|
-
mockChildSpan = { end: jest.fn() };
|
|
15
|
-
startSpanCalls = [];
|
|
16
|
-
let callIdx = 0;
|
|
17
|
-
const startSpan = jest.fn((name, options) => {
|
|
18
|
-
startSpanCalls.push({ name, options });
|
|
19
|
-
// First call is the mount span (from constructor); subsequent calls are children.
|
|
20
|
-
return callIdx++ === 0 ? mockSpan : mockChildSpan;
|
|
21
|
-
});
|
|
22
|
-
setSpanMock = jest.fn();
|
|
23
|
-
activeContextMock = jest.fn(() => ({}));
|
|
24
|
-
withMock = jest.fn((_ctx, fn) => fn());
|
|
25
|
-
const otelMock = {
|
|
26
|
-
trace: {
|
|
27
|
-
getTracer: () => ({ startSpan }),
|
|
28
|
-
setSpan: setSpanMock,
|
|
29
|
-
},
|
|
30
|
-
context: {
|
|
31
|
-
active: activeContextMock,
|
|
32
|
-
with: withMock,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
const apiMock = {
|
|
36
|
-
isOTELInitialized: () => true,
|
|
37
|
-
getOTEL: () => otelMock,
|
|
38
|
-
};
|
|
39
|
-
const internalLoggerMock = { error: jest.fn(), warn: jest.fn(), info: jest.fn(), debug: jest.fn() };
|
|
40
|
-
(0, dependencies_1.setDependencies)(internalLoggerMock, apiMock);
|
|
41
|
-
});
|
|
42
|
-
it('does not pass Date.now() to span.end on mount (lets OTel stamp via monotonic hrTime)', () => {
|
|
43
|
-
const dateNowSpy = jest.spyOn(Date, 'now');
|
|
44
|
-
const profiler = new FaroProfiler_1.FaroProfiler({ name: 'C', updateProps: {}, children: null });
|
|
45
|
-
profiler.componentDidMount();
|
|
46
|
-
expect(mockSpan.end).toHaveBeenCalledTimes(1);
|
|
47
|
-
// Critical assertion: span.end was called with no wall-clock timestamp argument.
|
|
48
|
-
// OTel's web SDK stamps the end time via its hrTime helper (performance.timeOrigin +
|
|
49
|
-
// performance.now()), which is monotonic. Passing Date.now() here would mix clocks
|
|
50
|
-
// with the mount span's start (auto-stamped by OTel from hrTime).
|
|
51
|
-
expect(mockSpan.end).toHaveBeenCalledWith();
|
|
52
|
-
expect(dateNowSpy).not.toHaveBeenCalled();
|
|
53
|
-
dateNowSpy.mockRestore();
|
|
54
|
-
});
|
|
55
|
-
it('does not pass Date.now() to componentRender child span on unmount', () => {
|
|
56
|
-
const dateNowSpy = jest.spyOn(Date, 'now');
|
|
57
|
-
const profiler = new FaroProfiler_1.FaroProfiler({ name: 'C', updateProps: {}, children: null });
|
|
58
|
-
profiler.componentDidMount();
|
|
59
|
-
dateNowSpy.mockClear();
|
|
60
|
-
profiler.componentWillUnmount();
|
|
61
|
-
// A componentRender child span should have been created.
|
|
62
|
-
const renderCall = startSpanCalls.find((c) => c.name === 'componentRender');
|
|
63
|
-
expect(renderCall).toBeTruthy();
|
|
64
|
-
// Critical: neither startTime nor endTime should be sourced from Date.now() (wall clock).
|
|
65
|
-
expect(dateNowSpy).not.toHaveBeenCalled();
|
|
66
|
-
// Both timestamps should be undefined (let OTel stamp from hrTime) or, if explicitly
|
|
67
|
-
// provided, derived from a monotonic source. The simplest fix uses undefined.
|
|
68
|
-
if (renderCall.options) {
|
|
69
|
-
expect(renderCall.options.startTime).toBeUndefined();
|
|
70
|
-
expect(renderCall.options.endTime).toBeUndefined();
|
|
71
|
-
}
|
|
72
|
-
dateNowSpy.mockRestore();
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=FaroProfiler.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FaroProfiler.test.js","sourceRoot":"","sources":["../../../src/profiler/FaroProfiler.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkD;AAElD,iDAA8C;AAE9C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,QAA4B,CAAC;IACjC,IAAI,aAAiC,CAAC;IACtC,IAAI,cAAqD,CAAC;IAC1D,IAAI,WAAsB,CAAC;IAC3B,IAAI,iBAA4B,CAAC;IACjC,IAAI,QAAmB,CAAC;IAExB,U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,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC;QAC5E,MAAM,CAAC,UAAU,CAAC,CAAC,UAAU,EAAE,CAAC;QAEhC,0FAA0F;QAC1F,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAE1C,qFAAqF;QACrF,8EAA8E;QAC9E,IAAI,UAAW,CAAC,OAAO,EAAE,CAAC;YACxB,MAAM,CAAC,UAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;YACtD,MAAM,CAAC,UAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;QACtD,CAAC;QAED,UAAU,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { setDependencies } from '../dependencies';\n\nimport { FaroProfiler } from './FaroProfiler';\n\ndescribe('FaroProfiler', () => {\n let mockSpan: { end: jest.Mock };\n let mockChildSpan: { end: jest.Mock };\n let startSpanCalls: Array<{ name: string; options: any }>;\n let setSpanMock: jest.Mock;\n let activeContextMock: jest.Mock;\n let withMock: jest.Mock;\n\n beforeEach(() => {\n mockSpan = { end: jest.fn() };\n mockChildSpan = { end: jest.fn() };\n startSpanCalls = [];\n\n let callIdx = 0;\n const startSpan = jest.fn((name: string, options: any) => {\n startSpanCalls.push({ name, options });\n // First call is the mount span (from constructor); subsequent calls are children.\n return callIdx++ === 0 ? mockSpan : mockChildSpan;\n });\n\n setSpanMock = jest.fn();\n activeContextMock = jest.fn(() => ({}) as any);\n withMock = jest.fn((_ctx: any, fn: () => void) => fn());\n\n const otelMock: any = {\n trace: {\n getTracer: () => ({ startSpan }),\n setSpan: setSpanMock,\n },\n context: {\n active: activeContextMock,\n with: withMock,\n },\n };\n\n const apiMock: any = {\n isOTELInitialized: () => true,\n getOTEL: () => otelMock,\n };\n\n const internalLoggerMock: any = { error: jest.fn(), warn: jest.fn(), info: jest.fn(), debug: jest.fn() };\n\n setDependencies(internalLoggerMock, apiMock);\n });\n\n it('does not pass Date.now() to span.end on mount (lets OTel stamp via monotonic hrTime)', () => {\n const dateNowSpy = jest.spyOn(Date, 'now');\n\n const profiler = new FaroProfiler({ name: 'C', updateProps: {}, children: null as any });\n profiler.componentDidMount();\n\n expect(mockSpan.end).toHaveBeenCalledTimes(1);\n // Critical assertion: span.end was called with no wall-clock timestamp argument.\n // OTel's web SDK stamps the end time via its hrTime helper (performance.timeOrigin +\n // performance.now()), which is monotonic. Passing Date.now() here would mix clocks\n // with the mount span's start (auto-stamped by OTel from hrTime).\n expect(mockSpan.end).toHaveBeenCalledWith();\n expect(dateNowSpy).not.toHaveBeenCalled();\n\n dateNowSpy.mockRestore();\n });\n\n it('does not pass Date.now() to componentRender child span on unmount', () => {\n const dateNowSpy = jest.spyOn(Date, 'now');\n\n const profiler = new FaroProfiler({ name: 'C', updateProps: {}, children: null as any });\n profiler.componentDidMount();\n\n dateNowSpy.mockClear();\n profiler.componentWillUnmount();\n\n // A componentRender child span should have been created.\n const renderCall = startSpanCalls.find((c) => c.name === 'componentRender');\n expect(renderCall).toBeTruthy();\n\n // Critical: neither startTime nor endTime should be sourced from Date.now() (wall clock).\n expect(dateNowSpy).not.toHaveBeenCalled();\n\n // Both timestamps should be undefined (let OTel stamp from hrTime) or, if explicitly\n // provided, derived from a monotonic source. The simplest fix uses undefined.\n if (renderCall!.options) {\n expect(renderCall!.options.startTime).toBeUndefined();\n expect(renderCall!.options.endTime).toBeUndefined();\n }\n\n dateNowSpy.mockRestore();\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/profiler/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA","sourcesContent":["export { FaroProfiler } from './FaroProfiler';\nexport type { FaroProfilerProps } from './FaroProfiler';\n\nexport { withFaroProfiler } from './withFaroProfiler';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/router/index.ts"],"names":[],"mappings":";;;AAAA,2CAAoE;AAA3D,kIAAA,oCAAoC,OAAA;AAE7C,iCAA6D;AAApD,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAG3C,+BAKgB;AAJd,iGAAA,SAAS,OAAA;AACT,kHAAA,0BAA0B,OAAA;AAC1B,kHAAA,0BAA0B,OAAA;AAC1B,yHAAA,iCAAiC,OAAA;AAInC,+BASgB;AARd,kGAAA,UAAU,OAAA;AACV,kHAAA,0BAA0B,OAAA;AAC1B,sHAAA,8BAA8B,OAAA;AAC9B,uHAAA,+BAA+B,OAAA;AAC/B,uHAAA,+BAA+B,OAAA;AAC/B,qHAAA,6BAA6B,OAAA;AAC7B,kHAAA,0BAA0B,OAAA;AAC1B,sHAAA,8BAA8B,OAAA","sourcesContent":["export { initializeReactRouterInstrumentation } from './initialize';\n\nexport { NavigationType, ReactRouterVersion } from './types';\nexport type { ReactRouterLocation, ReactRouterHistory } from './types';\n\nexport {\n FaroRoute,\n createReactRouterV4Options,\n createReactRouterV5Options,\n setReactRouterV4V5SSRDependencies,\n} from './v4v5';\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './v4v5';\n\nexport {\n FaroRoutes,\n createReactRouterV6Options,\n createReactRouterV6DataOptions,\n setReactRouterV6SSRDependencies,\n setReactRouterV7SSRDependencies,\n withFaroRouterInstrumentation,\n createReactRouterV7Options,\n createReactRouterV7DataOptions,\n} from './v6v7';\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n ReactRouterV6DataRouterDependencies,\n} from './v6v7';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v4v5/index.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,2CAIsB;AAHpB,wHAAA,0BAA0B,OAAA;AAC1B,wHAAA,0BAA0B,OAAA;AAC1B,sIAAA,wCAAwC,OAAA;AAG1C,2DAAyE;AAAhE,uIAAA,iCAAiC,OAAA","sourcesContent":["export { FaroRoute } from './FaroRoute';\n\nexport {\n createReactRouterV4Options,\n createReactRouterV5Options,\n initializeReactRouterV4V5Instrumentation,\n} from './initialize';\n\nexport { setReactRouterV4V5SSRDependencies } from './routerDependencies';\n\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v4v5/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactRouterHistory } from '../types';\n\nexport type ReactRouterV4V5RouteShape = any;\n\nexport interface ReactRouterV4V5RouteProps extends Record<string, any> {\n computedMatch?: {\n isExact: boolean;\n path: string;\n };\n}\n\nexport interface ReactRouterV4V5Dependencies {\n history: ReactRouterHistory;\n Route: ReactRouterV4V5RouteShape;\n}\n\nexport interface ReactRouterV4V5ActiveEvent extends Record<string, string> {\n route: string;\n url: string;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v6v7/index.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,2CAOsB;AANpB,wHAAA,0BAA0B,OAAA;AAC1B,4HAAA,8BAA8B,OAAA;AAC9B,oIAAA,sCAAsC,OAAA;AACtC,8IAAA,gDAAgD,OAAA;AAChD,4HAAA,8BAA8B,OAAA;AAC9B,wHAAA,0BAA0B,OAAA;AAG5B,2DAAwG;AAA/F,qIAAA,+BAA+B,OAAA;AAAE,qIAAA,+BAA+B,OAAA;AAEzE,iFAAgF;AAAvE,8IAAA,6BAA6B,OAAA","sourcesContent":["export { FaroRoutes } from './FaroRoutes';\n\nexport {\n createReactRouterV6Options,\n createReactRouterV6DataOptions,\n initializeReactRouterV6Instrumentation,\n initializeReactRouterV6DataRouterInstrumentation,\n createReactRouterV7DataOptions,\n createReactRouterV7Options,\n} from './initialize';\n\nexport { setReactRouterV6SSRDependencies, setReactRouterV7SSRDependencies } from './routerDependencies';\n\nexport { withFaroRouterInstrumentation } from './withFaroRouterInstrumentation';\n\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n ReactRouterV6DataRouterDependencies,\n} from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v6v7/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport type React from 'react';\n\nimport type { ReactRouterLocation } from '../types';\n\ninterface IndexRouteObjectV6DataRouter {\n caseSensitive?: boolean;\n children?: undefined;\n element?: React.ReactNode | null;\n index: true;\n path?: string;\n}\n\nexport interface NonIndexRouteObjectV6DataRouter {\n caseSensitive?: boolean;\n children?: RouteObjectV6DataRouter[];\n element?: React.ReactNode | null;\n index?: false;\n path?: string;\n}\n\nexport type RouteObjectV6DataRouter = IndexRouteObjectV6DataRouter | NonIndexRouteObjectV6DataRouter;\n\nexport interface ReactRouterV6BaseRouteObject {\n action?: (...args: any[]) => any;\n caseSensitive?: boolean;\n hasErrorBoundary?: boolean;\n handle?: any;\n id?: string;\n loader?: (...args: any[]) => any;\n path?: string;\n shouldRevalidate?: (...args: any[]) => any;\n}\n\nexport type ReactRouterV6RouteObject = ReactRouterV6BaseRouteObject &\n (\n | {\n children?: undefined;\n index: true;\n }\n | {\n children?: ReactRouterV6RouteObject[];\n index?: false;\n }\n );\n\nexport interface ReactRouterV6RoutesProps {\n children?: ReactNode;\n location?: Partial<ReactRouterLocation> | string;\n routesComponent?: ReactRouterV6RoutesShape;\n}\n\nexport type ReactRouterV6Params<Key extends string = string> = {\n readonly [key in Key]: string | undefined;\n};\n\nexport interface ReactRouterV6RouteMatch<ParamKey extends string = string> {\n params: ReactRouterV6Params<ParamKey>;\n pathname: string;\n pathnameBase: string;\n route: ReactRouterV6RouteObject;\n}\n\nexport type ReactRouterV6CreateRoutesFromChildren = (\n children: ReactNode\n) => ReactRouterV6RouteObject[] | RouteObjectV6DataRouter[];\n\nexport type ReactRouterV6MatchRoutes = (\n routes: ReactRouterV6RouteObject[],\n location: Partial<ReactRouterLocation> | string,\n basename?: string | undefined\n) => ReactRouterV6RouteMatch[] | null;\n\nexport type ReactRouterV6RoutesShape = (props: ReactRouterV6RoutesProps) => ReactElement | null;\n\nexport type ReactRouterV6UseLocation = () => ReactRouterLocation;\n\nexport type ReactRouterV6UseNavigationType = () => 'POP' | 'PUSH' | 'REPLACE';\n\nexport interface ReactRouterV6Dependencies {\n createRoutesFromChildren: ReactRouterV6CreateRoutesFromChildren;\n matchRoutes: ReactRouterV6MatchRoutes;\n Routes: ReactRouterV6RoutesShape;\n useLocation: ReactRouterV6UseLocation;\n useNavigationType: ReactRouterV6UseNavigationType;\n}\n\nexport interface ReactRouterV6DataRouterDependencies {\n matchRoutes: ReactRouterV6MatchRoutes;\n}\n\nexport type EventRouteTransitionAttributes = {\n fromRoute?: string;\n fromUrl?: string;\n};\n"]}
|
package/dist/cjs/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ReactRouterV4V5Dependencies,\n ReactRouterV6DataRouterDependencies,\n ReactRouterV6Dependencies,\n ReactRouterVersion,\n} from './router';\n\nexport interface ReactRouterV4V5Config {\n version: ReactRouterVersion.V4 | ReactRouterVersion.V5;\n dependencies: ReactRouterV4V5Dependencies;\n}\n\nexport interface ReactRouterV6Config {\n version: ReactRouterVersion.V6;\n dependencies: ReactRouterV6Dependencies;\n}\n\nexport interface ReactRouterV6DataRouterConfig {\n version: ReactRouterVersion.V6_data_router;\n dependencies: ReactRouterV6DataRouterDependencies;\n}\n\n// V7 uses the same API as V6\nexport interface ReactRouterV7Config {\n version: ReactRouterVersion.V7;\n dependencies: ReactRouterV6Dependencies;\n}\n\nexport interface ReactRouterV7DataRouterConfig {\n version: ReactRouterVersion.V7_data_router;\n dependencies: ReactRouterV6DataRouterDependencies;\n}\n\nexport interface ReactIntegrationConfig {\n router?:\n | ReactRouterV4V5Config\n | ReactRouterV6Config\n | ReactRouterV6DataRouterConfig\n | ReactRouterV7Config\n | ReactRouterV7DataRouterConfig;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,+CASwB;AARtB,oHAAA,oBAAoB,OAAA;AACpB,qHAAA,qBAAqB,OAAA;AACrB,uHAAA,uBAAuB,OAAA;AACvB,uHAAA,uBAAuB,OAAA;AACvB,uHAAA,uBAAuB,OAAA;AACvB,uHAAA,uBAAuB,OAAA;AACvB,4GAAA,YAAY,OAAA;AACZ,iHAAA,iBAAiB,OAAA","sourcesContent":["export {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\n isReactVersionAtLeast19,\n reactVersion,\n reactVersionMajor,\n} from './reactVersion';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errorBoundary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { faroErrorBoundaryInitialState } from './const';\n\nexport { FaroErrorBoundary } from './FaroErrorBoundary';\n\nexport type {\n FaroErrorBoundaryFallbackRender,\n FaroErrorBoundaryProps,\n FaroErrorBoundaryState,\n ReactNodeRender,\n ReactProps,\n} from './types';\n\nexport { withFaroErrorBoundary } from './withFaroErrorBoundary';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errorBoundary/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\n\nimport type { PushErrorOptions } from '@grafana/faro-web-sdk';\n\nexport type ReactNodeRender = () => ReactNode;\n\nexport type ReactProps = Record<string, any>;\n\nexport type FaroErrorBoundaryFallbackRender = (error: Error, resetError: VoidFunction) => ReactElement;\n\nexport interface FaroErrorBoundaryProps {\n beforeCapture?: (error: Error | null) => void;\n children?: ReactNode | ReactNodeRender;\n fallback?: ReactElement | FaroErrorBoundaryFallbackRender;\n onError?: (error: Error) => void;\n onMount?: VoidFunction;\n onReset?: (error: Error | null) => void;\n onUnmount?: (error: Error | null) => void;\n pushErrorOptions?: PushErrorOptions;\n}\n\nexport interface FaroErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n"]}
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["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AAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,eAAe,EACf,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC","sourcesContent":["export { FaroErrorBoundary, faroErrorBoundaryInitialState, withFaroErrorBoundary } from './errorBoundary';\nexport type {\n FaroErrorBoundaryFallbackRender,\n FaroErrorBoundaryProps,\n FaroErrorBoundaryState,\n ReactNodeRender,\n ReactProps,\n} from './errorBoundary';\n\nexport { ReactIntegration } from './instrumentation';\n\nexport { FaroProfiler, withFaroProfiler } from './profiler';\nexport type { FaroProfilerProps } from './profiler';\n\nexport {\n FaroRoute,\n FaroRoutes,\n NavigationType,\n ReactRouterVersion,\n createReactRouterV4Options,\n createReactRouterV5Options,\n createReactRouterV6Options,\n createReactRouterV6DataOptions,\n createReactRouterV7Options,\n createReactRouterV7DataOptions,\n setReactRouterV4V5SSRDependencies,\n setReactRouterV6SSRDependencies,\n setReactRouterV7SSRDependencies,\n withFaroRouterInstrumentation,\n} from './router';\nexport type {\n ReactRouterHistory,\n ReactRouterLocation,\n ReactRouterV4V5ActiveEvent,\n ReactRouterV4V5Dependencies,\n ReactRouterV4V5RouteShape,\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './router';\n\nexport type {\n ReactIntegrationConfig,\n ReactRouterV4V5Config,\n ReactRouterV6Config,\n ReactRouterV7Config,\n ReactRouterV7DataRouterConfig,\n} from './types';\n\nexport {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\n isReactVersionAtLeast19,\n reactVersion,\n reactVersionMajor,\n} from './utils';\n\nexport {\n faro,\n allLogLevels,\n BaseExtension,\n BaseInstrumentation,\n BaseTransport,\n browserMeta,\n buildStackFrame,\n ConsoleInstrumentation,\n ConsoleTransport,\n createInternalLogger,\n createPromiseBuffer,\n createSession,\n deepEqual,\n defaultExceptionType,\n defaultEventDomain,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n ErrorsInstrumentation,\n FetchTransport,\n genShortID,\n getCurrentTimestamp,\n getDataFromSafariExtensions,\n getInternalFaroFromGlobalObject,\n getStackFramesFromError,\n getTransportBody,\n getWebInstrumentations,\n globalObject,\n initializeFaro,\n internalGlobalObjectKey,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isInternalFaroOnGlobalObject,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n InternalLoggerLevel,\n LogLevel,\n makeCoreConfig,\n noop,\n parseStacktrace,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n ViewInstrumentation,\n WebVitalsInstrumentation,\n userActionDataAttribute,\n} from '@grafana/faro-web-sdk';\n\nexport type {\n Faro,\n API,\n APIEvent,\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BeforeSendHook,\n BrowserConfig,\n Config,\n ConsoleTransportOptions,\n ErrorEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n ExtendedPromiseRejectionEvent,\n Extension,\n FetchTransportOptions,\n FetchTransportRequestOptions,\n GlobalObject,\n Instrumentation,\n Instrumentations,\n InternalLogger,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n Meta,\n MetaAPI,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n OTELApi,\n Patterns,\n PushErrorOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n UnpatchedConsole,\n ExceptionEventExtended,\n UserActionImportance,\n} from '@grafana/faro-web-sdk';\n"]}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { setDependencies } from '../dependencies';
|
|
2
|
-
import { FaroProfiler } from './FaroProfiler';
|
|
3
|
-
describe('FaroProfiler', () => {
|
|
4
|
-
let mockSpan;
|
|
5
|
-
let mockChildSpan;
|
|
6
|
-
let startSpanCalls;
|
|
7
|
-
let setSpanMock;
|
|
8
|
-
let activeContextMock;
|
|
9
|
-
let withMock;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
mockSpan = { end: jest.fn() };
|
|
12
|
-
mockChildSpan = { end: jest.fn() };
|
|
13
|
-
startSpanCalls = [];
|
|
14
|
-
let callIdx = 0;
|
|
15
|
-
const startSpan = jest.fn((name, options) => {
|
|
16
|
-
startSpanCalls.push({ name, options });
|
|
17
|
-
// First call is the mount span (from constructor); subsequent calls are children.
|
|
18
|
-
return callIdx++ === 0 ? mockSpan : mockChildSpan;
|
|
19
|
-
});
|
|
20
|
-
setSpanMock = jest.fn();
|
|
21
|
-
activeContextMock = jest.fn(() => ({}));
|
|
22
|
-
withMock = jest.fn((_ctx, fn) => fn());
|
|
23
|
-
const otelMock = {
|
|
24
|
-
trace: {
|
|
25
|
-
getTracer: () => ({ startSpan }),
|
|
26
|
-
setSpan: setSpanMock,
|
|
27
|
-
},
|
|
28
|
-
context: {
|
|
29
|
-
active: activeContextMock,
|
|
30
|
-
with: withMock,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
const apiMock = {
|
|
34
|
-
isOTELInitialized: () => true,
|
|
35
|
-
getOTEL: () => otelMock,
|
|
36
|
-
};
|
|
37
|
-
const internalLoggerMock = { error: jest.fn(), warn: jest.fn(), info: jest.fn(), debug: jest.fn() };
|
|
38
|
-
setDependencies(internalLoggerMock, apiMock);
|
|
39
|
-
});
|
|
40
|
-
it('does not pass Date.now() to span.end on mount (lets OTel stamp via monotonic hrTime)', () => {
|
|
41
|
-
const dateNowSpy = jest.spyOn(Date, 'now');
|
|
42
|
-
const profiler = new FaroProfiler({ name: 'C', updateProps: {}, children: null });
|
|
43
|
-
profiler.componentDidMount();
|
|
44
|
-
expect(mockSpan.end).toHaveBeenCalledTimes(1);
|
|
45
|
-
// Critical assertion: span.end was called with no wall-clock timestamp argument.
|
|
46
|
-
// OTel's web SDK stamps the end time via its hrTime helper (performance.timeOrigin +
|
|
47
|
-
// performance.now()), which is monotonic. Passing Date.now() here would mix clocks
|
|
48
|
-
// with the mount span's start (auto-stamped by OTel from hrTime).
|
|
49
|
-
expect(mockSpan.end).toHaveBeenCalledWith();
|
|
50
|
-
expect(dateNowSpy).not.toHaveBeenCalled();
|
|
51
|
-
dateNowSpy.mockRestore();
|
|
52
|
-
});
|
|
53
|
-
it('does not pass Date.now() to componentRender child span on unmount', () => {
|
|
54
|
-
const dateNowSpy = jest.spyOn(Date, 'now');
|
|
55
|
-
const profiler = new FaroProfiler({ name: 'C', updateProps: {}, children: null });
|
|
56
|
-
profiler.componentDidMount();
|
|
57
|
-
dateNowSpy.mockClear();
|
|
58
|
-
profiler.componentWillUnmount();
|
|
59
|
-
// A componentRender child span should have been created.
|
|
60
|
-
const renderCall = startSpanCalls.find((c) => c.name === 'componentRender');
|
|
61
|
-
expect(renderCall).toBeTruthy();
|
|
62
|
-
// Critical: neither startTime nor endTime should be sourced from Date.now() (wall clock).
|
|
63
|
-
expect(dateNowSpy).not.toHaveBeenCalled();
|
|
64
|
-
// Both timestamps should be undefined (let OTel stamp from hrTime) or, if explicitly
|
|
65
|
-
// provided, derived from a monotonic source. The simplest fix uses undefined.
|
|
66
|
-
if (renderCall.options) {
|
|
67
|
-
expect(renderCall.options.startTime).toBeUndefined();
|
|
68
|
-
expect(renderCall.options.endTime).toBeUndefined();
|
|
69
|
-
}
|
|
70
|
-
dateNowSpy.mockRestore();
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=FaroProfiler.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FaroProfiler.test.js","sourceRoot":"","sources":["../../../src/profiler/FaroProfiler.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,QAA4B,CAAC;IACjC,IAAI,aAAiC,CAAC;IACtC,IAAI,cAAqD,CAAC;IAC1D,IAAI,WAAsB,CAAC;IAC3B,IAAI,iBAA4B,CAAC;IACjC,IAAI,QAAmB,CAAC;IAExB,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;QAC9B,aAAa,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;QACnC,cAAc,GAAG,EAAE,CAAC;QAEpB,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,IAAY,EAAE,OAAY,E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,EAAE,CAAC;YACxB,MAAM,CAAC,UAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;YACtD,MAAM,CAAC,UAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC;QACtD,CAAC;QAED,UAAU,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { setDependencies } from '../dependencies';\n\nimport { FaroProfiler } from './FaroProfiler';\n\ndescribe('FaroProfiler', () => {\n let mockSpan: { end: jest.Mock };\n let mockChildSpan: { end: jest.Mock };\n let startSpanCalls: Array<{ name: string; options: any }>;\n let setSpanMock: jest.Mock;\n let activeContextMock: jest.Mock;\n let withMock: jest.Mock;\n\n beforeEach(() => {\n mockSpan = { end: jest.fn() };\n mockChildSpan = { end: jest.fn() };\n startSpanCalls = [];\n\n let callIdx = 0;\n const startSpan = jest.fn((name: string, options: any) => {\n startSpanCalls.push({ name, options });\n // First call is the mount span (from constructor); subsequent calls are children.\n return callIdx++ === 0 ? mockSpan : mockChildSpan;\n });\n\n setSpanMock = jest.fn();\n activeContextMock = jest.fn(() => ({}) as any);\n withMock = jest.fn((_ctx: any, fn: () => void) => fn());\n\n const otelMock: any = {\n trace: {\n getTracer: () => ({ startSpan }),\n setSpan: setSpanMock,\n },\n context: {\n active: activeContextMock,\n with: withMock,\n },\n };\n\n const apiMock: any = {\n isOTELInitialized: () => true,\n getOTEL: () => otelMock,\n };\n\n const internalLoggerMock: any = { error: jest.fn(), warn: jest.fn(), info: jest.fn(), debug: jest.fn() };\n\n setDependencies(internalLoggerMock, apiMock);\n });\n\n it('does not pass Date.now() to span.end on mount (lets OTel stamp via monotonic hrTime)', () => {\n const dateNowSpy = jest.spyOn(Date, 'now');\n\n const profiler = new FaroProfiler({ name: 'C', updateProps: {}, children: null as any });\n profiler.componentDidMount();\n\n expect(mockSpan.end).toHaveBeenCalledTimes(1);\n // Critical assertion: span.end was called with no wall-clock timestamp argument.\n // OTel's web SDK stamps the end time via its hrTime helper (performance.timeOrigin +\n // performance.now()), which is monotonic. Passing Date.now() here would mix clocks\n // with the mount span's start (auto-stamped by OTel from hrTime).\n expect(mockSpan.end).toHaveBeenCalledWith();\n expect(dateNowSpy).not.toHaveBeenCalled();\n\n dateNowSpy.mockRestore();\n });\n\n it('does not pass Date.now() to componentRender child span on unmount', () => {\n const dateNowSpy = jest.spyOn(Date, 'now');\n\n const profiler = new FaroProfiler({ name: 'C', updateProps: {}, children: null as any });\n profiler.componentDidMount();\n\n dateNowSpy.mockClear();\n profiler.componentWillUnmount();\n\n // A componentRender child span should have been created.\n const renderCall = startSpanCalls.find((c) => c.name === 'componentRender');\n expect(renderCall).toBeTruthy();\n\n // Critical: neither startTime nor endTime should be sourced from Date.now() (wall clock).\n expect(dateNowSpy).not.toHaveBeenCalled();\n\n // Both timestamps should be undefined (let OTel stamp from hrTime) or, if explicitly\n // provided, derived from a monotonic source. The simplest fix uses undefined.\n if (renderCall!.options) {\n expect(renderCall!.options.startTime).toBeUndefined();\n expect(renderCall!.options.endTime).toBeUndefined();\n }\n\n dateNowSpy.mockRestore();\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/profiler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { FaroProfiler } from './FaroProfiler';\nexport type { FaroProfilerProps } from './FaroProfiler';\n\nexport { withFaroProfiler } from './withFaroProfiler';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,EACL,SAAS,EACT,0BAA0B,EAC1B,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,UAAU,EACV,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,6BAA6B,EAC7B,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,QAAQ,CAAC","sourcesContent":["export { initializeReactRouterInstrumentation } from './initialize';\n\nexport { NavigationType, ReactRouterVersion } from './types';\nexport type { ReactRouterLocation, ReactRouterHistory } from './types';\n\nexport {\n FaroRoute,\n createReactRouterV4Options,\n createReactRouterV5Options,\n setReactRouterV4V5SSRDependencies,\n} from './v4v5';\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './v4v5';\n\nexport {\n FaroRoutes,\n createReactRouterV6Options,\n createReactRouterV6DataOptions,\n setReactRouterV6SSRDependencies,\n setReactRouterV7SSRDependencies,\n withFaroRouterInstrumentation,\n createReactRouterV7Options,\n createReactRouterV7DataOptions,\n} from './v6v7';\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n ReactRouterV6DataRouterDependencies,\n} from './v6v7';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v4v5/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,wCAAwC,GACzC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { FaroRoute } from './FaroRoute';\n\nexport {\n createReactRouterV4Options,\n createReactRouterV5Options,\n initializeReactRouterV4V5Instrumentation,\n} from './initialize';\n\nexport { setReactRouterV4V5SSRDependencies } from './routerDependencies';\n\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v4v5/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactRouterHistory } from '../types';\n\nexport type ReactRouterV4V5RouteShape = any;\n\nexport interface ReactRouterV4V5RouteProps extends Record<string, any> {\n computedMatch?: {\n isExact: boolean;\n path: string;\n };\n}\n\nexport interface ReactRouterV4V5Dependencies {\n history: ReactRouterHistory;\n Route: ReactRouterV4V5RouteShape;\n}\n\nexport interface ReactRouterV4V5ActiveEvent extends Record<string, string> {\n route: string;\n url: string;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v6v7/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,sCAAsC,EACtC,gDAAgD,EAChD,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAExG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["export { FaroRoutes } from './FaroRoutes';\n\nexport {\n createReactRouterV6Options,\n createReactRouterV6DataOptions,\n initializeReactRouterV6Instrumentation,\n initializeReactRouterV6DataRouterInstrumentation,\n createReactRouterV7DataOptions,\n createReactRouterV7Options,\n} from './initialize';\n\nexport { setReactRouterV6SSRDependencies, setReactRouterV7SSRDependencies } from './routerDependencies';\n\nexport { withFaroRouterInstrumentation } from './withFaroRouterInstrumentation';\n\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n ReactRouterV6DataRouterDependencies,\n} from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v6v7/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport type React from 'react';\n\nimport type { ReactRouterLocation } from '../types';\n\ninterface IndexRouteObjectV6DataRouter {\n caseSensitive?: boolean;\n children?: undefined;\n element?: React.ReactNode | null;\n index: true;\n path?: string;\n}\n\nexport interface NonIndexRouteObjectV6DataRouter {\n caseSensitive?: boolean;\n children?: RouteObjectV6DataRouter[];\n element?: React.ReactNode | null;\n index?: false;\n path?: string;\n}\n\nexport type RouteObjectV6DataRouter = IndexRouteObjectV6DataRouter | NonIndexRouteObjectV6DataRouter;\n\nexport interface ReactRouterV6BaseRouteObject {\n action?: (...args: any[]) => any;\n caseSensitive?: boolean;\n hasErrorBoundary?: boolean;\n handle?: any;\n id?: string;\n loader?: (...args: any[]) => any;\n path?: string;\n shouldRevalidate?: (...args: any[]) => any;\n}\n\nexport type ReactRouterV6RouteObject = ReactRouterV6BaseRouteObject &\n (\n | {\n children?: undefined;\n index: true;\n }\n | {\n children?: ReactRouterV6RouteObject[];\n index?: false;\n }\n );\n\nexport interface ReactRouterV6RoutesProps {\n children?: ReactNode;\n location?: Partial<ReactRouterLocation> | string;\n routesComponent?: ReactRouterV6RoutesShape;\n}\n\nexport type ReactRouterV6Params<Key extends string = string> = {\n readonly [key in Key]: string | undefined;\n};\n\nexport interface ReactRouterV6RouteMatch<ParamKey extends string = string> {\n params: ReactRouterV6Params<ParamKey>;\n pathname: string;\n pathnameBase: string;\n route: ReactRouterV6RouteObject;\n}\n\nexport type ReactRouterV6CreateRoutesFromChildren = (\n children: ReactNode\n) => ReactRouterV6RouteObject[] | RouteObjectV6DataRouter[];\n\nexport type ReactRouterV6MatchRoutes = (\n routes: ReactRouterV6RouteObject[],\n location: Partial<ReactRouterLocation> | string,\n basename?: string | undefined\n) => ReactRouterV6RouteMatch[] | null;\n\nexport type ReactRouterV6RoutesShape = (props: ReactRouterV6RoutesProps) => ReactElement | null;\n\nexport type ReactRouterV6UseLocation = () => ReactRouterLocation;\n\nexport type ReactRouterV6UseNavigationType = () => 'POP' | 'PUSH' | 'REPLACE';\n\nexport interface ReactRouterV6Dependencies {\n createRoutesFromChildren: ReactRouterV6CreateRoutesFromChildren;\n matchRoutes: ReactRouterV6MatchRoutes;\n Routes: ReactRouterV6RoutesShape;\n useLocation: ReactRouterV6UseLocation;\n useNavigationType: ReactRouterV6UseNavigationType;\n}\n\nexport interface ReactRouterV6DataRouterDependencies {\n matchRoutes: ReactRouterV6MatchRoutes;\n}\n\nexport type EventRouteTransitionAttributes = {\n fromRoute?: string;\n fromUrl?: string;\n};\n"]}
|
package/dist/esm/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ReactRouterV4V5Dependencies,\n ReactRouterV6DataRouterDependencies,\n ReactRouterV6Dependencies,\n ReactRouterVersion,\n} from './router';\n\nexport interface ReactRouterV4V5Config {\n version: ReactRouterVersion.V4 | ReactRouterVersion.V5;\n dependencies: ReactRouterV4V5Dependencies;\n}\n\nexport interface ReactRouterV6Config {\n version: ReactRouterVersion.V6;\n dependencies: ReactRouterV6Dependencies;\n}\n\nexport interface ReactRouterV6DataRouterConfig {\n version: ReactRouterVersion.V6_data_router;\n dependencies: ReactRouterV6DataRouterDependencies;\n}\n\n// V7 uses the same API as V6\nexport interface ReactRouterV7Config {\n version: ReactRouterVersion.V7;\n dependencies: ReactRouterV6Dependencies;\n}\n\nexport interface ReactRouterV7DataRouterConfig {\n version: ReactRouterVersion.V7_data_router;\n dependencies: ReactRouterV6DataRouterDependencies;\n}\n\nexport interface ReactIntegrationConfig {\n router?:\n | ReactRouterV4V5Config\n | ReactRouterV6Config\n | ReactRouterV6DataRouterConfig\n | ReactRouterV7Config\n | ReactRouterV7DataRouterConfig;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC","sourcesContent":["export {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\n isReactVersionAtLeast19,\n reactVersion,\n reactVersionMajor,\n} from './reactVersion';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|