@grafana/faro-react 1.0.0-beta1
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/LICENSE +201 -0
- package/README.md +112 -0
- package/dist/cjs/errorBoundary/FaroErrorBoundary.d.ts +14 -0
- package/dist/cjs/errorBoundary/FaroErrorBoundary.js +85 -0
- package/dist/cjs/errorBoundary/FaroErrorBoundary.js.map +1 -0
- package/dist/cjs/errorBoundary/const.d.ts +2 -0
- package/dist/cjs/errorBoundary/const.js +8 -0
- package/dist/cjs/errorBoundary/const.js.map +1 -0
- package/dist/cjs/errorBoundary/index.d.ts +4 -0
- package/dist/cjs/errorBoundary/index.js +10 -0
- package/dist/cjs/errorBoundary/index.js.map +1 -0
- package/dist/cjs/errorBoundary/types.d.ts +19 -0
- package/dist/cjs/errorBoundary/types.js +3 -0
- package/dist/cjs/errorBoundary/types.js.map +1 -0
- package/dist/cjs/errorBoundary/withFaroErrorBoundary.d.ts +3 -0
- package/dist/cjs/errorBoundary/withFaroErrorBoundary.js +31 -0
- package/dist/cjs/errorBoundary/withFaroErrorBoundary.js.map +1 -0
- package/dist/cjs/index.d.ts +11 -0
- package/dist/cjs/index.js +101 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/instrumentation.d.ts +9 -0
- package/dist/cjs/instrumentation.js +37 -0
- package/dist/cjs/instrumentation.js.map +1 -0
- package/dist/cjs/profiler/FaroProfiler.d.ts +24 -0
- package/dist/cjs/profiler/FaroProfiler.js +135 -0
- package/dist/cjs/profiler/FaroProfiler.js.map +1 -0
- package/dist/cjs/profiler/index.d.ts +3 -0
- package/dist/cjs/profiler/index.js +8 -0
- package/dist/cjs/profiler/index.js.map +1 -0
- package/dist/cjs/profiler/withFaroProfiler.d.ts +3 -0
- package/dist/cjs/profiler/withFaroProfiler.js +31 -0
- package/dist/cjs/profiler/withFaroProfiler.js.map +1 -0
- package/dist/cjs/router/index.d.ts +7 -0
- package/dist/cjs/router/index.js +15 -0
- package/dist/cjs/router/index.js.map +1 -0
- package/dist/cjs/router/initialize.d.ts +3 -0
- package/dist/cjs/router/initialize.js +24 -0
- package/dist/cjs/router/initialize.js.map +1 -0
- package/dist/cjs/router/types.d.ts +21 -0
- package/dist/cjs/router/types.js +16 -0
- package/dist/cjs/router/types.js.map +1 -0
- package/dist/cjs/router/v4v5/FaroRoute.d.ts +3 -0
- package/dist/cjs/router/v4v5/FaroRoute.js +26 -0
- package/dist/cjs/router/v4v5/FaroRoute.js.map +1 -0
- package/dist/cjs/router/v4v5/activeEvent.d.ts +5 -0
- package/dist/cjs/router/v4v5/activeEvent.js +25 -0
- package/dist/cjs/router/v4v5/activeEvent.js.map +1 -0
- package/dist/cjs/router/v4v5/dependencies.d.ts +9 -0
- package/dist/cjs/router/v4v5/dependencies.js +16 -0
- package/dist/cjs/router/v4v5/dependencies.js.map +1 -0
- package/dist/cjs/router/v4v5/index.d.ts +4 -0
- package/dist/cjs/router/v4v5/index.js +10 -0
- package/dist/cjs/router/v4v5/index.js.map +1 -0
- package/dist/cjs/router/v4v5/initialize.d.ts +3 -0
- package/dist/cjs/router/v4v5/initialize.js +30 -0
- package/dist/cjs/router/v4v5/initialize.js.map +1 -0
- package/dist/cjs/router/v4v5/types.d.ts +16 -0
- package/dist/cjs/router/v4v5/types.js +3 -0
- package/dist/cjs/router/v4v5/types.js.map +1 -0
- package/dist/cjs/router/v6/FaroRoutes.d.ts +3 -0
- package/dist/cjs/router/v6/FaroRoutes.js +39 -0
- package/dist/cjs/router/v6/FaroRoutes.js.map +1 -0
- package/dist/cjs/router/v6/dependencies.d.ts +11 -0
- package/dist/cjs/router/v6/dependencies.js +19 -0
- package/dist/cjs/router/v6/dependencies.js.map +1 -0
- package/dist/cjs/router/v6/index.d.ts +4 -0
- package/dist/cjs/router/v6/index.js +10 -0
- package/dist/cjs/router/v6/index.js.map +1 -0
- package/dist/cjs/router/v6/initialize.d.ts +3 -0
- package/dist/cjs/router/v6/initialize.js +15 -0
- package/dist/cjs/router/v6/initialize.js.map +1 -0
- package/dist/cjs/router/v6/types.d.ts +35 -0
- package/dist/cjs/router/v6/types.js +3 -0
- package/dist/cjs/router/v6/types.js.map +1 -0
- package/dist/cjs/router/v6/utils.d.ts +4 -0
- package/dist/cjs/router/v6/utils.js +40 -0
- package/dist/cjs/router/v6/utils.js.map +1 -0
- package/dist/cjs/types.d.ts +12 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/const.d.ts +1 -0
- package/dist/cjs/utils/const.js +5 -0
- package/dist/cjs/utils/const.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +2 -0
- package/dist/cjs/utils/index.js +14 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/reactVersion.d.ts +7 -0
- package/dist/cjs/utils/reactVersion.js +24 -0
- package/dist/cjs/utils/reactVersion.js.map +1 -0
- package/dist/esm/errorBoundary/FaroErrorBoundary.d.ts +14 -0
- package/dist/esm/errorBoundary/FaroErrorBoundary.js +63 -0
- package/dist/esm/errorBoundary/FaroErrorBoundary.js.map +1 -0
- package/dist/esm/errorBoundary/const.d.ts +2 -0
- package/dist/esm/errorBoundary/const.js +5 -0
- package/dist/esm/errorBoundary/const.js.map +1 -0
- package/dist/esm/errorBoundary/index.d.ts +4 -0
- package/dist/esm/errorBoundary/index.js +4 -0
- package/dist/esm/errorBoundary/index.js.map +1 -0
- package/dist/esm/errorBoundary/types.d.ts +19 -0
- package/dist/esm/errorBoundary/types.js +2 -0
- package/dist/esm/errorBoundary/types.js.map +1 -0
- package/dist/esm/errorBoundary/withFaroErrorBoundary.d.ts +3 -0
- package/dist/esm/errorBoundary/withFaroErrorBoundary.js +13 -0
- package/dist/esm/errorBoundary/withFaroErrorBoundary.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/instrumentation.d.ts +9 -0
- package/dist/esm/instrumentation.js +14 -0
- package/dist/esm/instrumentation.js.map +1 -0
- package/dist/esm/profiler/FaroProfiler.d.ts +24 -0
- package/dist/esm/profiler/FaroProfiler.js +86 -0
- package/dist/esm/profiler/FaroProfiler.js.map +1 -0
- package/dist/esm/profiler/index.d.ts +3 -0
- package/dist/esm/profiler/index.js +3 -0
- package/dist/esm/profiler/index.js.map +1 -0
- package/dist/esm/profiler/withFaroProfiler.d.ts +3 -0
- package/dist/esm/profiler/withFaroProfiler.js +13 -0
- package/dist/esm/profiler/withFaroProfiler.js.map +1 -0
- package/dist/esm/router/index.d.ts +7 -0
- package/dist/esm/router/index.js +5 -0
- package/dist/esm/router/index.js.map +1 -0
- package/dist/esm/router/initialize.d.ts +3 -0
- package/dist/esm/router/initialize.js +20 -0
- package/dist/esm/router/initialize.js.map +1 -0
- package/dist/esm/router/types.d.ts +21 -0
- package/dist/esm/router/types.js +13 -0
- package/dist/esm/router/types.js.map +1 -0
- package/dist/esm/router/v4v5/FaroRoute.d.ts +3 -0
- package/dist/esm/router/v4v5/FaroRoute.js +11 -0
- package/dist/esm/router/v4v5/FaroRoute.js.map +1 -0
- package/dist/esm/router/v4v5/activeEvent.d.ts +5 -0
- package/dist/esm/router/v4v5/activeEvent.js +19 -0
- package/dist/esm/router/v4v5/activeEvent.js.map +1 -0
- package/dist/esm/router/v4v5/dependencies.d.ts +9 -0
- package/dist/esm/router/v4v5/dependencies.js +14 -0
- package/dist/esm/router/v4v5/dependencies.js.map +1 -0
- package/dist/esm/router/v4v5/index.d.ts +4 -0
- package/dist/esm/router/v4v5/index.js +4 -0
- package/dist/esm/router/v4v5/index.js.map +1 -0
- package/dist/esm/router/v4v5/initialize.d.ts +3 -0
- package/dist/esm/router/v4v5/initialize.js +23 -0
- package/dist/esm/router/v4v5/initialize.js.map +1 -0
- package/dist/esm/router/v4v5/types.d.ts +16 -0
- package/dist/esm/router/v4v5/types.js +2 -0
- package/dist/esm/router/v4v5/types.js.map +1 -0
- package/dist/esm/router/v6/FaroRoutes.d.ts +3 -0
- package/dist/esm/router/v6/FaroRoutes.js +24 -0
- package/dist/esm/router/v6/FaroRoutes.js.map +1 -0
- package/dist/esm/router/v6/dependencies.d.ts +11 -0
- package/dist/esm/router/v6/dependencies.js +20 -0
- package/dist/esm/router/v6/dependencies.js.map +1 -0
- package/dist/esm/router/v6/index.d.ts +4 -0
- package/dist/esm/router/v6/index.js +4 -0
- package/dist/esm/router/v6/index.js.map +1 -0
- package/dist/esm/router/v6/initialize.d.ts +3 -0
- package/dist/esm/router/v6/initialize.js +8 -0
- package/dist/esm/router/v6/initialize.js.map +1 -0
- package/dist/esm/router/v6/types.d.ts +35 -0
- package/dist/esm/router/v6/types.js +2 -0
- package/dist/esm/router/v6/types.js.map +1 -0
- package/dist/esm/router/v6/utils.d.ts +4 -0
- package/dist/esm/router/v6/utils.js +35 -0
- package/dist/esm/router/v6/utils.js.map +1 -0
- package/dist/esm/types.d.ts +12 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/const.d.ts +1 -0
- package/dist/esm/utils/const.js +2 -0
- package/dist/esm/utils/const.js.map +1 -0
- package/dist/esm/utils/index.d.ts +2 -0
- package/dist/esm/utils/index.js +3 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/reactVersion.d.ts +7 -0
- package/dist/esm/utils/reactVersion.js +19 -0
- package/dist/esm/utils/reactVersion.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.internalGlobalObjectKey = exports.initializeFaro = exports.globalObject = exports.getWebInstrumentations = exports.getTransportBody = exports.getStackFramesFromError = exports.getInternalFaroFromGlobalObject = exports.getDataFromSafariExtensions = exports.getCurrentTimestamp = exports.FetchTransport = exports.ErrorsInstrumentation = exports.defaultMetas = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultEventDomain = exports.defaultExceptionType = exports.deepEqual = exports.createSession = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.ConsoleTransport = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.browserMeta = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.reactVersionMajor = exports.reactVersion = exports.isReactVersionAtLeast18 = exports.isReactVersionAtLeast17 = exports.isReactVersionAtLeast16 = exports.isReactVersionAtLeast = exports.getMajorReactVersion = exports.setReactRouterV6SSRDependencies = exports.setReactRouterV4V5SSRDependencies = exports.ReactRouterVersion = exports.NavigationType = exports.FaroRoutes = exports.FaroRoute = exports.withFaroProfiler = exports.FaroProfiler = exports.ReactIntegration = exports.withFaroErrorBoundary = exports.faroErrorBoundaryInitialState = exports.FaroErrorBoundary = void 0;
|
|
4
|
+
exports.WebVitalsInstrumentation = exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.parseStacktrace = exports.pageMeta = exports.noop = exports.makeCoreConfig = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = void 0;
|
|
5
|
+
var errorBoundary_1 = require("./errorBoundary");
|
|
6
|
+
Object.defineProperty(exports, "FaroErrorBoundary", { enumerable: true, get: function () { return errorBoundary_1.FaroErrorBoundary; } });
|
|
7
|
+
Object.defineProperty(exports, "faroErrorBoundaryInitialState", { enumerable: true, get: function () { return errorBoundary_1.faroErrorBoundaryInitialState; } });
|
|
8
|
+
Object.defineProperty(exports, "withFaroErrorBoundary", { enumerable: true, get: function () { return errorBoundary_1.withFaroErrorBoundary; } });
|
|
9
|
+
var instrumentation_1 = require("./instrumentation");
|
|
10
|
+
Object.defineProperty(exports, "ReactIntegration", { enumerable: true, get: function () { return instrumentation_1.ReactIntegration; } });
|
|
11
|
+
var profiler_1 = require("./profiler");
|
|
12
|
+
Object.defineProperty(exports, "FaroProfiler", { enumerable: true, get: function () { return profiler_1.FaroProfiler; } });
|
|
13
|
+
Object.defineProperty(exports, "withFaroProfiler", { enumerable: true, get: function () { return profiler_1.withFaroProfiler; } });
|
|
14
|
+
var router_1 = require("./router");
|
|
15
|
+
Object.defineProperty(exports, "FaroRoute", { enumerable: true, get: function () { return router_1.FaroRoute; } });
|
|
16
|
+
Object.defineProperty(exports, "FaroRoutes", { enumerable: true, get: function () { return router_1.FaroRoutes; } });
|
|
17
|
+
Object.defineProperty(exports, "NavigationType", { enumerable: true, get: function () { return router_1.NavigationType; } });
|
|
18
|
+
Object.defineProperty(exports, "ReactRouterVersion", { enumerable: true, get: function () { return router_1.ReactRouterVersion; } });
|
|
19
|
+
Object.defineProperty(exports, "setReactRouterV4V5SSRDependencies", { enumerable: true, get: function () { return router_1.setReactRouterV4V5SSRDependencies; } });
|
|
20
|
+
Object.defineProperty(exports, "setReactRouterV6SSRDependencies", { enumerable: true, get: function () { return router_1.setReactRouterV6SSRDependencies; } });
|
|
21
|
+
var utils_1 = require("./utils");
|
|
22
|
+
Object.defineProperty(exports, "getMajorReactVersion", { enumerable: true, get: function () { return utils_1.getMajorReactVersion; } });
|
|
23
|
+
Object.defineProperty(exports, "isReactVersionAtLeast", { enumerable: true, get: function () { return utils_1.isReactVersionAtLeast; } });
|
|
24
|
+
Object.defineProperty(exports, "isReactVersionAtLeast16", { enumerable: true, get: function () { return utils_1.isReactVersionAtLeast16; } });
|
|
25
|
+
Object.defineProperty(exports, "isReactVersionAtLeast17", { enumerable: true, get: function () { return utils_1.isReactVersionAtLeast17; } });
|
|
26
|
+
Object.defineProperty(exports, "isReactVersionAtLeast18", { enumerable: true, get: function () { return utils_1.isReactVersionAtLeast18; } });
|
|
27
|
+
Object.defineProperty(exports, "reactVersion", { enumerable: true, get: function () { return utils_1.reactVersion; } });
|
|
28
|
+
Object.defineProperty(exports, "reactVersionMajor", { enumerable: true, get: function () { return utils_1.reactVersionMajor; } });
|
|
29
|
+
var faro_web_sdk_1 = require("@grafana/faro-web-sdk");
|
|
30
|
+
Object.defineProperty(exports, "faro", { enumerable: true, get: function () { return faro_web_sdk_1.faro; } });
|
|
31
|
+
Object.defineProperty(exports, "allLogLevels", { enumerable: true, get: function () { return faro_web_sdk_1.allLogLevels; } });
|
|
32
|
+
Object.defineProperty(exports, "BaseExtension", { enumerable: true, get: function () { return faro_web_sdk_1.BaseExtension; } });
|
|
33
|
+
Object.defineProperty(exports, "BaseInstrumentation", { enumerable: true, get: function () { return faro_web_sdk_1.BaseInstrumentation; } });
|
|
34
|
+
Object.defineProperty(exports, "BaseTransport", { enumerable: true, get: function () { return faro_web_sdk_1.BaseTransport; } });
|
|
35
|
+
Object.defineProperty(exports, "browserMeta", { enumerable: true, get: function () { return faro_web_sdk_1.browserMeta; } });
|
|
36
|
+
Object.defineProperty(exports, "buildStackFrame", { enumerable: true, get: function () { return faro_web_sdk_1.buildStackFrame; } });
|
|
37
|
+
Object.defineProperty(exports, "ConsoleInstrumentation", { enumerable: true, get: function () { return faro_web_sdk_1.ConsoleInstrumentation; } });
|
|
38
|
+
Object.defineProperty(exports, "ConsoleTransport", { enumerable: true, get: function () { return faro_web_sdk_1.ConsoleTransport; } });
|
|
39
|
+
Object.defineProperty(exports, "Conventions", { enumerable: true, get: function () { return faro_web_sdk_1.Conventions; } });
|
|
40
|
+
Object.defineProperty(exports, "createInternalLogger", { enumerable: true, get: function () { return faro_web_sdk_1.createInternalLogger; } });
|
|
41
|
+
Object.defineProperty(exports, "createPromiseBuffer", { enumerable: true, get: function () { return faro_web_sdk_1.createPromiseBuffer; } });
|
|
42
|
+
Object.defineProperty(exports, "createSession", { enumerable: true, get: function () { return faro_web_sdk_1.createSession; } });
|
|
43
|
+
Object.defineProperty(exports, "deepEqual", { enumerable: true, get: function () { return faro_web_sdk_1.deepEqual; } });
|
|
44
|
+
Object.defineProperty(exports, "defaultExceptionType", { enumerable: true, get: function () { return faro_web_sdk_1.defaultExceptionType; } });
|
|
45
|
+
Object.defineProperty(exports, "defaultEventDomain", { enumerable: true, get: function () { return faro_web_sdk_1.defaultEventDomain; } });
|
|
46
|
+
Object.defineProperty(exports, "defaultGlobalObjectKey", { enumerable: true, get: function () { return faro_web_sdk_1.defaultGlobalObjectKey; } });
|
|
47
|
+
Object.defineProperty(exports, "defaultInternalLoggerLevel", { enumerable: true, get: function () { return faro_web_sdk_1.defaultInternalLoggerLevel; } });
|
|
48
|
+
Object.defineProperty(exports, "defaultLogLevel", { enumerable: true, get: function () { return faro_web_sdk_1.defaultLogLevel; } });
|
|
49
|
+
Object.defineProperty(exports, "defaultMetas", { enumerable: true, get: function () { return faro_web_sdk_1.defaultMetas; } });
|
|
50
|
+
Object.defineProperty(exports, "ErrorsInstrumentation", { enumerable: true, get: function () { return faro_web_sdk_1.ErrorsInstrumentation; } });
|
|
51
|
+
Object.defineProperty(exports, "FetchTransport", { enumerable: true, get: function () { return faro_web_sdk_1.FetchTransport; } });
|
|
52
|
+
Object.defineProperty(exports, "getCurrentTimestamp", { enumerable: true, get: function () { return faro_web_sdk_1.getCurrentTimestamp; } });
|
|
53
|
+
Object.defineProperty(exports, "getDataFromSafariExtensions", { enumerable: true, get: function () { return faro_web_sdk_1.getDataFromSafariExtensions; } });
|
|
54
|
+
Object.defineProperty(exports, "getInternalFaroFromGlobalObject", { enumerable: true, get: function () { return faro_web_sdk_1.getInternalFaroFromGlobalObject; } });
|
|
55
|
+
Object.defineProperty(exports, "getStackFramesFromError", { enumerable: true, get: function () { return faro_web_sdk_1.getStackFramesFromError; } });
|
|
56
|
+
Object.defineProperty(exports, "getTransportBody", { enumerable: true, get: function () { return faro_web_sdk_1.getTransportBody; } });
|
|
57
|
+
Object.defineProperty(exports, "getWebInstrumentations", { enumerable: true, get: function () { return faro_web_sdk_1.getWebInstrumentations; } });
|
|
58
|
+
Object.defineProperty(exports, "globalObject", { enumerable: true, get: function () { return faro_web_sdk_1.globalObject; } });
|
|
59
|
+
Object.defineProperty(exports, "initializeFaro", { enumerable: true, get: function () { return faro_web_sdk_1.initializeFaro; } });
|
|
60
|
+
Object.defineProperty(exports, "internalGlobalObjectKey", { enumerable: true, get: function () { return faro_web_sdk_1.internalGlobalObjectKey; } });
|
|
61
|
+
Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return faro_web_sdk_1.isArray; } });
|
|
62
|
+
Object.defineProperty(exports, "isBoolean", { enumerable: true, get: function () { return faro_web_sdk_1.isBoolean; } });
|
|
63
|
+
Object.defineProperty(exports, "isDomError", { enumerable: true, get: function () { return faro_web_sdk_1.isDomError; } });
|
|
64
|
+
Object.defineProperty(exports, "isDomException", { enumerable: true, get: function () { return faro_web_sdk_1.isDomException; } });
|
|
65
|
+
Object.defineProperty(exports, "isElement", { enumerable: true, get: function () { return faro_web_sdk_1.isElement; } });
|
|
66
|
+
Object.defineProperty(exports, "isElementDefined", { enumerable: true, get: function () { return faro_web_sdk_1.isElementDefined; } });
|
|
67
|
+
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return faro_web_sdk_1.isError; } });
|
|
68
|
+
Object.defineProperty(exports, "isErrorDefined", { enumerable: true, get: function () { return faro_web_sdk_1.isErrorDefined; } });
|
|
69
|
+
Object.defineProperty(exports, "isErrorEvent", { enumerable: true, get: function () { return faro_web_sdk_1.isErrorEvent; } });
|
|
70
|
+
Object.defineProperty(exports, "isEvent", { enumerable: true, get: function () { return faro_web_sdk_1.isEvent; } });
|
|
71
|
+
Object.defineProperty(exports, "isEventDefined", { enumerable: true, get: function () { return faro_web_sdk_1.isEventDefined; } });
|
|
72
|
+
Object.defineProperty(exports, "isFunction", { enumerable: true, get: function () { return faro_web_sdk_1.isFunction; } });
|
|
73
|
+
Object.defineProperty(exports, "isInstanceOf", { enumerable: true, get: function () { return faro_web_sdk_1.isInstanceOf; } });
|
|
74
|
+
Object.defineProperty(exports, "isInt", { enumerable: true, get: function () { return faro_web_sdk_1.isInt; } });
|
|
75
|
+
Object.defineProperty(exports, "isInternalFaroOnGlobalObject", { enumerable: true, get: function () { return faro_web_sdk_1.isInternalFaroOnGlobalObject; } });
|
|
76
|
+
Object.defineProperty(exports, "isMap", { enumerable: true, get: function () { return faro_web_sdk_1.isMap; } });
|
|
77
|
+
Object.defineProperty(exports, "isMapDefined", { enumerable: true, get: function () { return faro_web_sdk_1.isMapDefined; } });
|
|
78
|
+
Object.defineProperty(exports, "isNull", { enumerable: true, get: function () { return faro_web_sdk_1.isNull; } });
|
|
79
|
+
Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return faro_web_sdk_1.isNumber; } });
|
|
80
|
+
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return faro_web_sdk_1.isObject; } });
|
|
81
|
+
Object.defineProperty(exports, "isPrimitive", { enumerable: true, get: function () { return faro_web_sdk_1.isPrimitive; } });
|
|
82
|
+
Object.defineProperty(exports, "isRegExp", { enumerable: true, get: function () { return faro_web_sdk_1.isRegExp; } });
|
|
83
|
+
Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return faro_web_sdk_1.isString; } });
|
|
84
|
+
Object.defineProperty(exports, "isSymbol", { enumerable: true, get: function () { return faro_web_sdk_1.isSymbol; } });
|
|
85
|
+
Object.defineProperty(exports, "isSyntheticEvent", { enumerable: true, get: function () { return faro_web_sdk_1.isSyntheticEvent; } });
|
|
86
|
+
Object.defineProperty(exports, "isThenable", { enumerable: true, get: function () { return faro_web_sdk_1.isThenable; } });
|
|
87
|
+
Object.defineProperty(exports, "isToString", { enumerable: true, get: function () { return faro_web_sdk_1.isToString; } });
|
|
88
|
+
Object.defineProperty(exports, "isTypeof", { enumerable: true, get: function () { return faro_web_sdk_1.isTypeof; } });
|
|
89
|
+
Object.defineProperty(exports, "isUndefined", { enumerable: true, get: function () { return faro_web_sdk_1.isUndefined; } });
|
|
90
|
+
Object.defineProperty(exports, "InternalLoggerLevel", { enumerable: true, get: function () { return faro_web_sdk_1.InternalLoggerLevel; } });
|
|
91
|
+
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return faro_web_sdk_1.LogLevel; } });
|
|
92
|
+
Object.defineProperty(exports, "makeCoreConfig", { enumerable: true, get: function () { return faro_web_sdk_1.makeCoreConfig; } });
|
|
93
|
+
Object.defineProperty(exports, "noop", { enumerable: true, get: function () { return faro_web_sdk_1.noop; } });
|
|
94
|
+
Object.defineProperty(exports, "pageMeta", { enumerable: true, get: function () { return faro_web_sdk_1.pageMeta; } });
|
|
95
|
+
Object.defineProperty(exports, "parseStacktrace", { enumerable: true, get: function () { return faro_web_sdk_1.parseStacktrace; } });
|
|
96
|
+
Object.defineProperty(exports, "setInternalFaroOnGlobalObject", { enumerable: true, get: function () { return faro_web_sdk_1.setInternalFaroOnGlobalObject; } });
|
|
97
|
+
Object.defineProperty(exports, "TransportItemType", { enumerable: true, get: function () { return faro_web_sdk_1.TransportItemType; } });
|
|
98
|
+
Object.defineProperty(exports, "transportItemTypeToBodyKey", { enumerable: true, get: function () { return faro_web_sdk_1.transportItemTypeToBodyKey; } });
|
|
99
|
+
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return faro_web_sdk_1.VERSION; } });
|
|
100
|
+
Object.defineProperty(exports, "WebVitalsInstrumentation", { enumerable: true, get: function () { return faro_web_sdk_1.WebVitalsInstrumentation; } });
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iDAA0G;AAAjG,kHAAA,iBAAiB,OAAA;AAAE,8HAAA,6BAA6B,OAA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egrationConfig } from './types';
|
|
3
|
+
export declare class ReactIntegration extends BaseInstrumentation {
|
|
4
|
+
private config;
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
constructor(config?: ReactIntegrationConfig);
|
|
8
|
+
initialize(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ReactIntegration = void 0;
|
|
19
|
+
var faro_web_sdk_1 = require("@grafana/faro-web-sdk");
|
|
20
|
+
var router_1 = require("./router");
|
|
21
|
+
var ReactIntegration = /** @class */ (function (_super) {
|
|
22
|
+
__extends(ReactIntegration, _super);
|
|
23
|
+
function ReactIntegration(config) {
|
|
24
|
+
if (config === void 0) { config = {}; }
|
|
25
|
+
var _this = _super.call(this) || this;
|
|
26
|
+
_this.config = config;
|
|
27
|
+
_this.name = '@grafana/faro-react';
|
|
28
|
+
_this.version = faro_web_sdk_1.VERSION;
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
ReactIntegration.prototype.initialize = function () {
|
|
32
|
+
(0, router_1.initializeReactRouterInstrumentation)(this.config, this.faro);
|
|
33
|
+
};
|
|
34
|
+
return ReactIntegration;
|
|
35
|
+
}(faro_web_sdk_1.BaseInstrumentation));
|
|
36
|
+
exports.ReactIntegration = ReactIntegration;
|
|
37
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sDAAqE;AAErE,mCAAgE;AAGhE;IAAsC,oCAAmB;IAIvD,0BAAoB,MAAmC;QAAnC,uBAAA,EAAA,WAAmC;QAAvD,YACE,iBAAO,SACR;QAFmB,YAAM,GAAN,MAAM,CAA6B;QAHvD,UAAI,GAAG,qBAAqB,CAAC;QAC7B,aAAO,GAAG,sBAAO,CAAC;;IAIlB,CAAC;IAED,qCAAU,GAAV;QACE,IAAA,6CAAoC,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IACH,uBAAC;AAAD,CAAC,AAXD,CAAsC,kCAAmB,GAWxD;AAXY,4CAAgB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Span } from '@opentelemetry/api';
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
export interface FaroProfilerProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
name: string;
|
|
7
|
+
updateProps: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare class FaroProfiler extends Component<FaroProfilerProps> {
|
|
10
|
+
protected mountSpan: Span | undefined;
|
|
11
|
+
protected mountSpanEndTime: number | undefined;
|
|
12
|
+
protected updateSpan: Span | undefined;
|
|
13
|
+
private get isOtelInitialized();
|
|
14
|
+
private get otel();
|
|
15
|
+
private get tracer();
|
|
16
|
+
private createSpan;
|
|
17
|
+
private createChildSpan;
|
|
18
|
+
constructor(props: FaroProfilerProps);
|
|
19
|
+
componentDidMount(): void;
|
|
20
|
+
shouldComponentUpdate({ updateProps }: FaroProfilerProps): boolean;
|
|
21
|
+
componentDidUpdate(): void;
|
|
22
|
+
componentWillUnmount(): void;
|
|
23
|
+
render(): ReactNode;
|
|
24
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.FaroProfiler = void 0;
|
|
30
|
+
var react_1 = require("react");
|
|
31
|
+
var faro_web_sdk_1 = require("@grafana/faro-web-sdk");
|
|
32
|
+
var FaroProfiler = /** @class */ (function (_super) {
|
|
33
|
+
__extends(FaroProfiler, _super);
|
|
34
|
+
function FaroProfiler(props) {
|
|
35
|
+
var _this = this;
|
|
36
|
+
var _a;
|
|
37
|
+
_this = _super.call(this, props) || this;
|
|
38
|
+
_this.mountSpan = undefined;
|
|
39
|
+
_this.mountSpanEndTime = undefined;
|
|
40
|
+
_this.updateSpan = undefined;
|
|
41
|
+
if (_this.isOtelInitialized) {
|
|
42
|
+
_this.mountSpan = _this.createSpan('componentMount');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
(_a = faro_web_sdk_1.faro.internalLogger) === null || _a === void 0 ? void 0 : _a.error('The Faro React Profiler requires tracing instrumentation. Please enable it in the "instrumentations" section of your config.');
|
|
46
|
+
}
|
|
47
|
+
return _this;
|
|
48
|
+
}
|
|
49
|
+
Object.defineProperty(FaroProfiler.prototype, "isOtelInitialized", {
|
|
50
|
+
get: function () {
|
|
51
|
+
var _a;
|
|
52
|
+
return !!((_a = faro_web_sdk_1.faro.api) === null || _a === void 0 ? void 0 : _a.isOTELInitialized());
|
|
53
|
+
},
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(FaroProfiler.prototype, "otel", {
|
|
58
|
+
get: function () {
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = faro_web_sdk_1.faro.api) === null || _a === void 0 ? void 0 : _a.getOTEL();
|
|
61
|
+
},
|
|
62
|
+
enumerable: false,
|
|
63
|
+
configurable: true
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(FaroProfiler.prototype, "tracer", {
|
|
66
|
+
get: function () {
|
|
67
|
+
var _a;
|
|
68
|
+
return (_a = this.otel) === null || _a === void 0 ? void 0 : _a.trace.getTracer('@grafana/faro-react', faro_web_sdk_1.VERSION);
|
|
69
|
+
},
|
|
70
|
+
enumerable: false,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
FaroProfiler.prototype.createSpan = function (spanName, options) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
var span = this.tracer.startSpan(spanName, {
|
|
76
|
+
startTime: options === null || options === void 0 ? void 0 : options.startTime,
|
|
77
|
+
attributes: __assign({ 'react.component.name': this.props.name }, ((_a = options === null || options === void 0 ? void 0 : options.attributes) !== null && _a !== void 0 ? _a : {})),
|
|
78
|
+
});
|
|
79
|
+
(_b = this.otel) === null || _b === void 0 ? void 0 : _b.trace.setSpan(this.otel.context.active(), span);
|
|
80
|
+
if (options === null || options === void 0 ? void 0 : options.endTime) {
|
|
81
|
+
span.end(options.endTime);
|
|
82
|
+
}
|
|
83
|
+
return span;
|
|
84
|
+
};
|
|
85
|
+
FaroProfiler.prototype.createChildSpan = function (spanName, parent, options) {
|
|
86
|
+
var _this = this;
|
|
87
|
+
var _a;
|
|
88
|
+
var span;
|
|
89
|
+
(_a = this.otel) === null || _a === void 0 ? void 0 : _a.context.with(this.otel.trace.setSpan(this.otel.context.active(), parent), function () {
|
|
90
|
+
span = _this.createSpan(spanName, options);
|
|
91
|
+
});
|
|
92
|
+
return span;
|
|
93
|
+
};
|
|
94
|
+
FaroProfiler.prototype.componentDidMount = function () {
|
|
95
|
+
if (this.isOtelInitialized && this.mountSpan) {
|
|
96
|
+
this.mountSpanEndTime = Date.now();
|
|
97
|
+
this.mountSpan.end(this.mountSpanEndTime);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
FaroProfiler.prototype.shouldComponentUpdate = function (_a) {
|
|
101
|
+
var _this = this;
|
|
102
|
+
var updateProps = _a.updateProps;
|
|
103
|
+
if (this.isOtelInitialized && this.mountSpan && updateProps !== this.props.updateProps) {
|
|
104
|
+
var changedProps = Object.keys(updateProps).filter(function (key) { return updateProps[key] !== _this.props.updateProps[key]; });
|
|
105
|
+
if (changedProps.length > 0) {
|
|
106
|
+
this.updateSpan = this.createChildSpan('componentUpdate', this.mountSpan, {
|
|
107
|
+
attributes: {
|
|
108
|
+
'react.component.changed_props': changedProps,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
};
|
|
115
|
+
FaroProfiler.prototype.componentDidUpdate = function () {
|
|
116
|
+
if (this.isOtelInitialized && this.updateSpan) {
|
|
117
|
+
this.updateSpan.end();
|
|
118
|
+
this.updateSpan = undefined;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
FaroProfiler.prototype.componentWillUnmount = function () {
|
|
122
|
+
if (this.isOtelInitialized && this.mountSpan) {
|
|
123
|
+
this.createChildSpan('componentRender', this.mountSpan, {
|
|
124
|
+
startTime: this.mountSpanEndTime,
|
|
125
|
+
endTime: Date.now(),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
FaroProfiler.prototype.render = function () {
|
|
130
|
+
return this.props.children;
|
|
131
|
+
};
|
|
132
|
+
return FaroProfiler;
|
|
133
|
+
}(react_1.Component));
|
|
134
|
+
exports.FaroProfiler = FaroProfiler;
|
|
135
|
+
//# sourceMappingURL=FaroProfiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FaroProfiler.js","sourceRoot":"","sources":["../../../src/profiler/FaroProfiler.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkC;AAIlC,sDAAsD;AAQtD;IAAkC,gCAA4B;IAoD5D,sBAAY,KAAwB;QAApC,iBAUC;;gBATC,kBAAM,KAAK,CAAC;QApDJ,eAAS,GAAqB,SAAS,CAAC;QACxC,sBAAgB,GAAuB,SAAS,CAAC;QACjD,gBAAU,GAAqB,SAAS,CAAC;QAoDjD,IAAI,KAAI,CAAC,iBAAiB,EAAE;YAC1B,KAAI,CAAC,SAAS,GAAG,KAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;SACpD;aAAM;YACL,MAAA,mBAAI,CAAC,cAAc,0CAAE,KAAK,CACxB,8HAA8H,CAC/H,CAAC;SACH;;IACH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AAU,CAAC,GAAG,EAAE,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;SAC7B;IACH,CAAC;IAEQ,2CAAoB,GAA7B;QACE,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,SAAS,EAAE;YAC5C,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,EAAE;gBACtD,SAAS,EAAE,IAAI,CAAC,gBAAgB;gBAChC,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;aACpB,CAAC,CAAC;SACJ;IACH,CAAC;IAEQ,6BAAM,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;IACH,mBAAC;AAAD,CAAC,AA1GD,CAAkC,iBAAS,GA0G1C;AA1GY,oCAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withFaroProfiler = exports.FaroProfiler = void 0;
|
|
4
|
+
var FaroProfiler_1 = require("./FaroProfiler");
|
|
5
|
+
Object.defineProperty(exports, "FaroProfiler", { enumerable: true, get: function () { return FaroProfiler_1.FaroProfiler; } });
|
|
6
|
+
var withFaroProfiler_1 = require("./withFaroProfiler");
|
|
7
|
+
Object.defineProperty(exports, "withFaroProfiler", { enumerable: true, get: function () { return withFaroProfiler_1.withFaroProfiler; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.withFaroProfiler = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var hoist_non_react_statics_1 = __importDefault(require("hoist-non-react-statics"));
|
|
20
|
+
var utils_1 = require("../utils");
|
|
21
|
+
var FaroProfiler_1 = require("./FaroProfiler");
|
|
22
|
+
function withFaroProfiler(WrappedComponent, options) {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
var componentDisplayName = (_c = (_b = (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : WrappedComponent.displayName) !== null && _b !== void 0 ? _b : WrappedComponent.name) !== null && _c !== void 0 ? _c : utils_1.unknownString;
|
|
25
|
+
var Component = function (props) { return ((0, jsx_runtime_1.jsx)(FaroProfiler_1.FaroProfiler, __assign({ name: componentDisplayName, updateProps: props }, { children: (0, jsx_runtime_1.jsx)(WrappedComponent, __assign({}, props)) }))); };
|
|
26
|
+
Component.displayName = "faroProfiler(".concat(componentDisplayName, ")");
|
|
27
|
+
(0, hoist_non_react_statics_1.default)(Component, WrappedComponent);
|
|
28
|
+
return Component;
|
|
29
|
+
}
|
|
30
|
+
exports.withFaroProfiler = withFaroProfiler;
|
|
31
|
+
//# sourceMappingURL=withFaroProfiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withFaroProfiler.js","sourceRoot":"","sources":["../../../src/profiler/withFaroProfiler.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oFAA2D;AAG3D,kCAAyC;AACzC,+CAA8C;AAG9C,SAAgB,gBAAgB,CAC9B,gBAAkC,EAClC,OAAgD;;IAEhD,IAAM,oBAAoB,GAAG,MAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,gBAAgB,CAAC,WAAW,mCAAI,gBAAgB,CAAC,IAAI,mCAAI,qBAAa,CAAC;IAErH,IAAM,SAAS,GAAU,UAAC,KAAQ,IAAK,OAAA,CACrC,uBAAC,2BAAY,aAAC,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,KAAK,gBAC1D,uBAAC,gBAAgB,eAAK,KAAK,EAAI,IAClB,CAChB,EAJsC,CAItC,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,uBAAgB,oBAAoB,MAAG,CAAC;IAEhE,IAAA,iCAAoB,EAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAElD,OAAO,SAAS,CAAC;AACnB,CAAC;AAjBD,4CAiBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { initializeReactRouterInstrumentation } from './initialize';
|
|
2
|
+
export { NavigationType, ReactRouterVersion } from './types';
|
|
3
|
+
export type { ReactRouterLocation, ReactRouterHistory } from './types';
|
|
4
|
+
export { FaroRoute, setReactRouterV4V5SSRDependencies } from './v4v5';
|
|
5
|
+
export type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './v4v5';
|
|
6
|
+
export { FaroRoutes, setReactRouterV6SSRDependencies } from './v6';
|
|
7
|
+
export type { ReactRouterV6CreateRoutesFromChildren, ReactRouterV6Dependencies, ReactRouterV6MatchRoutes, ReactRouterV6Params, ReactRouterV6RouteMatch, ReactRouterV6RouteObject, ReactRouterV6RoutesProps, ReactRouterV6RoutesShape, ReactRouterV6UseLocation, ReactRouterV6UseNavigationType, } from './v6';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setReactRouterV6SSRDependencies = exports.FaroRoutes = exports.setReactRouterV4V5SSRDependencies = exports.FaroRoute = exports.ReactRouterVersion = exports.NavigationType = exports.initializeReactRouterInstrumentation = void 0;
|
|
4
|
+
var initialize_1 = require("./initialize");
|
|
5
|
+
Object.defineProperty(exports, "initializeReactRouterInstrumentation", { enumerable: true, get: function () { return initialize_1.initializeReactRouterInstrumentation; } });
|
|
6
|
+
var types_1 = require("./types");
|
|
7
|
+
Object.defineProperty(exports, "NavigationType", { enumerable: true, get: function () { return types_1.NavigationType; } });
|
|
8
|
+
Object.defineProperty(exports, "ReactRouterVersion", { enumerable: true, get: function () { return types_1.ReactRouterVersion; } });
|
|
9
|
+
var v4v5_1 = require("./v4v5");
|
|
10
|
+
Object.defineProperty(exports, "FaroRoute", { enumerable: true, get: function () { return v4v5_1.FaroRoute; } });
|
|
11
|
+
Object.defineProperty(exports, "setReactRouterV4V5SSRDependencies", { enumerable: true, get: function () { return v4v5_1.setReactRouterV4V5SSRDependencies; } });
|
|
12
|
+
var v6_1 = require("./v6");
|
|
13
|
+
Object.defineProperty(exports, "FaroRoutes", { enumerable: true, get: function () { return v6_1.FaroRoutes; } });
|
|
14
|
+
Object.defineProperty(exports, "setReactRouterV6SSRDependencies", { enumerable: true, get: function () { return v6_1.setReactRouterV6SSRDependencies; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,+BAAsE;AAA7D,iGAAA,SAAS,OAAA;AAAE,yHAAA,iCAAiC,OAAA;AAGrD,2BAAmE;AAA1D,gGAAA,UAAU,OAAA;AAAE,qHAAA,+BAA+B,OAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initializeReactRouterInstrumentation = void 0;
|
|
4
|
+
var types_1 = require("./types");
|
|
5
|
+
var v4v5_1 = require("./v4v5");
|
|
6
|
+
var v6_1 = require("./v6");
|
|
7
|
+
function initializeReactRouterInstrumentation(config, faro) {
|
|
8
|
+
var _a;
|
|
9
|
+
switch ((_a = config.router) === null || _a === void 0 ? void 0 : _a.version) {
|
|
10
|
+
case types_1.ReactRouterVersion.V6:
|
|
11
|
+
faro.internalLogger.debug('Initializing React Router V6 instrumentation');
|
|
12
|
+
(0, v6_1.initializeReactRouterV6Instrumentation)(config.router.dependencies, faro);
|
|
13
|
+
break;
|
|
14
|
+
case types_1.ReactRouterVersion.V5:
|
|
15
|
+
case types_1.ReactRouterVersion.V4:
|
|
16
|
+
faro.internalLogger.debug("Initializing React Router ".concat(config.router.version, " instrumentation"));
|
|
17
|
+
(0, v4v5_1.initializeReactRouterV4V5Instrumentation)(config.router.dependencies, faro);
|
|
18
|
+
break;
|
|
19
|
+
default:
|
|
20
|
+
faro.internalLogger.debug('Skipping initialization of React Router instrumentation');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.initializeReactRouterInstrumentation = initializeReactRouterInstrumentation;
|
|
24
|
+
//# sourceMappingURL=initialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/router/initialize.ts"],"names":[],"mappings":";;;AAGA,iCAA6C;AAC7C,+BAAkE;AAClE,2BAA8D;AAE9D,SAAgB,oCAAoC,CAAC,MAA8B,EAAE,IAAU;;IAC7F,QAAQ,MAAA,MAAM,CAAC,MAAM,0CAAE,OAAO,EAAE;QAC9B,KAAK,0BAAkB,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAC1E,IAAA,2CAAsC,EAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YACzE,MAAM;QAER,KAAK,0BAAkB,CAAC,EAAE,CAAC;QAC3B,KAAK,0BAAkB,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,oCAA6B,MAAM,CAAC,MAAM,CAAC,OAAO,qBAAkB,CAAC,CAAC;YAChG,IAAA,+CAAwC,EAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YAC3E,MAAM;QAER;YACE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;KACxF;AACH,CAAC;AAhBD,oFAgBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ReactRouterLocation<S extends any = unknown> {
|
|
2
|
+
hash: string;
|
|
3
|
+
key: string;
|
|
4
|
+
pathname: string;
|
|
5
|
+
search: string;
|
|
6
|
+
state: S;
|
|
7
|
+
}
|
|
8
|
+
export interface ReactRouterHistory extends Record<string, any> {
|
|
9
|
+
listen?: (cb: (location: ReactRouterLocation, action: NavigationType) => void) => void;
|
|
10
|
+
location?: ReactRouterLocation;
|
|
11
|
+
}
|
|
12
|
+
export declare enum ReactRouterVersion {
|
|
13
|
+
V4 = "v4",
|
|
14
|
+
V5 = "v5",
|
|
15
|
+
V6 = "v6"
|
|
16
|
+
}
|
|
17
|
+
export declare enum NavigationType {
|
|
18
|
+
Pop = "POP",
|
|
19
|
+
Push = "PUSH",
|
|
20
|
+
Replace = "REPLACE"
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationType = exports.ReactRouterVersion = void 0;
|
|
4
|
+
var ReactRouterVersion;
|
|
5
|
+
(function (ReactRouterVersion) {
|
|
6
|
+
ReactRouterVersion["V4"] = "v4";
|
|
7
|
+
ReactRouterVersion["V5"] = "v5";
|
|
8
|
+
ReactRouterVersion["V6"] = "v6";
|
|
9
|
+
})(ReactRouterVersion = exports.ReactRouterVersion || (exports.ReactRouterVersion = {}));
|
|
10
|
+
var NavigationType;
|
|
11
|
+
(function (NavigationType) {
|
|
12
|
+
NavigationType["Pop"] = "POP";
|
|
13
|
+
NavigationType["Push"] = "PUSH";
|
|
14
|
+
NavigationType["Replace"] = "REPLACE";
|
|
15
|
+
})(NavigationType = exports.NavigationType || (exports.NavigationType = {}));
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/router/types.ts"],"names":[],"mappings":";;;AAaA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,+BAAS,CAAA;IACT,+BAAS,CAAA;IACT,+BAAS,CAAA;AACX,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;IACb,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.FaroRoute = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var activeEvent_1 = require("./activeEvent");
|
|
17
|
+
var dependencies_1 = require("./dependencies");
|
|
18
|
+
function FaroRoute(props) {
|
|
19
|
+
var _a;
|
|
20
|
+
if ((_a = props === null || props === void 0 ? void 0 : props.computedMatch) === null || _a === void 0 ? void 0 : _a.isExact) {
|
|
21
|
+
(0, activeEvent_1.setActiveEventRoute)(props.computedMatch.path);
|
|
22
|
+
}
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(dependencies_1.Route, __assign({}, props));
|
|
24
|
+
}
|
|
25
|
+
exports.FaroRoute = FaroRoute;
|
|
26
|
+
//# sourceMappingURL=FaroRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FaroRoute.js","sourceRoot":"","sources":["../../../../src/router/v4v5/FaroRoute.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAoD;AACpD,+CAAuC;AAGvC,SAAgB,SAAS,CAAC,KAAgC;;IACxD,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,0CAAE,OAAO,EAAE;QACjC,IAAA,iCAAmB,EAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC/C;IAED,OAAO,uBAAC,oBAAK,eAAK,KAAK,EAAI,CAAC;AAC9B,CAAC;AAND,8BAMC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReactRouterV4V5ActiveEvent } from './types';
|
|
2
|
+
export declare let activeEvent: ReactRouterV4V5ActiveEvent | undefined;
|
|
3
|
+
export declare function createNewActiveEvent(url: string): ReactRouterV4V5ActiveEvent;
|
|
4
|
+
export declare function setActiveEventRoute(route: string): void;
|
|
5
|
+
export declare function sendActiveEvent(): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendActiveEvent = exports.setActiveEventRoute = exports.createNewActiveEvent = exports.activeEvent = void 0;
|
|
4
|
+
var dependencies_1 = require("./dependencies");
|
|
5
|
+
exports.activeEvent = undefined;
|
|
6
|
+
function createNewActiveEvent(url) {
|
|
7
|
+
exports.activeEvent = {
|
|
8
|
+
url: url,
|
|
9
|
+
route: '',
|
|
10
|
+
};
|
|
11
|
+
return exports.activeEvent;
|
|
12
|
+
}
|
|
13
|
+
exports.createNewActiveEvent = createNewActiveEvent;
|
|
14
|
+
function setActiveEventRoute(route) {
|
|
15
|
+
if (exports.activeEvent) {
|
|
16
|
+
exports.activeEvent.route = route;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.setActiveEventRoute = setActiveEventRoute;
|
|
20
|
+
function sendActiveEvent() {
|
|
21
|
+
dependencies_1.faro.api.pushEvent('routeChange', exports.activeEvent, undefined, { skipDedupe: true });
|
|
22
|
+
exports.activeEvent = undefined;
|
|
23
|
+
}
|
|
24
|
+
exports.sendActiveEvent = sendActiveEvent;
|
|
25
|
+
//# sourceMappingURL=activeEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activeEvent.js","sourceRoot":"","sources":["../../../../src/router/v4v5/activeEvent.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AAG3B,QAAA,WAAW,GAA2C,SAAS,CAAC;AAE3E,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,mBAAW,GAAG;QACZ,GAAG,KAAA;QACH,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,OAAO,mBAAW,CAAC;AACrB,CAAC;AAPD,oDAOC;AAED,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,IAAI,mBAAW,EAAE;QACf,mBAAW,CAAC,KAAK,GAAG,KAAK,CAAC;KAC3B;AACH,CAAC;AAJD,kDAIC;AAED,SAAgB,eAAe;IAC7B,mBAAI,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE,mBAAW,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhF,mBAAW,GAAG,SAAS,CAAC;AAC1B,CAAC;AAJD,0CAIC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Faro } from '@grafana/faro-web-sdk';
|
|
2
|
+
import type { ReactRouterHistory } from '../types';
|
|
3
|
+
import type { ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';
|
|
4
|
+
export declare let isInitialized: boolean;
|
|
5
|
+
export declare let faro: Faro;
|
|
6
|
+
export declare let history: ReactRouterHistory;
|
|
7
|
+
export declare let Route: ReactRouterV4V5RouteShape;
|
|
8
|
+
export declare function setDependencies(dependencies: ReactRouterV4V5Dependencies, newFaro: Faro): void;
|
|
9
|
+
export declare function setReactRouterV4V5SSRDependencies(newDependencies: Pick<ReactRouterV4V5Dependencies, 'Route'>): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setReactRouterV4V5SSRDependencies = exports.setDependencies = exports.Route = exports.history = exports.faro = exports.isInitialized = void 0;
|
|
4
|
+
exports.isInitialized = false;
|
|
5
|
+
function setDependencies(dependencies, newFaro) {
|
|
6
|
+
exports.isInitialized = true;
|
|
7
|
+
exports.faro = newFaro;
|
|
8
|
+
exports.history = dependencies.history;
|
|
9
|
+
exports.Route = dependencies.Route;
|
|
10
|
+
}
|
|
11
|
+
exports.setDependencies = setDependencies;
|
|
12
|
+
function setReactRouterV4V5SSRDependencies(newDependencies) {
|
|
13
|
+
exports.Route = newDependencies.Route;
|
|
14
|
+
}
|
|
15
|
+
exports.setReactRouterV4V5SSRDependencies = setReactRouterV4V5SSRDependencies;
|
|
16
|
+
//# sourceMappingURL=dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/router/v4v5/dependencies.ts"],"names":[],"mappings":";;;AAKW,QAAA,aAAa,GAAG,KAAK,CAAC;AAKjC,SAAgB,eAAe,CAAC,YAAyC,EAAE,OAAa;IACtF,qBAAa,GAAG,IAAI,CAAC;IAErB,YAAI,GAAG,OAAO,CAAC;IACf,eAAO,GAAG,YAAY,CAAC,OAAO,CAAC;IAC/B,aAAK,GAAG,YAAY,CAAC,KAAK,CAAC;AAC7B,CAAC;AAND,0CAMC;AAED,SAAgB,iCAAiC,CAAC,eAA2D;IAC3G,aAAK,GAAG,eAAe,CAAC,KAAK,CAAC;AAChC,CAAC;AAFD,8EAEC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { setReactRouterV4V5SSRDependencies } from './dependencies';
|
|
2
|
+
export { FaroRoute } from './FaroRoute';
|
|
3
|
+
export { initializeReactRouterV4V5Instrumentation } from './initialize';
|
|
4
|
+
export type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';
|