@grafana/faro-react 1.0.0-beta2 → 1.0.0-beta3

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.
Files changed (68) hide show
  1. package/dist/cjs/errorBoundary/FaroErrorBoundary.js.map +1 -1
  2. package/dist/cjs/errorBoundary/const.js.map +1 -1
  3. package/dist/cjs/errorBoundary/index.js.map +1 -1
  4. package/dist/cjs/errorBoundary/types.d.ts +3 -3
  5. package/dist/cjs/errorBoundary/types.js.map +1 -1
  6. package/dist/cjs/errorBoundary/withFaroErrorBoundary.js.map +1 -1
  7. package/dist/cjs/index.d.ts +1 -1
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/instrumentation.js.map +1 -1
  10. package/dist/cjs/profiler/FaroProfiler.js.map +1 -1
  11. package/dist/cjs/profiler/index.js.map +1 -1
  12. package/dist/cjs/profiler/withFaroProfiler.js.map +1 -1
  13. package/dist/cjs/router/index.js.map +1 -1
  14. package/dist/cjs/router/initialize.js.map +1 -1
  15. package/dist/cjs/router/types.js.map +1 -1
  16. package/dist/cjs/router/v4v5/FaroRoute.js.map +1 -1
  17. package/dist/cjs/router/v4v5/activeEvent.js.map +1 -1
  18. package/dist/cjs/router/v4v5/dependencies.js.map +1 -1
  19. package/dist/cjs/router/v4v5/index.js.map +1 -1
  20. package/dist/cjs/router/v4v5/initialize.js.map +1 -1
  21. package/dist/cjs/router/v4v5/types.d.ts +1 -1
  22. package/dist/cjs/router/v4v5/types.js.map +1 -1
  23. package/dist/cjs/router/v6/FaroRoutes.js.map +1 -1
  24. package/dist/cjs/router/v6/dependencies.js.map +1 -1
  25. package/dist/cjs/router/v6/index.js.map +1 -1
  26. package/dist/cjs/router/v6/initialize.js.map +1 -1
  27. package/dist/cjs/router/v6/types.d.ts +6 -6
  28. package/dist/cjs/router/v6/types.js.map +1 -1
  29. package/dist/cjs/router/v6/utils.js.map +1 -1
  30. package/dist/cjs/types.js.map +1 -1
  31. package/dist/cjs/utils/const.js.map +1 -1
  32. package/dist/cjs/utils/index.js.map +1 -1
  33. package/dist/cjs/utils/reactVersion.js.map +1 -1
  34. package/dist/esm/errorBoundary/FaroErrorBoundary.js.map +1 -1
  35. package/dist/esm/errorBoundary/const.js.map +1 -1
  36. package/dist/esm/errorBoundary/index.js.map +1 -1
  37. package/dist/esm/errorBoundary/types.d.ts +3 -3
  38. package/dist/esm/errorBoundary/types.js.map +1 -1
  39. package/dist/esm/errorBoundary/withFaroErrorBoundary.js.map +1 -1
  40. package/dist/esm/index.d.ts +1 -1
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/esm/instrumentation.js.map +1 -1
  43. package/dist/esm/profiler/FaroProfiler.js +13 -13
  44. package/dist/esm/profiler/FaroProfiler.js.map +1 -1
  45. package/dist/esm/profiler/index.js.map +1 -1
  46. package/dist/esm/profiler/withFaroProfiler.js.map +1 -1
  47. package/dist/esm/router/index.js.map +1 -1
  48. package/dist/esm/router/initialize.js.map +1 -1
  49. package/dist/esm/router/types.js.map +1 -1
  50. package/dist/esm/router/v4v5/FaroRoute.js.map +1 -1
  51. package/dist/esm/router/v4v5/activeEvent.js.map +1 -1
  52. package/dist/esm/router/v4v5/dependencies.js.map +1 -1
  53. package/dist/esm/router/v4v5/index.js.map +1 -1
  54. package/dist/esm/router/v4v5/initialize.js.map +1 -1
  55. package/dist/esm/router/v4v5/types.d.ts +1 -1
  56. package/dist/esm/router/v4v5/types.js.map +1 -1
  57. package/dist/esm/router/v6/FaroRoutes.js.map +1 -1
  58. package/dist/esm/router/v6/dependencies.js.map +1 -1
  59. package/dist/esm/router/v6/index.js.map +1 -1
  60. package/dist/esm/router/v6/initialize.js.map +1 -1
  61. package/dist/esm/router/v6/types.d.ts +6 -6
  62. package/dist/esm/router/v6/types.js.map +1 -1
  63. package/dist/esm/router/v6/utils.js.map +1 -1
  64. package/dist/esm/types.js.map +1 -1
  65. package/dist/esm/utils/const.js.map +1 -1
  66. package/dist/esm/utils/index.js.map +1 -1
  67. package/dist/esm/utils/reactVersion.js.map +1 -1
  68. package/package.json +17 -6
@@ -1 +1 @@
1
- {"version":3,"file":"FaroErrorBoundary.js","sourceRoot":"","sources":["../../../src/errorBoundary/FaroErrorBoundary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAAkD;AAGlD,sDAAyD;AAEzD,kCAAmD;AACnD,iCAAwD;AAGxD;IAAuC,qCAAyD;IAG9F,2BAAY,KAA6B;QAAzC,YACE,kBAAM,KAAK,CAAC,SAGb;QANQ,WAAK,GAA2B,qCAA6B,CAAC;QAKrE,KAAI,CAAC,kBAAkB,GAAG,KAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IAC/D,CAAC;IAED,sDAA0B,GAA1B,UAA2B,KAAY,EAAE,SAAoB;QAC3D,IAAI,CAAC,+BAAuB,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YACzD,OAAO,KAAK,CAAC;SACd;QAED,IAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE1C,QAAQ,CAAC,IAAI,GAAG,8BAAuB,KAAK,CAAC,IAAI,CAAE,CAAC;QACpD,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC,cAAc,CAAC;QAE1C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,0CAAwB,GAA/B,UAAgC,KAAY;QAC1C,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,KAAK,OAAA;SACN,CAAC;IACJ,CAAC;IAEQ,6CAAiB,GAA1B,UAA2B,KAAY,EAAE,SAAoB;;QAC3D,IAAM,uBAAuB,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAElF,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,aAAa,mDAAG,uBAAuB,CAAC,CAAC;QAEpD,mBAAI,CAAC,GAAG,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAE5C,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CAAC,CAAC;QAEpE,IAAI,IAAA,sBAAc,EAAC,OAAO,CAAC,EAAE;YAC3B,OAAO,OAAO,CAAC;SAChB;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACvB,mBAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,iDAAiD,CAAC,CAAC;SAChG;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IACH,wBAAC;AAAD,CAAC,AA1ED,CAAuC,iBAAS,GA0E/C;AA1EY,8CAAiB","sourcesContent":["import { Component, isValidElement } from 'react';\nimport type { ErrorInfo, ReactNode } from 'react';\n\nimport { faro, isFunction } from '@grafana/faro-web-sdk';\n\nimport { isReactVersionAtLeast17 } from '../utils';\nimport { faroErrorBoundaryInitialState } from './const';\nimport type { FaroErrorBoundaryProps, FaroErrorBoundaryState } from './types';\n\nexport class FaroErrorBoundary extends Component<FaroErrorBoundaryProps, FaroErrorBoundaryState> {\n override state: FaroErrorBoundaryState = faroErrorBoundaryInitialState;\n\n constructor(props: FaroErrorBoundaryProps) {\n super(props);\n\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n }\n\n getErrorWithComponentStack(error: Error, errorInfo: ErrorInfo): Error {\n if (!isReactVersionAtLeast17 || !errorInfo.componentStack) {\n return error;\n }\n\n const newError = new Error(error.message);\n\n newError.name = `React ErrorBoundary ${error.name}`;\n newError.stack = errorInfo.componentStack;\n\n return newError;\n }\n\n static getDerivedStateFromError(error: Error): FaroErrorBoundaryState {\n return {\n hasError: true,\n error,\n };\n }\n\n override componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n const errorWithComponentStack = this.getErrorWithComponentStack(error, errorInfo);\n\n this.props.beforeCapture?.(errorWithComponentStack);\n\n faro.api.pushError(errorWithComponentStack);\n\n this.props.onError?.(errorWithComponentStack);\n\n this.setState({ hasError: true, error });\n }\n\n override componentDidMount(): void {\n this.props.onMount?.();\n }\n\n override componentWillUnmount(): void {\n this.props.onUnmount?.(this.state.error);\n }\n\n resetErrorBoundary(): void {\n this.props.onReset?.(this.state.error);\n\n this.setState(faroErrorBoundaryInitialState);\n }\n\n override render(): ReactNode {\n if (!this.state.hasError) {\n return isFunction(this.props.children) ? this.props.children() : this.props.children;\n }\n\n const element = !isFunction(this.props.fallback)\n ? this.props.fallback\n : this.props.fallback(this.state.error!, this.resetErrorBoundary);\n\n if (isValidElement(element)) {\n return element;\n }\n\n if (this.props.fallback) {\n faro.internalLogger.warn('ErrorBoundary\\n', 'Cannot get a valid ReactElement from \"fallback\"');\n }\n\n return null;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/errorBoundary/const.ts"],"names":[],"mappings":";;;AAEa,QAAA,6BAA6B,GAA2B;IACnE,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;CACH,CAAC"}
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/errorBoundary/const.ts"],"names":[],"mappings":";;;AAEa,QAAA,6BAA6B,GAA2B;IACnE,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;CACH,CAAC","sourcesContent":["import type { FaroErrorBoundaryState } from './types';\n\nexport const faroErrorBoundaryInitialState: FaroErrorBoundaryState = {\n hasError: false,\n error: null,\n} as const;\n"]}
@@ -1 +1 @@
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"}
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,8 +1,8 @@
1
1
  import type { ReactElement, ReactNode } from 'react';
2
2
  import type { Faro } from '@grafana/faro-web-sdk';
3
- export declare type ReactNodeRender = () => ReactNode;
4
- export declare type ReactProps = Record<string, any>;
5
- export declare type FaroErrorBoundaryFallbackRender = (error: Error, resetError: VoidFunction) => ReactElement;
3
+ export type ReactNodeRender = () => ReactNode;
4
+ export type ReactProps = Record<string, any>;
5
+ export type FaroErrorBoundaryFallbackRender = (error: Error, resetError: VoidFunction) => ReactElement;
6
6
  export interface FaroErrorBoundaryProps {
7
7
  faro?: Faro;
8
8
  beforeCapture?: (error: Error | null) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errorBoundary/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errorBoundary/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\n\nimport type { Faro } 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 faro?: Faro;\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}\n\nexport interface FaroErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"withFaroErrorBoundary.js","sourceRoot":"","sources":["../../../src/errorBoundary/withFaroErrorBoundary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oFAA2D;AAG3D,kCAAyC;AACzC,yDAAwD;AAGxD,SAAgB,qBAAqB,CACnC,gBAAkC,EAClC,kBAA0C;;IAE1C,IAAM,oBAAoB,GAAG,MAAA,MAAA,gBAAgB,CAAC,WAAW,mCAAI,gBAAgB,CAAC,IAAI,mCAAI,qBAAa,CAAC;IAEpG,IAAM,SAAS,GAAU,UAAC,qBAAwB,IAAK,OAAA,CACrD,uBAAC,qCAAiB,eAAK,kBAAkB,cACvC,uBAAC,gBAAgB,eAAK,qBAAqB,EAAI,IAC7B,CACrB,EAJsD,CAItD,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,4BAAqB,oBAAoB,MAAG,CAAC;IAErE,IAAA,iCAAoB,EAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAElD,OAAO,SAAS,CAAC;AACnB,CAAC;AAjBD,sDAiBC"}
1
+ {"version":3,"file":"withFaroErrorBoundary.js","sourceRoot":"","sources":["../../../src/errorBoundary/withFaroErrorBoundary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oFAA2D;AAG3D,kCAAyC;AACzC,yDAAwD;AAGxD,SAAgB,qBAAqB,CACnC,gBAAkC,EAClC,kBAA0C;;IAE1C,IAAM,oBAAoB,GAAG,MAAA,MAAA,gBAAgB,CAAC,WAAW,mCAAI,gBAAgB,CAAC,IAAI,mCAAI,qBAAa,CAAC;IAEpG,IAAM,SAAS,GAAU,UAAC,qBAAwB,IAAK,OAAA,CACrD,uBAAC,qCAAiB,eAAK,kBAAkB,cACvC,uBAAC,gBAAgB,eAAK,qBAAqB,EAAI,IAC7B,CACrB,EAJsD,CAItD,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,4BAAqB,oBAAoB,MAAG,CAAC;IAErE,IAAA,iCAAoB,EAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAElD,OAAO,SAAS,CAAC;AACnB,CAAC;AAjBD,sDAiBC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { ComponentType, FC } from 'react';\n\nimport { unknownString } from '../utils';\nimport { FaroErrorBoundary } from './FaroErrorBoundary';\nimport type { FaroErrorBoundaryProps, ReactProps } from './types';\n\nexport function withFaroErrorBoundary<P extends ReactProps = {}>(\n WrappedComponent: ComponentType<P>,\n errorBoundaryProps: FaroErrorBoundaryProps\n): FC<P> {\n const componentDisplayName = WrappedComponent.displayName ?? WrappedComponent.name ?? unknownString;\n\n const Component: FC<P> = (wrappedComponentProps: P) => (\n <FaroErrorBoundary {...errorBoundaryProps}>\n <WrappedComponent {...wrappedComponentProps} />\n </FaroErrorBoundary>\n );\n\n Component.displayName = `faroErrorBoundary(${componentDisplayName})`;\n\n hoistNonReactStatics(Component, WrappedComponent);\n\n return Component;\n}\n"]}
@@ -8,4 +8,4 @@ export type { ReactRouterHistory, ReactRouterLocation, ReactRouterV4V5ActiveEven
8
8
  export type { ReactIntegrationConfig, ReactRouterV4V5Config, ReactRouterV6Config } from './types';
9
9
  export { getMajorReactVersion, isReactVersionAtLeast, isReactVersionAtLeast16, isReactVersionAtLeast17, isReactVersionAtLeast18, reactVersion, reactVersionMajor, } from './utils';
10
10
  export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, browserMeta, buildStackFrame, ConsoleInstrumentation, ConsoleTransport, Conventions, createInternalLogger, createPromiseBuffer, createSession, deepEqual, defaultExceptionType, defaultEventDomain, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, defaultMetas, ErrorsInstrumentation, FetchTransport, getCurrentTimestamp, getDataFromSafariExtensions, getInternalFaroFromGlobalObject, getStackFramesFromError, getTransportBody, getWebInstrumentations, globalObject, initializeFaro, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, InternalLoggerLevel, LogLevel, makeCoreConfig, noop, pageMeta, parseStacktrace, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, WebVitalsInstrumentation, } from '@grafana/faro-web-sdk';
11
- export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BrowserConfig, Config, ConsoleInstrumentationOptions, ConsoleTransportOptions, ErrorEvent, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, ExtendedPromiseRejectionEvent, FetchTransportOptions, FetchTransportRequestOptions, GlobalObject, Instrumentation, InstrumentationLibrarySpan, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, OTELApi, Patterns, PushErrorOptions, PushLogOptions, PushMeasurementOptions, ResourceSpan, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, } from '@grafana/faro-web-sdk';
11
+ export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BrowserConfig, Config, ConsoleInstrumentationOptions, ConsoleTransportOptions, ErrorEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, ExtendedPromiseRejectionEvent, FetchTransportOptions, FetchTransportRequestOptions, GlobalObject, Instrumentation, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, OTELApi, Patterns, PushErrorOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, } from '@grafana/faro-web-sdk';
@@ -1 +1 @@
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,mCAOkB;AANhB,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,wGAAA,cAAc,OAAA;AACd,4GAAA,kBAAkB,OAAA;AAClB,2HAAA,iCAAiC,OAAA;AACjC,yHAAA,+BAA+B,OAAA;AAsBjC,iCAQiB;AAPf,6GAAA,oBAAoB,OAAA;AACpB,8GAAA,qBAAqB,OAAA;AACrB,gHAAA,uBAAuB,OAAA;AACvB,gHAAA,uBAAuB,OAAA;AACvB,gHAAA,uBAAuB,OAAA;AACvB,qGAAA,YAAY,OAAA;AACZ,0GAAA,iBAAiB,OAAA;AAGnB,sDAwE+B;AAvE7B,oGAAA,IAAI,OAAA;AACJ,4GAAA,YAAY,OAAA;AACZ,6GAAA,aAAa,OAAA;AACb,mHAAA,mBAAmB,OAAA;AACnB,6GAAA,aAAa,OAAA;AACb,2GAAA,WAAW,OAAA;AACX,+GAAA,eAAe,OAAA;AACf,sHAAA,sBAAsB,OAAA;AACtB,gHAAA,gBAAgB,OAAA;AAChB,2GAAA,WAAW,OAAA;AACX,oHAAA,oBAAoB,OAAA;AACpB,mHAAA,m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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,wGAAA,QAAQ,OAAA;AACR,+GAAA,eAAe,OAAA;AACf,6HAAA,6BAA6B,OAAA;AAC7B,iHAAA,iBAAiB,OAAA;AACjB,0HAAA,0BAA0B,OAAA;AAC1B,uGAAA,OAAO,OAAA;AACP,wHAAA,wBAAwB,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 setReactRouterV4V5SSRDependencies,\n setReactRouterV6SSRDependencies,\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 { ReactIntegrationConfig, ReactRouterV4V5Config, ReactRouterV6Config } from './types';\n\nexport {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\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 Conventions,\n createInternalLogger,\n createPromiseBuffer,\n createSession,\n deepEqual,\n defaultExceptionType,\n defaultEventDomain,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n defaultMetas,\n ErrorsInstrumentation,\n FetchTransport,\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 pageMeta,\n parseStacktrace,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n WebVitalsInstrumentation,\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 ConsoleInstrumentationOptions,\n ConsoleTransportOptions,\n ErrorEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n ExtendedPromiseRejectionEvent,\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 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} from '@grafana/faro-web-sdk';\n"]}
@@ -1 +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"}
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","sourcesContent":["import { BaseInstrumentation, VERSION } from '@grafana/faro-web-sdk';\n\nimport { initializeReactRouterInstrumentation } from './router';\nimport type { ReactIntegrationConfig } from './types';\n\nexport class ReactIntegration extends BaseInstrumentation {\n name = '@grafana/faro-react';\n version = VERSION;\n\n constructor(private config: ReactIntegrationConfig = {}) {\n super();\n }\n\n initialize(): void {\n initializeReactRouterInstrumentation(this.config, this.faro);\n }\n}\n"]}
@@ -1 +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,CAAC;IAzDD,sBAAY,2CAAiB;aAA7B;;YACE,OAAO,CAAC,CAAC,CAAA,MAAA,mBAAI,CAAC,GAAG,0CAAE,iBAAiB,EAAE,CAAA,CAAC;QACzC,CAAC;;;OAAA;IAED,sBAAY,8BAAI;aAAhB;;YACE,OAAO,MAAA,mBAAI,CAAC,GAAG,0CAAE,OAAO,EAAG,CAAC;QAC9B,CAAC;;;OAA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7B,CAAC;IACH,mBAAC;AAAD,CAAC,AA1GD,CAAkC,iBAAS,GA0G1C;AA1GY,oCAAY","sourcesContent":["import type { Attributes, Span, Tracer } from '@opentelemetry/api';\nimport { Component } from 'react';\nimport type { ReactNode } from 'react';\n\nimport type { OTELApi } from '@grafana/faro-web-sdk';\nimport { faro, VERSION } from '@grafana/faro-web-sdk';\n\nexport interface FaroProfilerProps {\n children: ReactNode;\n name: string;\n updateProps: Record<string, unknown>;\n}\n\nexport class FaroProfiler extends Component<FaroProfilerProps> {\n protected mountSpan: Span | undefined = undefined;\n protected mountSpanEndTime: number | undefined = undefined;\n protected updateSpan: Span | undefined = undefined;\n\n private get isOtelInitialized(): boolean {\n return !!faro.api?.isOTELInitialized();\n }\n\n private get otel(): OTELApi | undefined {\n return faro.api?.getOTEL()!;\n }\n\n private get tracer(): Tracer {\n return this.otel?.trace.getTracer('@grafana/faro-react', VERSION)!;\n }\n\n private createSpan(\n spanName: string,\n options?: { startTime?: number; endTime?: number; attributes?: Attributes }\n ): Span {\n const span = this.tracer.startSpan(spanName, {\n startTime: options?.startTime,\n attributes: {\n 'react.component.name': this.props.name,\n ...(options?.attributes ?? {}),\n },\n });\n\n this.otel?.trace.setSpan(this.otel.context.active(), span);\n\n if (options?.endTime) {\n span.end(options.endTime);\n }\n\n return span;\n }\n\n private createChildSpan(\n spanName: string,\n parent: Span,\n options?: { startTime?: number; endTime?: number; attributes?: Attributes }\n ): Span {\n let span: Span;\n\n this.otel?.context.with(this.otel.trace.setSpan(this.otel.context.active(), parent), () => {\n span = this.createSpan(spanName, options);\n });\n\n return span!;\n }\n\n constructor(props: FaroProfilerProps) {\n super(props);\n\n if (this.isOtelInitialized) {\n this.mountSpan = this.createSpan('componentMount');\n } else {\n faro.internalLogger?.error(\n 'The Faro React Profiler requires tracing instrumentation. Please enable it in the \"instrumentations\" section of your config.'\n );\n }\n }\n\n override componentDidMount(): void {\n if (this.isOtelInitialized && this.mountSpan) {\n this.mountSpanEndTime = Date.now();\n this.mountSpan.end(this.mountSpanEndTime);\n }\n }\n\n override shouldComponentUpdate({ updateProps }: FaroProfilerProps): boolean {\n if (this.isOtelInitialized && this.mountSpan && updateProps !== this.props.updateProps) {\n const changedProps = Object.keys(updateProps).filter((key) => updateProps[key] !== this.props.updateProps[key]);\n\n if (changedProps.length > 0) {\n this.updateSpan = this.createChildSpan('componentUpdate', this.mountSpan, {\n attributes: {\n 'react.component.changed_props': changedProps,\n },\n });\n }\n }\n\n return true;\n }\n\n override componentDidUpdate(): void {\n if (this.isOtelInitialized && this.updateSpan) {\n this.updateSpan.end();\n this.updateSpan = undefined;\n }\n }\n\n override componentWillUnmount(): void {\n if (this.isOtelInitialized && this.mountSpan) {\n this.createChildSpan('componentRender', this.mountSpan, {\n startTime: this.mountSpanEndTime,\n endTime: Date.now(),\n });\n }\n }\n\n override render(): ReactNode {\n return this.props.children;\n }\n}\n"]}
@@ -1 +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"}
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 +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,G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D,4CAiBC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { ComponentType, FC } from 'react';\n\nimport { unknownString } from '../utils';\nimport { FaroProfiler } from './FaroProfiler';\nimport type { FaroProfilerProps } from './FaroProfiler';\n\nexport function withFaroProfiler<P extends Record<string, any>>(\n WrappedComponent: ComponentType<P>,\n options?: Omit<FaroProfilerProps, 'updateProps'>\n): FC<P> {\n const componentDisplayName = options?.name ?? WrappedComponent.displayName ?? WrappedComponent.name ?? unknownString;\n\n const Component: FC<P> = (props: P) => (\n <FaroProfiler name={componentDisplayName} updateProps={props}>\n <WrappedComponent {...props} />\n </FaroProfiler>\n );\n\n Component.displayName = `faroProfiler(${componentDisplayName})`;\n\n hoistNonReactStatics(Component, WrappedComponent);\n\n return Component;\n}\n"]}
@@ -1 +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"}
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","sourcesContent":["export { initializeReactRouterInstrumentation } from './initialize';\n\nexport { NavigationType, ReactRouterVersion } from './types';\nexport type { ReactRouterLocation, ReactRouterHistory } from './types';\n\nexport { FaroRoute, setReactRouterV4V5SSRDependencies } from './v4v5';\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './v4v5';\n\nexport { FaroRoutes, setReactRouterV6SSRDependencies } from './v6';\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './v6';\n"]}
@@ -1 +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"}
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","sourcesContent":["import type { Faro } from '@grafana/faro-web-sdk';\n\nimport type { ReactIntegrationConfig } from '../types';\nimport { ReactRouterVersion } from './types';\nimport { initializeReactRouterV4V5Instrumentation } from './v4v5';\nimport { initializeReactRouterV6Instrumentation } from './v6';\n\nexport function initializeReactRouterInstrumentation(config: ReactIntegrationConfig, faro: Faro): void {\n switch (config.router?.version) {\n case ReactRouterVersion.V6:\n faro.internalLogger.debug('Initializing React Router V6 instrumentation');\n initializeReactRouterV6Instrumentation(config.router.dependencies, faro);\n break;\n\n case ReactRouterVersion.V5:\n case ReactRouterVersion.V4:\n faro.internalLogger.debug(`Initializing React Router ${config.router.version} instrumentation`);\n initializeReactRouterV4V5Instrumentation(config.router.dependencies, faro);\n break;\n\n default:\n faro.internalLogger.debug('Skipping initialization of React Router instrumentation');\n }\n}\n"]}
@@ -1 +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"}
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","sourcesContent":["export interface ReactRouterLocation<S extends any = unknown> {\n hash: string;\n key: string;\n pathname: string;\n search: string;\n state: S;\n}\n\nexport interface ReactRouterHistory extends Record<string, any> {\n listen?: (cb: (location: ReactRouterLocation, action: NavigationType) => void) => void;\n location?: ReactRouterLocation;\n}\n\nexport enum ReactRouterVersion {\n V4 = 'v4',\n V5 = 'v5',\n V6 = 'v6',\n}\n\nexport enum NavigationType {\n Pop = 'POP',\n Push = 'PUSH',\n Replace = 'REPLACE',\n}\n"]}
@@ -1 +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"}
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","sourcesContent":["import { setActiveEventRoute } from './activeEvent';\nimport { Route } from './dependencies';\nimport type { ReactRouterV4V5RouteProps } from './types';\n\nexport function FaroRoute(props: ReactRouterV4V5RouteProps) {\n if (props?.computedMatch?.isExact) {\n setActiveEventRoute(props.computedMatch.path);\n }\n\n return <Route {...props} />;\n}\n"]}
@@ -1 +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"}
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","sourcesContent":["import { faro } from './dependencies';\nimport type { ReactRouterV4V5ActiveEvent } from './types';\n\nexport let activeEvent: ReactRouterV4V5ActiveEvent | undefined = undefined;\n\nexport function createNewActiveEvent(url: string): ReactRouterV4V5ActiveEvent {\n activeEvent = {\n url,\n route: '',\n };\n\n return activeEvent;\n}\n\nexport function setActiveEventRoute(route: string): void {\n if (activeEvent) {\n activeEvent.route = route;\n }\n}\n\nexport function sendActiveEvent(): void {\n faro.api.pushEvent('routeChange', activeEvent, undefined, { skipDedupe: true });\n\n activeEvent = undefined;\n}\n"]}
@@ -1 +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"}
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","sourcesContent":["import type { Faro } from '@grafana/faro-web-sdk';\n\nimport type { ReactRouterHistory } from '../types';\nimport type { ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';\n\nexport let isInitialized = false;\nexport let faro: Faro;\nexport let history: ReactRouterHistory;\nexport let Route: ReactRouterV4V5RouteShape;\n\nexport function setDependencies(dependencies: ReactRouterV4V5Dependencies, newFaro: Faro): void {\n isInitialized = true;\n\n faro = newFaro;\n history = dependencies.history;\n Route = dependencies.Route;\n}\n\nexport function setReactRouterV4V5SSRDependencies(newDependencies: Pick<ReactRouterV4V5Dependencies, 'Route'>): void {\n Route = newDependencies.Route;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v4v5/index.ts"],"names":[],"mappings":";;;AAAA,+CAAmE;AAA1D,iIAAA,iCAAiC,OAAA;AAE1C,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,2CAAwE;AAA/D,sIAAA,wCAAwC,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v4v5/index.ts"],"names":[],"mappings":";;;AAAA,+CAAmE;AAA1D,iIAAA,iCAAiC,OAAA;AAE1C,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAElB,2CAAwE;AAA/D,sIAAA,wCAAwC,OAAA","sourcesContent":["export { setReactRouterV4V5SSRDependencies } from './dependencies';\n\nexport { FaroRoute } from './FaroRoute';\n\nexport { initializeReactRouterV4V5Instrumentation } from './initialize';\n\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/router/v4v5/initialize.ts"],"names":[],"mappings":";;;;;;AAAA,oFAA2D;AAG3D,sDAAqD;AAGrD,kCAA0C;AAC1C,6CAAsE;AACtE,+CAAiD;AACjD,yCAAwC;AAGxC,SAAgB,wCAAwC,CAAC,YAAyC,EAAE,IAAU;;IAC5G,IAAM,KAAK,GAAG,YAAY,CAAC,KAA0B,CAAC;IACtD,IAAM,oBAAoB,GAAG,MAAA,KAAK,CAAC,WAAW,mCAAI,KAAK,CAAC,IAAI,CAAC;IAC5D,qBAA+B,CAAC,WAAW,GAAG,oBAAa,oBAAoB,MAAG,CAAC;IACpF,IAAA,iCAAoB,EAAC,qBAAS,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IAAI,MAAM,KAAK,sBAAc,CAAC,GAAG,EAAE;YACnE,IAAA,6BAAe,GAAE,CAAC;YAElB,IAAA,kCAAoB,EAAC,MAAA,2BAAY,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC;SACnD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,4FAiBC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { FunctionComponent } from 'react';\n\nimport { globalObject } from '@grafana/faro-web-sdk';\nimport type { Faro } from '@grafana/faro-web-sdk';\n\nimport { NavigationType } from '../types';\nimport { createNewActiveEvent, sendActiveEvent } from './activeEvent';\nimport { setDependencies } from './dependencies';\nimport { FaroRoute } from './FaroRoute';\nimport type { ReactRouterV4V5Dependencies } from './types';\n\nexport function initializeReactRouterV4V5Instrumentation(dependencies: ReactRouterV4V5Dependencies, faro: Faro): void {\n const Route = dependencies.Route as FunctionComponent;\n const componentDisplayName = Route.displayName ?? Route.name;\n (FaroRoute as FunctionComponent).displayName = `faroRoute(${componentDisplayName})`;\n hoistNonReactStatics(FaroRoute, Route);\n\n setDependencies(dependencies, faro);\n\n createNewActiveEvent(globalObject.location?.href);\n\n dependencies.history.listen?.((_location, action) => {\n if (action === NavigationType.Push || action === NavigationType.Pop) {\n sendActiveEvent();\n\n createNewActiveEvent(globalObject.location?.href);\n }\n });\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ReactRouterHistory } from '../types';
2
- export declare type ReactRouterV4V5RouteShape = any;
2
+ export type ReactRouterV4V5RouteShape = any;
3
3
  export interface ReactRouterV4V5RouteProps extends Record<string, any> {
4
4
  computedMatch?: {
5
5
  isExact: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v4v5/types.ts"],"names":[],"mappings":""}
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 url: string;\n route: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FaroRoutes.js","sourceRoot":"","sources":["../../../../src/router/v6/FaroRoutes.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+BAA2C;AAE3C,sDAAqD;AAErD,kCAA0C;AAC1C,+CAAuH;AAEvH,iCAA+C;AAE/C,SAAgB,UAAU,CAAC,KAA+B;;IACxD,IAAM,QAAQ,GAAG,0BAAW,aAAX,0BAAW,2BAAX,0BAAW,GAAI,CAAC;IACjC,IAAM,cAAc,GAAG,gCAAiB,aAAjB,gCAAiB,2BAAjB,gCAAiB,GAAI,CAAC;IAE7C,IAAM,MAAM,GAAG,IAAA,eAAO,EAAC,sBAAM,OAAA,MAAA,uCAAwB,aAAxB,uCAAwB,2BAAxB,uCAAwB,EAAG,KAAK,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAA,EAAA,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjG,IAAA,iBAAS,EAAC;;QACR,IAAI,4BAAa,IAAI,CAAC,cAAc,KAAK,sBAAc,CAAC,IAAI,IAAI,cAAc,KAAK,sBAAc,CAAC,GAAG,CAAC,EAAE;YACtG,mBAAI,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE;gBAChC,GAAG,EAAE,MAAA,2BAAY,CAAC,QAAQ,0CAAE,IAAI;gBAChC,KAAK,EAAE,IAAA,4BAAoB,EAAC,MAAM,EAAE,QAAQ,CAAC;aAC9C,CAAC,CAAC;SACJ;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,CAAC,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BAAC,YAAY,eAAK,KAAK,EAAI,CAAC;AACrC,CAAC;AAlBD,gCAkBC","sourcesContent":["import { useEffect, useMemo } from 'react';\n\nimport { globalObject } from '@grafana/faro-web-sdk';\n\nimport { NavigationType } from '../types';\nimport { createRoutesFromChildren, faro, isInitialized, Routes, useLocation, useNavigationType } from './dependencies';\nimport type { ReactRouterV6RoutesProps } from './types';\nimport { getRouteFromLocation } from './utils';\n\nexport function FaroRoutes(props: ReactRouterV6RoutesProps) {\n const location = useLocation?.();\n const navigationType = useNavigationType?.();\n\n const routes = useMemo(() => createRoutesFromChildren?.(props.children) ?? [], [props.children]);\n\n useEffect(() => {\n if (isInitialized && (navigationType === NavigationType.Push || navigationType === NavigationType.Pop)) {\n faro.api.pushEvent('routeChange', {\n url: globalObject.location?.href,\n route: getRouteFromLocation(routes, location),\n });\n }\n }, [location, navigationType, routes]);\n\n const ActualRoutes = props.routesComponent ?? Routes;\n\n return <ActualRoutes {...props} />;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/router/v6/dependencies.ts"],"names":[],"mappings":";;;AAWW,QAAA,aAAa,GAAG,KAAK,CAAC;AAQjC,SAAgB,eAAe,CAAC,eAA0C,EAAE,OAAa;IACvF,qBAAa,GAAG,IAAI,CAAC;IAErB,YAAI,GAAG,OAAO,CAAC;IACf,gCAAwB,GAAG,eAAe,CAAC,wBAAwB,CAAC;IACpE,mBAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,cAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAChC,mBAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,yBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC;AACxD,CAAC;AATD,0CASC;AAED,SAAgB,+BAA+B,CAAC,eAA0D;IACxG,cAAM,GAAG,eAAe,CAAC,MAAM,CAAC;AAClC,CAAC;AAFD,0EAEC"}
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/router/v6/dependencies.ts"],"names":[],"mappings":";;;AAWW,QAAA,aAAa,GAAG,KAAK,CAAC;AAQjC,SAAgB,eAAe,CAAC,eAA0C,EAAE,OAAa;IACvF,qBAAa,GAAG,IAAI,CAAC;IAErB,YAAI,GAAG,OAAO,CAAC;IACf,gCAAwB,GAAG,eAAe,CAAC,wBAAwB,CAAC;IACpE,mBAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,cAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAChC,mBAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,yBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC;AACxD,CAAC;AATD,0CASC;AAED,SAAgB,+BAA+B,CAAC,eAA0D;IACxG,cAAM,GAAG,eAAe,CAAC,MAAM,CAAC;AAClC,CAAC;AAFD,0EAEC","sourcesContent":["import type { Faro } from '@grafana/faro-web-sdk';\n\nimport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './types';\n\nexport let isInitialized = false;\nexport let faro: Faro;\nexport let createRoutesFromChildren: ReactRouterV6CreateRoutesFromChildren;\nexport let matchRoutes: ReactRouterV6MatchRoutes;\nexport let Routes: ReactRouterV6RoutesShape;\nexport let useLocation: ReactRouterV6UseLocation;\nexport let useNavigationType: ReactRouterV6UseNavigationType;\n\nexport function setDependencies(newDependencies: ReactRouterV6Dependencies, newFaro: Faro): void {\n isInitialized = true;\n\n faro = newFaro;\n createRoutesFromChildren = newDependencies.createRoutesFromChildren;\n matchRoutes = newDependencies.matchRoutes;\n Routes = newDependencies.Routes;\n useLocation = newDependencies.useLocation;\n useNavigationType = newDependencies.useNavigationType;\n}\n\nexport function setReactRouterV6SSRDependencies(newDependencies: Pick<ReactRouterV6Dependencies, 'Routes'>): void {\n Routes = newDependencies.Routes;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v6/index.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAAxD,+HAAA,+BAA+B,OAAA;AAExC,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,2CAAsE;AAA7D,oIAAA,sCAAsC,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v6/index.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAAxD,+HAAA,+BAA+B,OAAA;AAExC,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,2CAAsE;AAA7D,oIAAA,sCAAsC,OAAA","sourcesContent":["export { setReactRouterV6SSRDependencies } from './dependencies';\n\nexport { FaroRoutes } from './FaroRoutes';\n\nexport { initializeReactRouterV6Instrumentation } from './initialize';\n\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/router/v6/initialize.ts"],"names":[],"mappings":";;;;;;AAAA,oFAA2D;AAI3D,+CAAiD;AACjD,2CAA0C;AAG1C,SAAgB,sCAAsC,CAAC,YAAuC,EAAE,IAAU;IACxG,IAAA,iCAAoB,EAAC,uBAAU,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAEtD,IAAA,8BAAe,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAJD,wFAIC"}
1
+ {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/router/v6/initialize.ts"],"names":[],"mappings":";;;;;;AAAA,oFAA2D;AAI3D,+CAAiD;AACjD,2CAA0C;AAG1C,SAAgB,sCAAsC,CAAC,YAAuC,EAAE,IAAU;IACxG,IAAA,iCAAoB,EAAC,uBAAU,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAEtD,IAAA,8BAAe,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAJD,wFAIC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport type { Faro } from '@grafana/faro-web-sdk';\n\nimport { setDependencies } from './dependencies';\nimport { FaroRoutes } from './FaroRoutes';\nimport type { ReactRouterV6Dependencies } from './types';\n\nexport function initializeReactRouterV6Instrumentation(dependencies: ReactRouterV6Dependencies, faro: Faro): void {\n hoistNonReactStatics(FaroRoutes, dependencies.Routes);\n\n setDependencies(dependencies, faro);\n}\n"]}
@@ -12,7 +12,7 @@ export interface ReactRouterV6RoutesProps {
12
12
  location?: Partial<ReactRouterLocation> | string;
13
13
  routesComponent?: ReactRouterV6RoutesShape;
14
14
  }
15
- export declare type ReactRouterV6Params<Key extends string = string> = {
15
+ export type ReactRouterV6Params<Key extends string = string> = {
16
16
  readonly [key in Key]: string | undefined;
17
17
  };
18
18
  export interface ReactRouterV6RouteMatch<ParamKey extends string = string> {
@@ -21,11 +21,11 @@ export interface ReactRouterV6RouteMatch<ParamKey extends string = string> {
21
21
  pathnameBase: string;
22
22
  route: ReactRouterV6RouteObject;
23
23
  }
24
- export declare type ReactRouterV6CreateRoutesFromChildren = (children: ReactNode) => ReactRouterV6RouteObject[];
25
- export declare type ReactRouterV6MatchRoutes = (routes: ReactRouterV6RouteObject[], location: Partial<ReactRouterLocation> | string, basename?: string) => ReactRouterV6RouteMatch[] | null;
26
- export declare type ReactRouterV6RoutesShape = (props: ReactRouterV6RoutesProps) => ReactElement | null;
27
- export declare type ReactRouterV6UseLocation = () => ReactRouterLocation;
28
- export declare type ReactRouterV6UseNavigationType = () => 'POP' | 'PUSH' | 'REPLACE';
24
+ export type ReactRouterV6CreateRoutesFromChildren = (children: ReactNode) => ReactRouterV6RouteObject[];
25
+ export type ReactRouterV6MatchRoutes = (routes: ReactRouterV6RouteObject[], location: Partial<ReactRouterLocation> | string, basename?: string) => ReactRouterV6RouteMatch[] | null;
26
+ export type ReactRouterV6RoutesShape = (props: ReactRouterV6RoutesProps) => ReactElement | null;
27
+ export type ReactRouterV6UseLocation = () => ReactRouterLocation;
28
+ export type ReactRouterV6UseNavigationType = () => 'POP' | 'PUSH' | 'REPLACE';
29
29
  export interface ReactRouterV6Dependencies {
30
30
  createRoutesFromChildren: ReactRouterV6CreateRoutesFromChildren;
31
31
  matchRoutes: ReactRouterV6MatchRoutes;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v6/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v6/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\n\nimport type { ReactRouterLocation } from '../types';\n\nexport interface ReactRouterV6RouteObject {\n caseSensitive?: boolean;\n children?: ReactRouterV6RouteObject[];\n element?: ReactNode;\n index?: boolean;\n path?: string;\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 = (children: ReactNode) => ReactRouterV6RouteObject[];\n\nexport type ReactRouterV6MatchRoutes = (\n routes: ReactRouterV6RouteObject[],\n location: Partial<ReactRouterLocation> | string,\n basename?: string\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/router/v6/utils.ts"],"names":[],"mappings":";;;AACA,+CAA6C;AAG7C,SAAgB,sBAAsB,CAAC,GAAW;IAChD,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAC,cAAc,IAAK,OAAA,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc,KAAK,GAAG,EAAnD,CAAmD,CAAC,CAAC,MAAM,CAAC;AACnH,CAAC;AAFD,wDAEC;AAED,SAAgB,oBAAoB,CAAC,MAAkC,EAAE,QAA6B;IACpG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QAClC,OAAO,QAAQ,CAAC,QAAQ,CAAC;KAC1B;IAED,IAAM,aAAa,GAAG,IAAA,0BAAW,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEpD,IAAI,WAAW,GAAG,EAAE,CAAC;IAErB,IAAI,aAAa,EAAE;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,IAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAE,CAAC;YACjC,IAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAE3B,IAAI,KAAK,EAAE;gBACT,IAAI,KAAK,CAAC,KAAK,EAAE;oBACf,OAAO,MAAM,CAAC,QAAQ,CAAC;iBACxB;gBAED,IAAI,IAAI,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E,EAAE;YAC7C,IAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAE,CAAC;YACjC,IAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAE3B,IAAI,KAAK,EAAE;gBACT,IAAI,KAAK,CAAC,KAAK,EAAE;oBACf,OAAO,MAAM,CAAC,QAAQ,CAAC;iBACxB;gBAED,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;gBAEtB,IAAI,IAAI,EAAE;oBACR,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAI,IAAI,CAAE,CAAC;oBAEhD,WAAW,IAAI,IAAI,CAAC;oBAEpB,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,EAAE;wBACzC,IAAI,sBAAsB,CAAC,WAAW,CAAC,KAAK,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;4BACnF,OAAO,IAAI,CAAC;yBACb;wBAED,OAAO,WAAW,CAAC;qBACpB;iBACF;aACF;SACF;KACF;IAED,OAAO,QAAQ,CAAC,QAAQ,CAAC;AAC3B,CAAC;AAvCD,oDAuCC","sourcesContent":["import type { ReactRouterLocation } from '../types';\nimport { matchRoutes } from './dependencies';\nimport type { ReactRouterV6RouteObject } from './types';\n\nexport function getNumberOfUrlSegments(url: string): number {\n return url.split(/\\\\?\\//).filter((currentSegment) => currentSegment.length > 0 && currentSegment !== ',').length;\n}\n\nexport function getRouteFromLocation(routes: ReactRouterV6RouteObject[], location: ReactRouterLocation): string {\n if (!routes || routes.length === 0) {\n return location.pathname;\n }\n\n const matchedRoutes = matchRoutes(routes, location);\n\n let pathBuilder = '';\n\n if (matchedRoutes) {\n for (let x = 0; x < matchedRoutes.length; x++) {\n const branch = matchedRoutes[x]!;\n const route = branch.route;\n\n if (route) {\n if (route.index) {\n return branch.pathname;\n }\n\n let path = route.path;\n\n if (path) {\n path = path.startsWith('/') ? path : `/${path}`;\n\n pathBuilder += path;\n\n if (branch.pathname === location.pathname) {\n if (getNumberOfUrlSegments(pathBuilder) !== getNumberOfUrlSegments(branch.pathname)) {\n return path;\n }\n\n return pathBuilder;\n }\n }\n }\n }\n }\n\n return location.pathname;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactRouterV4V5Dependencies, ReactRouterV6Dependencies, ReactRouterVersion } 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 ReactIntegrationConfig {\n router?: ReactRouterV4V5Config | ReactRouterV6Config;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/utils/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/utils/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,SAAS,CAAC","sourcesContent":["export const unknownString = 'unknown';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AAEtB,+CAQwB;AAPtB,oHAAA,oBAAoB,OAAA;AACpB,qHAAA,qBAAqB,OAAA;AACrB,uHAAA,uBAAuB,OAAA;AACvB,uHAAA,uBAAuB,OAAA;AACvB,uHAAA,uBAAuB,OAAA;AACvB,4GAAA,YAAY,OAAA;AACZ,iHAAA,iBAAiB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AAEtB,+CAQwB;AAPtB,oHAAA,oBAAoB,OAAA;AACpB,qHAAA,qBAAqB,OAAA;AACrB,uHAAA,uBAAuB,OAAA;AACvB,uHAAA,uBAAuB,OAAA;AACvB,uHAAA,uBAAuB,OAAA;AACvB,4GAAA,YAAY,OAAA;AACZ,iHAAA,iBAAiB,OAAA","sourcesContent":["export { unknownString } from './const';\n\nexport {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\n reactVersion,\n reactVersionMajor,\n} from './reactVersion';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reactVersion.js","sourceRoot":"","sources":["../../../src/utils/reactVersion.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEnB,QAAA,YAAY,GAAG,eAAO,CAAC;AACvB,QAAA,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;AAC3C,QAAA,uBAAuB,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,uBAAuB,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,uBAAuB,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAC;AAEjE,SAAgB,oBAAoB;IAClC,IAAM,KAAK,GAAG,oBAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtC,IAAI;QACF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KACjD;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AARD,oDAQC;AAED,SAAgB,qBAAqB,CAAC,OAAe;IACnD,OAAO,yBAAiB,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,yBAAiB,IAAI,OAAO,CAAC;AAC3E,CAAC;AAFD,sDAEC"}
1
+ {"version":3,"file":"reactVersion.js","sourceRoot":"","sources":["../../../src/utils/reactVersion.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEnB,QAAA,YAAY,GAAG,eAAO,CAAC;AACvB,QAAA,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;AAC3C,QAAA,uBAAuB,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,uBAAuB,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,uBAAuB,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAC;AAEjE,SAAgB,oBAAoB;IAClC,IAAM,KAAK,GAAG,oBAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtC,IAAI;QACF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KACjD;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AARD,oDAQC;AAED,SAAgB,qBAAqB,CAAC,OAAe;IACnD,OAAO,yBAAiB,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,yBAAiB,IAAI,OAAO,CAAC;AAC3E,CAAC;AAFD,sDAEC","sourcesContent":["import { version } from 'react';\n\nexport const reactVersion = version;\nexport const reactVersionMajor = getMajorReactVersion();\nexport const isReactVersionAtLeast18 = isReactVersionAtLeast(18);\nexport const isReactVersionAtLeast17 = isReactVersionAtLeast(17);\nexport const isReactVersionAtLeast16 = isReactVersionAtLeast(16);\n\nexport function getMajorReactVersion(): number | null {\n const major = reactVersion.split('.');\n\n try {\n return major[0] ? parseInt(major[0], 10) : null;\n } catch (err) {\n return null;\n }\n}\n\nexport function isReactVersionAtLeast(version: number): boolean {\n return reactVersionMajor === null ? false : reactVersionMajor >= version;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FaroErrorBoundary.js","sourceRoot":"","sources":["../../../src/errorBoundary/FaroErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAGxD,MAAM,OAAO,iBAAkB,SAAQ,SAAyD;IAG9F,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHN,UAAK,GAA2B,6BAA6B,CAAC;QAKrE,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,0BAA0B,CAAC,KAAY,EAAE,SAAoB;QAC3D,IAAI,CAAC,uBAAuB,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YACzD,OAAO,KAAK,CAAC;SACd;QAED,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE1C,QAAQ,CAAC,IAAI,GAAG,uBAAuB,KAAK,CAAC,IAAI,EAAE,CAAC;QACpD,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC,cAAc,CAAC;QAE1C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,KAAK;SACN,CAAC;IACJ,CAAC;IAEQ,iBAAiB,CAAC,KAAY,EAAE,SAAoB;;QAC3D,MAAM,uBAAuB,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,SAAS,CAAC,CA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K,CAAC,QAAQ;YACrB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEpE,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE;YAC3B,OAAO,OAAO,CAAC;SAChB;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,iDAAiD,CAAC,CAAC;SAChG;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import { Component, isValidElement } from 'react';\nimport type { ErrorInfo, ReactNode } from 'react';\n\nimport { faro, isFunction } from '@grafana/faro-web-sdk';\n\nimport { isReactVersionAtLeast17 } from '../utils';\nimport { faroErrorBoundaryInitialState } from './const';\nimport type { FaroErrorBoundaryProps, FaroErrorBoundaryState } from './types';\n\nexport class FaroErrorBoundary extends Component<FaroErrorBoundaryProps, FaroErrorBoundaryState> {\n override state: FaroErrorBoundaryState = faroErrorBoundaryInitialState;\n\n constructor(props: FaroErrorBoundaryProps) {\n super(props);\n\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n }\n\n getErrorWithComponentStack(error: Error, errorInfo: ErrorInfo): Error {\n if (!isReactVersionAtLeast17 || !errorInfo.componentStack) {\n return error;\n }\n\n const newError = new Error(error.message);\n\n newError.name = `React ErrorBoundary ${error.name}`;\n newError.stack = errorInfo.componentStack;\n\n return newError;\n }\n\n static getDerivedStateFromError(error: Error): FaroErrorBoundaryState {\n return {\n hasError: true,\n error,\n };\n }\n\n override componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n const errorWithComponentStack = this.getErrorWithComponentStack(error, errorInfo);\n\n this.props.beforeCapture?.(errorWithComponentStack);\n\n faro.api.pushError(errorWithComponentStack);\n\n this.props.onError?.(errorWithComponentStack);\n\n this.setState({ hasError: true, error });\n }\n\n override componentDidMount(): void {\n this.props.onMount?.();\n }\n\n override componentWillUnmount(): void {\n this.props.onUnmount?.(this.state.error);\n }\n\n resetErrorBoundary(): void {\n this.props.onReset?.(this.state.error);\n\n this.setState(faroErrorBoundaryInitialState);\n }\n\n override render(): ReactNode {\n if (!this.state.hasError) {\n return isFunction(this.props.children) ? this.props.children() : this.props.children;\n }\n\n const element = !isFunction(this.props.fallback)\n ? this.props.fallback\n : this.props.fallback(this.state.error!, this.resetErrorBoundary);\n\n if (isValidElement(element)) {\n return element;\n }\n\n if (this.props.fallback) {\n faro.internalLogger.warn('ErrorBoundary\\n', 'Cannot get a valid ReactElement from \"fallback\"');\n }\n\n return null;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/errorBoundary/const.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAA2B;IACnE,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;CACH,CAAC"}
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/errorBoundary/const.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAA2B;IACnE,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;CACH,CAAC","sourcesContent":["import type { FaroErrorBoundaryState } from './types';\n\nexport const faroErrorBoundaryInitialState: FaroErrorBoundaryState = {\n hasError: false,\n error: null,\n} as const;\n"]}
@@ -1 +1 @@
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"}
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,8 +1,8 @@
1
1
  import type { ReactElement, ReactNode } from 'react';
2
2
  import type { Faro } from '@grafana/faro-web-sdk';
3
- export declare type ReactNodeRender = () => ReactNode;
4
- export declare type ReactProps = Record<string, any>;
5
- export declare type FaroErrorBoundaryFallbackRender = (error: Error, resetError: VoidFunction) => ReactElement;
3
+ export type ReactNodeRender = () => ReactNode;
4
+ export type ReactProps = Record<string, any>;
5
+ export type FaroErrorBoundaryFallbackRender = (error: Error, resetError: VoidFunction) => ReactElement;
6
6
  export interface FaroErrorBoundaryProps {
7
7
  faro?: Faro;
8
8
  beforeCapture?: (error: Error | null) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errorBoundary/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errorBoundary/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\n\nimport type { Faro } 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 faro?: Faro;\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}\n\nexport interface FaroErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"withFaroErrorBoundary.js","sourceRoot":"","sources":["../../../src/errorBoundary/withFaroErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,UAAU,qBAAqB,CACnC,gBAAkC,EAClC,kBAA0C;;IAE1C,MAAM,oBAAoB,GAAG,MAAA,MAAA,gBAAgB,CAAC,WAAW,mCAAI,gBAAgB,CAAC,IAAI,mCAAI,aAAa,CAAC;IAEpG,MAAM,SAAS,GAAU,CAAC,qBAAwB,EAAE,EAAE,CAAC,CACrD,KAAC,iBAAiB,oBAAK,kBAAkB,cACvC,KAAC,gBAAgB,oBAAK,qBAAqB,EAAI,IAC7B,CACrB,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,qBAAqB,oBAAoB,GAAG,CAAC;IAErE,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAElD,OAAO,SAAS,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"withFaroErrorBoundary.js","sourceRoot":"","sources":["../../../src/errorBoundary/withFaroErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,UAAU,qBAAqB,CACnC,gBAAkC,EAClC,kBAA0C;;IAE1C,MAAM,oBAAoB,GAAG,MAAA,MAAA,gBAAgB,CAAC,WAAW,mCAAI,gBAAgB,CAAC,IAAI,mCAAI,aAAa,CAAC;IAEpG,MAAM,SAAS,GAAU,CAAC,qBAAwB,EAAE,EAAE,CAAC,CACrD,KAAC,iBAAiB,oBAAK,kBAAkB,cACvC,KAAC,gBAAgB,oBAAK,qBAAqB,EAAI,IAC7B,CACrB,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,qBAAqB,oBAAoB,GAAG,CAAC;IAErE,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAElD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { ComponentType, FC } from 'react';\n\nimport { unknownString } from '../utils';\nimport { FaroErrorBoundary } from './FaroErrorBoundary';\nimport type { FaroErrorBoundaryProps, ReactProps } from './types';\n\nexport function withFaroErrorBoundary<P extends ReactProps = {}>(\n WrappedComponent: ComponentType<P>,\n errorBoundaryProps: FaroErrorBoundaryProps\n): FC<P> {\n const componentDisplayName = WrappedComponent.displayName ?? WrappedComponent.name ?? unknownString;\n\n const Component: FC<P> = (wrappedComponentProps: P) => (\n <FaroErrorBoundary {...errorBoundaryProps}>\n <WrappedComponent {...wrappedComponentProps} />\n </FaroErrorBoundary>\n );\n\n Component.displayName = `faroErrorBoundary(${componentDisplayName})`;\n\n hoistNonReactStatics(Component, WrappedComponent);\n\n return Component;\n}\n"]}
@@ -8,4 +8,4 @@ export type { ReactRouterHistory, ReactRouterLocation, ReactRouterV4V5ActiveEven
8
8
  export type { ReactIntegrationConfig, ReactRouterV4V5Config, ReactRouterV6Config } from './types';
9
9
  export { getMajorReactVersion, isReactVersionAtLeast, isReactVersionAtLeast16, isReactVersionAtLeast17, isReactVersionAtLeast18, reactVersion, reactVersionMajor, } from './utils';
10
10
  export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, browserMeta, buildStackFrame, ConsoleInstrumentation, ConsoleTransport, Conventions, createInternalLogger, createPromiseBuffer, createSession, deepEqual, defaultExceptionType, defaultEventDomain, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, defaultMetas, ErrorsInstrumentation, FetchTransport, getCurrentTimestamp, getDataFromSafariExtensions, getInternalFaroFromGlobalObject, getStackFramesFromError, getTransportBody, getWebInstrumentations, globalObject, initializeFaro, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, InternalLoggerLevel, LogLevel, makeCoreConfig, noop, pageMeta, parseStacktrace, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, WebVitalsInstrumentation, } from '@grafana/faro-web-sdk';
11
- export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BrowserConfig, Config, ConsoleInstrumentationOptions, ConsoleTransportOptions, ErrorEvent, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, ExtendedPromiseRejectionEvent, FetchTransportOptions, FetchTransportRequestOptions, GlobalObject, Instrumentation, InstrumentationLibrarySpan, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, OTELApi, Patterns, PushErrorOptions, PushLogOptions, PushMeasurementOptions, ResourceSpan, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, } from '@grafana/faro-web-sdk';
11
+ export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BrowserConfig, Config, ConsoleInstrumentationOptions, ConsoleTransportOptions, ErrorEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, ExtendedPromiseRejectionEvent, FetchTransportOptions, FetchTransportRequestOptions, GlobalObject, Instrumentation, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, OTELApi, Patterns, PushErrorOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, } from '@grafana/faro-web-sdk';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,UAAU,CAAC;AAqBlB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,4BAA4B,EAC5B,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,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,QAAQ,EACR,eAAe,EACf,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,OAAO,EACP,wBAAwB,GACzB,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,UAAU,CAAC;AAqBlB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,4BAA4B,EAC5B,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,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,QAAQ,EACR,eAAe,EACf,6BAA6B,EAC7B,iBAAiB,EACjB,0BAA0B,EAC1B,OAAO,EACP,wBAAwB,GACzB,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 setReactRouterV4V5SSRDependencies,\n setReactRouterV6SSRDependencies,\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 { ReactIntegrationConfig, ReactRouterV4V5Config, ReactRouterV6Config } from './types';\n\nexport {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\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 Conventions,\n createInternalLogger,\n createPromiseBuffer,\n createSession,\n deepEqual,\n defaultExceptionType,\n defaultEventDomain,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogLevel,\n defaultMetas,\n ErrorsInstrumentation,\n FetchTransport,\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 pageMeta,\n parseStacktrace,\n setInternalFaroOnGlobalObject,\n TransportItemType,\n transportItemTypeToBodyKey,\n VERSION,\n WebVitalsInstrumentation,\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 ConsoleInstrumentationOptions,\n ConsoleTransportOptions,\n ErrorEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n ExtendedPromiseRejectionEvent,\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 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} from '@grafana/faro-web-sdk';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AAGhE,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IAIvD,YAAoB,SAAiC,EAAE;QACrD,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAA6B;QAHvD,SAAI,GAAG,qBAAqB,CAAC;QAC7B,YAAO,GAAG,OAAO,CAAC;IAIlB,CAAC;IAED,UAAU;QACR,oCAAoC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;CACF"}
1
+ {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AAGhE,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IAIvD,YAAoB,SAAiC,EAAE;QACrD,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAA6B;QAHvD,SAAI,GAAG,qBAAqB,CAAC;QAC7B,YAAO,GAAG,OAAO,CAAC;IAIlB,CAAC;IAED,UAAU;QACR,oCAAoC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;CACF","sourcesContent":["import { BaseInstrumentation, VERSION } from '@grafana/faro-web-sdk';\n\nimport { initializeReactRouterInstrumentation } from './router';\nimport type { ReactIntegrationConfig } from './types';\n\nexport class ReactIntegration extends BaseInstrumentation {\n name = '@grafana/faro-react';\n version = VERSION;\n\n constructor(private config: ReactIntegrationConfig = {}) {\n super();\n }\n\n initialize(): void {\n initializeReactRouterInstrumentation(this.config, this.faro);\n }\n}\n"]}
@@ -1,19 +1,6 @@
1
1
  import { Component } from 'react';
2
2
  import { faro, VERSION } from '@grafana/faro-web-sdk';
3
3
  export class FaroProfiler extends Component {
4
- constructor(props) {
5
- var _a;
6
- super(props);
7
- this.mountSpan = undefined;
8
- this.mountSpanEndTime = undefined;
9
- this.updateSpan = undefined;
10
- if (this.isOtelInitialized) {
11
- this.mountSpan = this.createSpan('componentMount');
12
- }
13
- else {
14
- (_a = 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.');
15
- }
16
- }
17
4
  get isOtelInitialized() {
18
5
  var _a;
19
6
  return !!((_a = faro.api) === null || _a === void 0 ? void 0 : _a.isOTELInitialized());
@@ -46,6 +33,19 @@ export class FaroProfiler extends Component {
46
33
  });
47
34
  return span;
48
35
  }
36
+ constructor(props) {
37
+ var _a;
38
+ super(props);
39
+ this.mountSpan = undefined;
40
+ this.mountSpanEndTime = undefined;
41
+ this.updateSpan = undefined;
42
+ if (this.isOtelInitialized) {
43
+ this.mountSpan = this.createSpan('componentMount');
44
+ }
45
+ else {
46
+ (_a = 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.');
47
+ }
48
+ }
49
49
  componentDidMount() {
50
50
  if (this.isOtelInitialized && this.mountSpan) {
51
51
  this.mountSpanEndTime = Date.now();
@@ -1 +1 @@
1
- {"version":3,"file":"FaroProfiler.js","sourceRoot":"","sources":["../../../src/profiler/FaroProfiler.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,OAAO,YAAa,SAAQ,SAA4B;IAoD5D,YAAY,KAAwB;;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QApDL,cAAS,GAAqB,SAAS,CAAC;QACxC,qBAAgB,GAAuB,SAAS,CAAC;QACjD,eAAU,GAAqB,SAAS,CAAC;QAoDjD,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;SACpD;aAAM;YACL,MAAA,IAAI,CAAC,cAAc,0CAAE,KAAK,CACxB,8HAA8H,CAC/H,CAAC;SACH;IACH,CAAC;IAzDD,IAAY,iBAAiB;;Q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elemetry/api';\nimport { Component } from 'react';\nimport type { ReactNode } from 'react';\n\nimport type { OTELApi } from '@grafana/faro-web-sdk';\nimport { faro, VERSION } from '@grafana/faro-web-sdk';\n\nexport interface FaroProfilerProps {\n children: ReactNode;\n name: string;\n updateProps: Record<string, unknown>;\n}\n\nexport class FaroProfiler extends Component<FaroProfilerProps> {\n protected mountSpan: Span | undefined = undefined;\n protected mountSpanEndTime: number | undefined = undefined;\n protected updateSpan: Span | undefined = undefined;\n\n private get isOtelInitialized(): boolean {\n return !!faro.api?.isOTELInitialized();\n }\n\n private get otel(): OTELApi | undefined {\n return faro.api?.getOTEL()!;\n }\n\n private get tracer(): Tracer {\n return this.otel?.trace.getTracer('@grafana/faro-react', VERSION)!;\n }\n\n private createSpan(\n spanName: string,\n options?: { startTime?: number; endTime?: number; attributes?: Attributes }\n ): Span {\n const span = this.tracer.startSpan(spanName, {\n startTime: options?.startTime,\n attributes: {\n 'react.component.name': this.props.name,\n ...(options?.attributes ?? {}),\n },\n });\n\n this.otel?.trace.setSpan(this.otel.context.active(), span);\n\n if (options?.endTime) {\n span.end(options.endTime);\n }\n\n return span;\n }\n\n private createChildSpan(\n spanName: string,\n parent: Span,\n options?: { startTime?: number; endTime?: number; attributes?: Attributes }\n ): Span {\n let span: Span;\n\n this.otel?.context.with(this.otel.trace.setSpan(this.otel.context.active(), parent), () => {\n span = this.createSpan(spanName, options);\n });\n\n return span!;\n }\n\n constructor(props: FaroProfilerProps) {\n super(props);\n\n if (this.isOtelInitialized) {\n this.mountSpan = this.createSpan('componentMount');\n } else {\n faro.internalLogger?.error(\n 'The Faro React Profiler requires tracing instrumentation. Please enable it in the \"instrumentations\" section of your config.'\n );\n }\n }\n\n override componentDidMount(): void {\n if (this.isOtelInitialized && this.mountSpan) {\n this.mountSpanEndTime = Date.now();\n this.mountSpan.end(this.mountSpanEndTime);\n }\n }\n\n override shouldComponentUpdate({ updateProps }: FaroProfilerProps): boolean {\n if (this.isOtelInitialized && this.mountSpan && updateProps !== this.props.updateProps) {\n const changedProps = Object.keys(updateProps).filter((key) => updateProps[key] !== this.props.updateProps[key]);\n\n if (changedProps.length > 0) {\n this.updateSpan = this.createChildSpan('componentUpdate', this.mountSpan, {\n attributes: {\n 'react.component.changed_props': changedProps,\n },\n });\n }\n }\n\n return true;\n }\n\n override componentDidUpdate(): void {\n if (this.isOtelInitialized && this.updateSpan) {\n this.updateSpan.end();\n this.updateSpan = undefined;\n }\n }\n\n override componentWillUnmount(): void {\n if (this.isOtelInitialized && this.mountSpan) {\n this.createChildSpan('componentRender', this.mountSpan, {\n startTime: this.mountSpanEndTime,\n endTime: Date.now(),\n });\n }\n }\n\n override render(): ReactNode {\n return this.props.children;\n }\n}\n"]}
@@ -1 +1 @@
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"}
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 +1 @@
1
- {"version":3,"file":"withFaroProfiler.js","sourceRoot":"","sources":["../../../src/profiler/withFaroProfiler.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,UAAU,gBAAgB,CAC9B,gBAAkC,EAClC,OAAgD;;IAEhD,MAAM,oBAAo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D,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { ComponentType, FC } from 'react';\n\nimport { unknownString } from '../utils';\nimport { FaroProfiler } from './FaroProfiler';\nimport type { FaroProfilerProps } from './FaroProfiler';\n\nexport function withFaroProfiler<P extends Record<string, any>>(\n WrappedComponent: ComponentType<P>,\n options?: Omit<FaroProfilerProps, 'updateProps'>\n): FC<P> {\n const componentDisplayName = options?.name ?? WrappedComponent.displayName ?? WrappedComponent.name ?? unknownString;\n\n const Component: FC<P> = (props: P) => (\n <FaroProfiler name={componentDisplayName} updateProps={props}>\n <WrappedComponent {...props} />\n </FaroProfiler>\n );\n\n Component.displayName = `faroProfiler(${componentDisplayName})`;\n\n hoistNonReactStatics(Component, WrappedComponent);\n\n return Component;\n}\n"]}
@@ -1 +1 @@
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,EAAE,SAAS,EAAE,iCAAiC,EAAE,MAAM,QAAQ,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,+BAA+B,EAAE,MAAM,MAAM,CAAC"}
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,EAAE,SAAS,EAAE,iCAAiC,EAAE,MAAM,QAAQ,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,+BAA+B,EAAE,MAAM,MAAM,CAAC","sourcesContent":["export { initializeReactRouterInstrumentation } from './initialize';\n\nexport { NavigationType, ReactRouterVersion } from './types';\nexport type { ReactRouterLocation, ReactRouterHistory } from './types';\n\nexport { FaroRoute, setReactRouterV4V5SSRDependencies } from './v4v5';\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './v4v5';\n\nexport { FaroRoutes, setReactRouterV6SSRDependencies } from './v6';\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './v6';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/router/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,wCAAwC,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAE,sCAAsC,EAAE,MAAM,MAAM,CAAC;AAE9D,MAAM,UAAU,oCAAoC,CAAC,MAA8B,EAAE,IAAU;;IAC7F,QAAQ,MAAA,MAAM,CAAC,MAAM,0CAAE,OAAO,EAAE;QAC9B,KAAK,kBAAkB,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAC1E,sCAAsC,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YACzE,MAAM;QAER,KAAK,kBAAkB,CAAC,EAAE,CAAC;QAC3B,KAAK,kBAAkB,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,6BAA6B,MAAM,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;YAChG,wCAAwC,CAAC,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"}
1
+ {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/router/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,wCAAwC,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAE,sCAAsC,EAAE,MAAM,MAAM,CAAC;AAE9D,MAAM,UAAU,oCAAoC,CAAC,MAA8B,EAAE,IAAU;;IAC7F,QAAQ,MAAA,MAAM,CAAC,MAAM,0CAAE,OAAO,EAAE;QAC9B,KAAK,kBAAkB,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAC1E,sCAAsC,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YACzE,MAAM;QAER,KAAK,kBAAkB,CAAC,EAAE,CAAC;QAC3B,KAAK,kBAAkB,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,6BAA6B,MAAM,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;YAChG,wCAAwC,CAAC,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","sourcesContent":["import type { Faro } from '@grafana/faro-web-sdk';\n\nimport type { ReactIntegrationConfig } from '../types';\nimport { ReactRouterVersion } from './types';\nimport { initializeReactRouterV4V5Instrumentation } from './v4v5';\nimport { initializeReactRouterV6Instrumentation } from './v6';\n\nexport function initializeReactRouterInstrumentation(config: ReactIntegrationConfig, faro: Faro): void {\n switch (config.router?.version) {\n case ReactRouterVersion.V6:\n faro.internalLogger.debug('Initializing React Router V6 instrumentation');\n initializeReactRouterV6Instrumentation(config.router.dependencies, faro);\n break;\n\n case ReactRouterVersion.V5:\n case ReactRouterVersion.V4:\n faro.internalLogger.debug(`Initializing React Router ${config.router.version} instrumentation`);\n initializeReactRouterV4V5Instrumentation(config.router.dependencies, faro);\n break;\n\n default:\n faro.internalLogger.debug('Skipping initialization of React Router instrumentation');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/router/types.ts"],"names":[],"mappings":"AAaA,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,+BAAS,CAAA;IACT,+BAAS,CAAA;IACT,+BAAS,CAAA;AACX,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;IACb,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/router/types.ts"],"names":[],"mappings":"AAaA,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,+BAAS,CAAA;IACT,+BAAS,CAAA;IACT,+BAAS,CAAA;AACX,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;IACb,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","sourcesContent":["export interface ReactRouterLocation<S extends any = unknown> {\n hash: string;\n key: string;\n pathname: string;\n search: string;\n state: S;\n}\n\nexport interface ReactRouterHistory extends Record<string, any> {\n listen?: (cb: (location: ReactRouterLocation, action: NavigationType) => void) => void;\n location?: ReactRouterLocation;\n}\n\nexport enum ReactRouterVersion {\n V4 = 'v4',\n V5 = 'v5',\n V6 = 'v6',\n}\n\nexport enum NavigationType {\n Pop = 'POP',\n Push = 'PUSH',\n Replace = 'REPLACE',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FaroRoute.js","sourceRoot":"","sources":["../../../../src/router/v4v5/FaroRoute.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,MAAM,UAAU,SAAS,CAAC,KAAgC;;IACxD,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,0CAAE,OAAO,EAAE;QACjC,mBAAmB,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC/C;IAED,OAAO,KAAC,KAAK,oBAAK,KAAK,EAAI,CAAC;AAC9B,CAAC"}
1
+ {"version":3,"file":"FaroRoute.js","sourceRoot":"","sources":["../../../../src/router/v4v5/FaroRoute.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,MAAM,UAAU,SAAS,CAAC,KAAgC;;IACxD,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,0CAAE,OAAO,EAAE;QACjC,mBAAmB,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC/C;IAED,OAAO,KAAC,KAAK,oBAAK,KAAK,EAAI,CAAC;AAC9B,CAAC","sourcesContent":["import { setActiveEventRoute } from './activeEvent';\nimport { Route } from './dependencies';\nimport type { ReactRouterV4V5RouteProps } from './types';\n\nexport function FaroRoute(props: ReactRouterV4V5RouteProps) {\n if (props?.computedMatch?.isExact) {\n setActiveEventRoute(props.computedMatch.path);\n }\n\n return <Route {...props} />;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"activeEvent.js","sourceRoot":"","sources":["../../../../src/router/v4v5/activeEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGtC,MAAM,CAAC,IAAI,WAAW,GAA2C,SAAS,CAAC;AAE3E,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,WAAW,GAAG;QACZ,GAAG;QACH,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;KAC3B;AACH,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhF,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"activeEvent.js","sourceRoot":"","sources":["../../../../src/router/v4v5/activeEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGtC,MAAM,CAAC,IAAI,WAAW,GAA2C,SAAS,CAAC;AAE3E,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,WAAW,GAAG;QACZ,GAAG;QACH,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;KAC3B;AACH,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhF,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC","sourcesContent":["import { faro } from './dependencies';\nimport type { ReactRouterV4V5ActiveEvent } from './types';\n\nexport let activeEvent: ReactRouterV4V5ActiveEvent | undefined = undefined;\n\nexport function createNewActiveEvent(url: string): ReactRouterV4V5ActiveEvent {\n activeEvent = {\n url,\n route: '',\n };\n\n return activeEvent;\n}\n\nexport function setActiveEventRoute(route: string): void {\n if (activeEvent) {\n activeEvent.route = route;\n }\n}\n\nexport function sendActiveEvent(): void {\n faro.api.pushEvent('routeChange', activeEvent, undefined, { skipDedupe: true });\n\n activeEvent = undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/router/v4v5/dependencies.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,IAAI,aAAa,GAAG,KAAK,CAAC;AACjC,MAAM,CAAC,IAAI,IAAU,CAAC;AACtB,MAAM,CAAC,IAAI,OAA2B,CAAC;AACvC,MAAM,CAAC,IAAI,KAAgC,CAAC;AAE5C,MAAM,UAAU,eAAe,CAAC,YAAyC,EAAE,OAAa;IACtF,aAAa,GAAG,IAAI,CAAC;IAErB,IAAI,GAAG,OAAO,CAAC;IACf,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;IAC/B,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,eAA2D;IAC3G,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;AAChC,CAAC"}
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/router/v4v5/dependencies.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,IAAI,aAAa,GAAG,KAAK,CAAC;AACjC,MAAM,CAAC,IAAI,IAAU,CAAC;AACtB,MAAM,CAAC,IAAI,OAA2B,CAAC;AACvC,MAAM,CAAC,IAAI,KAAgC,CAAC;AAE5C,MAAM,UAAU,eAAe,CAAC,YAAyC,EAAE,OAAa;IACtF,aAAa,GAAG,IAAI,CAAC;IAErB,IAAI,GAAG,OAAO,CAAC;IACf,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;IAC/B,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,eAA2D;IAC3G,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;AAChC,CAAC","sourcesContent":["import type { Faro } from '@grafana/faro-web-sdk';\n\nimport type { ReactRouterHistory } from '../types';\nimport type { ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';\n\nexport let isInitialized = false;\nexport let faro: Faro;\nexport let history: ReactRouterHistory;\nexport let Route: ReactRouterV4V5RouteShape;\n\nexport function setDependencies(dependencies: ReactRouterV4V5Dependencies, newFaro: Faro): void {\n isInitialized = true;\n\n faro = newFaro;\n history = dependencies.history;\n Route = dependencies.Route;\n}\n\nexport function setReactRouterV4V5SSRDependencies(newDependencies: Pick<ReactRouterV4V5Dependencies, 'Route'>): void {\n Route = newDependencies.Route;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v4v5/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,wCAAwC,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v4v5/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,wCAAwC,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { setReactRouterV4V5SSRDependencies } from './dependencies';\n\nexport { FaroRoute } from './FaroRoute';\n\nexport { initializeReactRouterV4V5Instrumentation } from './initialize';\n\nexport type { ReactRouterV4V5ActiveEvent, ReactRouterV4V5Dependencies, ReactRouterV4V5RouteShape } from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/router/v4v5/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,UAAU,wCAAwC,CAAC,YAAyC,EAAE,IAAU;;IAC5G,MAAM,KAAK,GAAG,YAAY,CAAC,KAA0B,CAAC;IACtD,MAAM,oBAAoB,GAAG,MAAA,KAAK,CAAC,WAAW,mCAAI,KAAK,CAAC,IAAI,CAAC;IAC5D,SAA+B,CAAC,WAAW,GAAG,aAAa,oBAAoB,GAAG,CAAC;IACpF,oBAAoB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAEvC,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAEpC,oBAAoB,CAAC,MAAA,YAAY,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC;IAElD,MAAA,MAAA,YAAY,CAAC,OAAO,EAAC,MAAM,mDAAG,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;;QAClD,IAAI,MAAM,KAAK,cAAc,CAAC,IAAI,IAAI,MAAM,KAAK,cAAc,CAAC,GAAG,EAAE;YACnE,eAAe,EAAE,CAAC;YAElB,oBAAoB,CAAC,MAAA,YAAY,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC;SACnD;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/router/v4v5/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,UAAU,wCAAwC,CAAC,YAAyC,EAAE,IAAU;;IAC5G,MAAM,KAAK,GAAG,YAAY,CAAC,KAA0B,CAAC;IACtD,MAAM,oBAAoB,GAAG,MAAA,KAAK,CAAC,WAAW,mCAAI,KAAK,CAAC,IAAI,CAAC;IAC5D,SAA+B,CAAC,WAAW,GAAG,aAAa,oBAAoB,GAAG,CAAC;IACpF,oBAAoB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAEvC,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAEpC,oBAAoB,CAAC,MAAA,YAAY,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC;IAElD,MAAA,MAAA,YAAY,CAAC,OAAO,EAAC,MAAM,mDAAG,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;;QAClD,IAAI,MAAM,KAAK,cAAc,CAAC,IAAI,IAAI,MAAM,KAAK,cAAc,CAAC,GAAG,EAAE;YACnE,eAAe,EAAE,CAAC;YAElB,oBAAoB,CAAC,MAAA,YAAY,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC;SACnD;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { FunctionComponent } from 'react';\n\nimport { globalObject } from '@grafana/faro-web-sdk';\nimport type { Faro } from '@grafana/faro-web-sdk';\n\nimport { NavigationType } from '../types';\nimport { createNewActiveEvent, sendActiveEvent } from './activeEvent';\nimport { setDependencies } from './dependencies';\nimport { FaroRoute } from './FaroRoute';\nimport type { ReactRouterV4V5Dependencies } from './types';\n\nexport function initializeReactRouterV4V5Instrumentation(dependencies: ReactRouterV4V5Dependencies, faro: Faro): void {\n const Route = dependencies.Route as FunctionComponent;\n const componentDisplayName = Route.displayName ?? Route.name;\n (FaroRoute as FunctionComponent).displayName = `faroRoute(${componentDisplayName})`;\n hoistNonReactStatics(FaroRoute, Route);\n\n setDependencies(dependencies, faro);\n\n createNewActiveEvent(globalObject.location?.href);\n\n dependencies.history.listen?.((_location, action) => {\n if (action === NavigationType.Push || action === NavigationType.Pop) {\n sendActiveEvent();\n\n createNewActiveEvent(globalObject.location?.href);\n }\n });\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ReactRouterHistory } from '../types';
2
- export declare type ReactRouterV4V5RouteShape = any;
2
+ export type ReactRouterV4V5RouteShape = any;
3
3
  export interface ReactRouterV4V5RouteProps extends Record<string, any> {
4
4
  computedMatch?: {
5
5
  isExact: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v4v5/types.ts"],"names":[],"mappings":""}
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 url: string;\n route: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FaroRoutes.js","sourceRoot":"","sources":["../../../../src/router/v6/FaroRoutes.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC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AAK,CAAC,eAAe,mCAAI,MAAM,CAAC;IAErD,OAAO,KAAC,YAAY,oBAAK,KAAK,EAAI,CAAC;AACrC,CAAC","sourcesContent":["import { useEffect, useMemo } from 'react';\n\nimport { globalObject } from '@grafana/faro-web-sdk';\n\nimport { NavigationType } from '../types';\nimport { createRoutesFromChildren, faro, isInitialized, Routes, useLocation, useNavigationType } from './dependencies';\nimport type { ReactRouterV6RoutesProps } from './types';\nimport { getRouteFromLocation } from './utils';\n\nexport function FaroRoutes(props: ReactRouterV6RoutesProps) {\n const location = useLocation?.();\n const navigationType = useNavigationType?.();\n\n const routes = useMemo(() => createRoutesFromChildren?.(props.children) ?? [], [props.children]);\n\n useEffect(() => {\n if (isInitialized && (navigationType === NavigationType.Push || navigationType === NavigationType.Pop)) {\n faro.api.pushEvent('routeChange', {\n url: globalObject.location?.href,\n route: getRouteFromLocation(routes, location),\n });\n }\n }, [location, navigationType, routes]);\n\n const ActualRoutes = props.routesComponent ?? Routes;\n\n return <ActualRoutes {...props} />;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/router/v6/dependencies.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,IAAI,aAAa,GAAG,KAAK,CAAC;AACjC,MAAM,CAAC,IAAI,IAAU,CAAC;AACtB,MAAM,CAAC,IAAI,wBAA+D,CAAC;AAC3E,MAAM,CAAC,IAAI,WAAqC,CAAC;AACjD,MAAM,CAAC,IAAI,MAAgC,CAAC;AAC5C,MAAM,CAAC,IAAI,WAAqC,CAAC;AACjD,MAAM,CAAC,IAAI,iBAAiD,CAAC;AAE7D,MAAM,UAAU,eAAe,CAAC,eAA0C,EAAE,OAAa;IACvF,aAAa,GAAG,IAAI,CAAC;IAErB,IAAI,GAAG,OAAO,CAAC;IACf,wBAAwB,GAAG,eAAe,CAAC,wBAAwB,CAAC;IACpE,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAChC,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,eAA0D;IACxG,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/router/v6/dependencies.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,IAAI,aAAa,GAAG,KAAK,CAAC;AACjC,MAAM,CAAC,IAAI,IAAU,CAAC;AACtB,MAAM,CAAC,IAAI,wBAA+D,CAAC;AAC3E,MAAM,CAAC,IAAI,WAAqC,CAAC;AACjD,MAAM,CAAC,IAAI,MAAgC,CAAC;AAC5C,MAAM,CAAC,IAAI,WAAqC,CAAC;AACjD,MAAM,CAAC,IAAI,iBAAiD,CAAC;AAE7D,MAAM,UAAU,eAAe,CAAC,eAA0C,EAAE,OAAa;IACvF,aAAa,GAAG,IAAI,CAAC;IAErB,IAAI,GAAG,OAAO,CAAC;IACf,wBAAwB,GAAG,eAAe,CAAC,wBAAwB,CAAC;IACpE,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAChC,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;IAC1C,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,eAA0D;IACxG,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;AAClC,CAAC","sourcesContent":["import type { Faro } from '@grafana/faro-web-sdk';\n\nimport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './types';\n\nexport let isInitialized = false;\nexport let faro: Faro;\nexport let createRoutesFromChildren: ReactRouterV6CreateRoutesFromChildren;\nexport let matchRoutes: ReactRouterV6MatchRoutes;\nexport let Routes: ReactRouterV6RoutesShape;\nexport let useLocation: ReactRouterV6UseLocation;\nexport let useNavigationType: ReactRouterV6UseNavigationType;\n\nexport function setDependencies(newDependencies: ReactRouterV6Dependencies, newFaro: Faro): void {\n isInitialized = true;\n\n faro = newFaro;\n createRoutesFromChildren = newDependencies.createRoutesFromChildren;\n matchRoutes = newDependencies.matchRoutes;\n Routes = newDependencies.Routes;\n useLocation = newDependencies.useLocation;\n useNavigationType = newDependencies.useNavigationType;\n}\n\nexport function setReactRouterV6SSRDependencies(newDependencies: Pick<ReactRouterV6Dependencies, 'Routes'>): void {\n Routes = newDependencies.Routes;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v6/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,sCAAsC,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/router/v6/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,sCAAsC,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { setReactRouterV6SSRDependencies } from './dependencies';\n\nexport { FaroRoutes } from './FaroRoutes';\n\nexport { initializeReactRouterV6Instrumentation } from './initialize';\n\nexport type {\n ReactRouterV6CreateRoutesFromChildren,\n ReactRouterV6Dependencies,\n ReactRouterV6MatchRoutes,\n ReactRouterV6Params,\n ReactRouterV6RouteMatch,\n ReactRouterV6RouteObject,\n ReactRouterV6RoutesProps,\n ReactRouterV6RoutesShape,\n ReactRouterV6UseLocation,\n ReactRouterV6UseNavigationType,\n} from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/router/v6/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,UAAU,sCAAsC,CAAC,YAAuC,EAAE,IAAU;IACxG,oBAAoB,CAAC,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAEtD,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/router/v6/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,UAAU,sCAAsC,CAAC,YAAuC,EAAE,IAAU;IACxG,oBAAoB,CAAC,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAEtD,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport type { Faro } from '@grafana/faro-web-sdk';\n\nimport { setDependencies } from './dependencies';\nimport { FaroRoutes } from './FaroRoutes';\nimport type { ReactRouterV6Dependencies } from './types';\n\nexport function initializeReactRouterV6Instrumentation(dependencies: ReactRouterV6Dependencies, faro: Faro): void {\n hoistNonReactStatics(FaroRoutes, dependencies.Routes);\n\n setDependencies(dependencies, faro);\n}\n"]}
@@ -12,7 +12,7 @@ export interface ReactRouterV6RoutesProps {
12
12
  location?: Partial<ReactRouterLocation> | string;
13
13
  routesComponent?: ReactRouterV6RoutesShape;
14
14
  }
15
- export declare type ReactRouterV6Params<Key extends string = string> = {
15
+ export type ReactRouterV6Params<Key extends string = string> = {
16
16
  readonly [key in Key]: string | undefined;
17
17
  };
18
18
  export interface ReactRouterV6RouteMatch<ParamKey extends string = string> {
@@ -21,11 +21,11 @@ export interface ReactRouterV6RouteMatch<ParamKey extends string = string> {
21
21
  pathnameBase: string;
22
22
  route: ReactRouterV6RouteObject;
23
23
  }
24
- export declare type ReactRouterV6CreateRoutesFromChildren = (children: ReactNode) => ReactRouterV6RouteObject[];
25
- export declare type ReactRouterV6MatchRoutes = (routes: ReactRouterV6RouteObject[], location: Partial<ReactRouterLocation> | string, basename?: string) => ReactRouterV6RouteMatch[] | null;
26
- export declare type ReactRouterV6RoutesShape = (props: ReactRouterV6RoutesProps) => ReactElement | null;
27
- export declare type ReactRouterV6UseLocation = () => ReactRouterLocation;
28
- export declare type ReactRouterV6UseNavigationType = () => 'POP' | 'PUSH' | 'REPLACE';
24
+ export type ReactRouterV6CreateRoutesFromChildren = (children: ReactNode) => ReactRouterV6RouteObject[];
25
+ export type ReactRouterV6MatchRoutes = (routes: ReactRouterV6RouteObject[], location: Partial<ReactRouterLocation> | string, basename?: string) => ReactRouterV6RouteMatch[] | null;
26
+ export type ReactRouterV6RoutesShape = (props: ReactRouterV6RoutesProps) => ReactElement | null;
27
+ export type ReactRouterV6UseLocation = () => ReactRouterLocation;
28
+ export type ReactRouterV6UseNavigationType = () => 'POP' | 'PUSH' | 'REPLACE';
29
29
  export interface ReactRouterV6Dependencies {
30
30
  createRoutesFromChildren: ReactRouterV6CreateRoutesFromChildren;
31
31
  matchRoutes: ReactRouterV6MatchRoutes;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v6/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/router/v6/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, ReactNode } from 'react';\n\nimport type { ReactRouterLocation } from '../types';\n\nexport interface ReactRouterV6RouteObject {\n caseSensitive?: boolean;\n children?: ReactRouterV6RouteObject[];\n element?: ReactNode;\n index?: boolean;\n path?: string;\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 = (children: ReactNode) => ReactRouterV6RouteObject[];\n\nexport type ReactRouterV6MatchRoutes = (\n routes: ReactRouterV6RouteObject[],\n location: Partial<ReactRouterLocation> | string,\n basename?: string\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/router/v6/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,cA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AAC,MAAM,CAAC,QAAQ,CAAC,EAAE;4BACnF,OAAO,IAAI,CAAC;yBACb;wBAED,OAAO,WAAW,CAAC;qBACpB;iBACF;aACF;SACF;KACF;IAED,OAAO,QAAQ,CAAC,QAAQ,CAAC;AAC3B,CAAC","sourcesContent":["import type { ReactRouterLocation } from '../types';\nimport { matchRoutes } from './dependencies';\nimport type { ReactRouterV6RouteObject } from './types';\n\nexport function getNumberOfUrlSegments(url: string): number {\n return url.split(/\\\\?\\//).filter((currentSegment) => currentSegment.length > 0 && currentSegment !== ',').length;\n}\n\nexport function getRouteFromLocation(routes: ReactRouterV6RouteObject[], location: ReactRouterLocation): string {\n if (!routes || routes.length === 0) {\n return location.pathname;\n }\n\n const matchedRoutes = matchRoutes(routes, location);\n\n let pathBuilder = '';\n\n if (matchedRoutes) {\n for (let x = 0; x < matchedRoutes.length; x++) {\n const branch = matchedRoutes[x]!;\n const route = branch.route;\n\n if (route) {\n if (route.index) {\n return branch.pathname;\n }\n\n let path = route.path;\n\n if (path) {\n path = path.startsWith('/') ? path : `/${path}`;\n\n pathBuilder += path;\n\n if (branch.pathname === location.pathname) {\n if (getNumberOfUrlSegments(pathBuilder) !== getNumberOfUrlSegments(branch.pathname)) {\n return path;\n }\n\n return pathBuilder;\n }\n }\n }\n }\n }\n\n return location.pathname;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactRouterV4V5Dependencies, ReactRouterV6Dependencies, ReactRouterVersion } 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 ReactIntegrationConfig {\n router?: ReactRouterV4V5Config | ReactRouterV6Config;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/utils/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/utils/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC","sourcesContent":["export const unknownString = 'unknown';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC","sourcesContent":["export { unknownString } from './const';\n\nexport {\n getMajorReactVersion,\n isReactVersionAtLeast,\n isReactVersionAtLeast16,\n isReactVersionAtLeast17,\n isReactVersionAtLeast18,\n reactVersion,\n reactVersionMajor,\n} from './reactVersion';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reactVersion.js","sourceRoot":"","sources":["../../../src/utils/reactVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AACpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,oBAAoB,E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;IAEtC,IAAI;QACF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KACjD;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,OAAO,iBAAiB,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,IAAI,OAAO,CAAC;AAC3E,CAAC","sourcesContent":["import { version } from 'react';\n\nexport const reactVersion = version;\nexport const reactVersionMajor = getMajorReactVersion();\nexport const isReactVersionAtLeast18 = isReactVersionAtLeast(18);\nexport const isReactVersionAtLeast17 = isReactVersionAtLeast(17);\nexport const isReactVersionAtLeast16 = isReactVersionAtLeast(16);\n\nexport function getMajorReactVersion(): number | null {\n const major = reactVersion.split('.');\n\n try {\n return major[0] ? parseInt(major[0], 10) : null;\n } catch (err) {\n return null;\n }\n}\n\nexport function isReactVersionAtLeast(version: number): boolean {\n return reactVersionMajor === null ? false : reactVersionMajor >= version;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,18 @@
1
1
  {
2
2
  "name": "@grafana/faro-react",
3
- "version": "1.0.0-beta2",
3
+ "version": "1.0.0-beta3",
4
4
  "description": "Faro package that enables easier integration in projects built with React.",
5
+ "keywords": [
6
+ "observability",
7
+ "apm",
8
+ "rum",
9
+ "logs",
10
+ "traces",
11
+ "metrics",
12
+ "react",
13
+ "react router",
14
+ "react profiler"
15
+ ],
5
16
  "license": "Apache-2.0",
6
17
  "author": "Grafana Labs",
7
18
  "homepage": "https://github.com/grafana/faro-web-sdk",
@@ -32,15 +43,15 @@
32
43
  "quality:circular-deps": "madge --circular ."
33
44
  },
34
45
  "dependencies": {
35
- "@grafana/faro-web-sdk": "^1.0.0-beta2",
36
- "@grafana/faro-web-tracing": "^1.0.0-beta2",
46
+ "@grafana/faro-web-sdk": "^1.0.0-beta3",
47
+ "@grafana/faro-web-tracing": "^1.0.0-beta3",
37
48
  "hoist-non-react-statics": "^3.3.2"
38
49
  },
39
50
  "devDependencies": {
40
51
  "@types/hoist-non-react-statics": "^3.3.1",
41
- "@types/react": "^18.0.22",
52
+ "@types/react": "^18.0.25",
42
53
  "react": "^18.1.0",
43
- "react-router-dom": "^6.4.2"
54
+ "react-router-dom": "^6.4.3"
44
55
  },
45
56
  "peerDependencies": {
46
57
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -49,5 +60,5 @@
49
60
  "publishConfig": {
50
61
  "access": "public"
51
62
  },
52
- "gitHead": "908d0abf71a64a38bd9d5cc1bbba26d52e4ae063"
63
+ "gitHead": "99cc29ee4c9bfece5697b016855f3a2ba96a9848"
53
64
  }