@safaricom-mxl/web-sdk 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -14
- package/UPGRADING.md +47 -0
- package/dist/api-logs/manager/types.d.cts +6 -1
- package/dist/api-logs/manager/types.d.cts.map +1 -1
- package/dist/api-logs/manager/types.d.ts +6 -1
- package/dist/api-logs/manager/types.d.ts.map +1 -1
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.cjs +12 -1
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.cjs.map +1 -1
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.d.cts +2 -0
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.d.cts.map +1 -1
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.d.ts +2 -0
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.d.ts.map +1 -1
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.js +12 -1
- package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.js.map +1 -1
- package/dist/api-page/manager/types.d.cts +2 -1
- package/dist/api-page/manager/types.d.cts.map +1 -1
- package/dist/api-page/manager/types.d.ts +2 -1
- package/dist/api-page/manager/types.d.ts.map +1 -1
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.cjs +6 -1
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.cjs.map +1 -1
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.d.cts +4 -2
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.d.cts.map +1 -1
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.d.ts +4 -2
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.d.ts.map +1 -1
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.js +6 -1
- package/dist/api-sessions/manager/NoOpUserSessionManager/NoOpUserSessionManager.js.map +1 -1
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.cjs +8 -2
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.cjs.map +1 -1
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.d.cts +4 -2
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.d.cts.map +1 -1
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.d.ts +4 -2
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.d.ts.map +1 -1
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.js +8 -2
- package/dist/api-sessions/manager/ProxyUserSessionManager/ProxyUserSessionManager.js.map +1 -1
- package/dist/constants/attributes.cjs +12 -0
- package/dist/constants/attributes.cjs.map +1 -1
- package/dist/constants/attributes.d.cts +7 -1
- package/dist/constants/attributes.d.cts.map +1 -1
- package/dist/constants/attributes.d.ts +7 -1
- package/dist/constants/attributes.d.ts.map +1 -1
- package/dist/constants/attributes.js +7 -1
- package/dist/constants/attributes.js.map +1 -1
- package/dist/exporters/BaseFetchExporter/BaseFetchExporter.d.ts +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.cjs +1 -2
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.cjs.map +1 -1
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.d.cts +3 -4
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.d.cts.map +1 -1
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.d.ts +1 -2
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.d.ts.map +1 -1
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.js +1 -2
- package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.js.map +1 -1
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.cjs +12 -2
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.cjs.map +1 -1
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.cts +5 -2
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.cts.map +1 -1
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.ts +5 -2
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.ts.map +1 -1
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.js +12 -2
- package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.js.map +1 -1
- package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.cjs +1 -2
- package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.js +1 -2
- package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.js.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.cjs +29 -33
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.cts +4 -2
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.ts +4 -2
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.js +29 -33
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.js.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.cjs +14 -12
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.cjs.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.d.cts +3 -2
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.d.cts.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.d.ts +3 -2
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.d.ts.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.js +14 -12
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/networkEvents.js.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/types.d.cts +1 -2
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/types.d.cts.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/types.d.ts +1 -2
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/types.d.ts.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.cjs +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.cjs.map +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.js +1 -1
- package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.js.map +1 -1
- package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.cjs +3 -5
- package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.js +3 -5
- package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.js.map +1 -1
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.cjs +7 -3
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.d.cts +1 -0
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.d.ts +1 -0
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.js +7 -3
- package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.js.map +1 -1
- package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.cjs +2 -3
- package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.js +2 -3
- package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.js.map +1 -1
- package/dist/instrumentations/first-interaction/FirstInteractionInstrumentation/FirstInteractionInstrumentation.cjs +4 -5
- package/dist/instrumentations/first-interaction/FirstInteractionInstrumentation/FirstInteractionInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/first-interaction/FirstInteractionInstrumentation/FirstInteractionInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/first-interaction/FirstInteractionInstrumentation/FirstInteractionInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/first-interaction/FirstInteractionInstrumentation/FirstInteractionInstrumentation.js +3 -4
- package/dist/instrumentations/first-interaction/FirstInteractionInstrumentation/FirstInteractionInstrumentation.js.map +1 -1
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.cjs +172 -0
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.cjs.map +1 -0
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.d.cts +38 -0
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.d.cts.map +1 -0
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.d.ts +38 -0
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.d.ts.map +1 -0
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.js +170 -0
- package/dist/instrumentations/js-profiler/JsProfilerInstrumentation.js.map +1 -0
- package/dist/instrumentations/js-profiler/constants.cjs +21 -0
- package/dist/instrumentations/js-profiler/constants.cjs.map +1 -0
- package/dist/instrumentations/js-profiler/constants.d.cts +13 -0
- package/dist/instrumentations/js-profiler/constants.d.cts.map +1 -0
- package/dist/instrumentations/js-profiler/constants.d.ts +13 -0
- package/dist/instrumentations/js-profiler/constants.d.ts.map +1 -0
- package/dist/instrumentations/js-profiler/constants.js +13 -0
- package/dist/instrumentations/js-profiler/constants.js.map +1 -0
- package/dist/instrumentations/js-profiler/fixture.cjs +54 -0
- package/dist/instrumentations/js-profiler/fixture.cjs.map +1 -0
- package/dist/instrumentations/js-profiler/fixture.d.cts +7 -0
- package/dist/instrumentations/js-profiler/fixture.d.cts.map +1 -0
- package/dist/instrumentations/js-profiler/fixture.d.ts +7 -0
- package/dist/instrumentations/js-profiler/fixture.d.ts.map +1 -0
- package/dist/instrumentations/js-profiler/fixture.js +53 -0
- package/dist/instrumentations/js-profiler/fixture.js.map +1 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.cjs +63 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.cjs.map +1 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.d.cts +7 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.d.cts.map +1 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.d.ts +7 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.d.ts.map +1 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.js +62 -0
- package/dist/instrumentations/js-profiler/reduceProfilerTrace.js.map +1 -0
- package/dist/instrumentations/js-profiler/types.cjs +0 -0
- package/dist/instrumentations/js-profiler/types.d.cts +51 -0
- package/dist/instrumentations/js-profiler/types.d.cts.map +1 -0
- package/dist/instrumentations/js-profiler/types.d.ts +51 -0
- package/dist/instrumentations/js-profiler/types.d.ts.map +1 -0
- package/dist/instrumentations/js-profiler/types.js +0 -0
- package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.cjs +3 -5
- package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.js +1 -3
- package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.js.map +1 -1
- package/dist/instrumentations/max-scroll-depth/MaxScrollDepthInstrumentation/MaxScrollDepthInstrumentation.cjs +2 -3
- package/dist/instrumentations/max-scroll-depth/MaxScrollDepthInstrumentation/MaxScrollDepthInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/max-scroll-depth/MaxScrollDepthInstrumentation/MaxScrollDepthInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/max-scroll-depth/MaxScrollDepthInstrumentation/MaxScrollDepthInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/max-scroll-depth/MaxScrollDepthInstrumentation/MaxScrollDepthInstrumentation.js +1 -2
- package/dist/instrumentations/max-scroll-depth/MaxScrollDepthInstrumentation/MaxScrollDepthInstrumentation.js.map +1 -1
- package/dist/instrumentations/memory/MemoryInstrumentation.cjs +216 -0
- package/dist/instrumentations/memory/MemoryInstrumentation.cjs.map +1 -0
- package/dist/instrumentations/memory/MemoryInstrumentation.d.cts +55 -0
- package/dist/instrumentations/memory/MemoryInstrumentation.d.cts.map +1 -0
- package/dist/instrumentations/memory/MemoryInstrumentation.d.ts +55 -0
- package/dist/instrumentations/memory/MemoryInstrumentation.d.ts.map +1 -0
- package/dist/instrumentations/memory/MemoryInstrumentation.js +215 -0
- package/dist/instrumentations/memory/MemoryInstrumentation.js.map +1 -0
- package/dist/instrumentations/memory/browserFamily.cjs +13 -0
- package/dist/instrumentations/memory/browserFamily.cjs.map +1 -0
- package/dist/instrumentations/memory/browserFamily.d.cts +5 -0
- package/dist/instrumentations/memory/browserFamily.d.cts.map +1 -0
- package/dist/instrumentations/memory/browserFamily.d.ts +5 -0
- package/dist/instrumentations/memory/browserFamily.d.ts.map +1 -0
- package/dist/instrumentations/memory/browserFamily.js +12 -0
- package/dist/instrumentations/memory/browserFamily.js.map +1 -0
- package/dist/instrumentations/memory/constants.cjs +25 -0
- package/dist/instrumentations/memory/constants.cjs.map +1 -0
- package/dist/instrumentations/memory/constants.d.cts +13 -0
- package/dist/instrumentations/memory/constants.d.cts.map +1 -0
- package/dist/instrumentations/memory/constants.d.ts +13 -0
- package/dist/instrumentations/memory/constants.d.ts.map +1 -0
- package/dist/instrumentations/memory/constants.js +22 -0
- package/dist/instrumentations/memory/constants.js.map +1 -0
- package/dist/instrumentations/memory/resource.cjs +30 -0
- package/dist/instrumentations/memory/resource.cjs.map +1 -0
- package/dist/instrumentations/memory/resource.d.cts +16 -0
- package/dist/instrumentations/memory/resource.d.cts.map +1 -0
- package/dist/instrumentations/memory/resource.d.ts +16 -0
- package/dist/instrumentations/memory/resource.d.ts.map +1 -0
- package/dist/instrumentations/memory/resource.js +27 -0
- package/dist/instrumentations/memory/resource.js.map +1 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.cjs +27 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.cjs.map +1 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.d.cts +7 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.d.cts.map +1 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.d.ts +7 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.d.ts.map +1 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.js +25 -0
- package/dist/instrumentations/memory/startMemoryMeterProvider.js.map +1 -0
- package/dist/instrumentations/memory/types.cjs +0 -0
- package/dist/instrumentations/memory/types.d.cts +47 -0
- package/dist/instrumentations/memory/types.d.cts.map +1 -0
- package/dist/instrumentations/memory/types.d.ts +47 -0
- package/dist/instrumentations/memory/types.d.ts.map +1 -0
- package/dist/instrumentations/memory/types.js +0 -0
- package/dist/instrumentations/memory/visibility.cjs +25 -0
- package/dist/instrumentations/memory/visibility.cjs.map +1 -0
- package/dist/instrumentations/memory/visibility.d.cts +14 -0
- package/dist/instrumentations/memory/visibility.d.cts.map +1 -0
- package/dist/instrumentations/memory/visibility.d.ts +14 -0
- package/dist/instrumentations/memory/visibility.d.ts.map +1 -0
- package/dist/instrumentations/memory/visibility.js +24 -0
- package/dist/instrumentations/memory/visibility.js.map +1 -0
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.cjs +62 -55
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.d.cts +16 -5
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.d.ts +16 -5
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.js +62 -55
- package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.js.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.cjs +3 -3
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.cjs.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.d.cts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.d.ts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.js +3 -3
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.js.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.cjs +10 -13
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.cjs.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.d.cts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.d.ts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.js +10 -13
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.js.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.cjs +8 -4
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.cjs.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.d.cts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.d.ts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.js +8 -4
- package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.js.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.cts +2 -0
- package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.cts.map +1 -1
- package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.ts +2 -0
- package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.ts.map +1 -1
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.cjs +14 -13
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.d.cts +1 -0
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.d.ts +1 -0
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.js +13 -12
- package/dist/instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.js.map +1 -1
- package/dist/instrumentations/replay/ReplayInstrumentation/ReplayInstrumentation.cjs +0 -2
- package/dist/instrumentations/replay/ReplayInstrumentation/ReplayInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/replay/ReplayInstrumentation/ReplayInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/replay/ReplayInstrumentation/ReplayInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/replay/ReplayInstrumentation/ReplayInstrumentation.js +0 -2
- package/dist/instrumentations/replay/ReplayInstrumentation/ReplayInstrumentation.js.map +1 -1
- package/dist/instrumentations/replay/ReplayInstrumentation/types.d.cts +1 -1
- package/dist/instrumentations/replay/ReplayInstrumentation/types.d.ts +1 -1
- package/dist/instrumentations/replay/events/startEventCapture.cjs +2 -1
- package/dist/instrumentations/replay/events/startEventCapture.cjs.map +1 -1
- package/dist/instrumentations/replay/events/startEventCapture.d.cts +2 -0
- package/dist/instrumentations/replay/events/startEventCapture.d.cts.map +1 -1
- package/dist/instrumentations/replay/events/startEventCapture.d.ts +2 -0
- package/dist/instrumentations/replay/events/startEventCapture.d.ts.map +1 -1
- package/dist/instrumentations/replay/events/startEventCapture.js +2 -1
- package/dist/instrumentations/replay/events/startEventCapture.js.map +1 -1
- package/dist/instrumentations/replay/recorder/startRecording.cjs +2 -4
- package/dist/instrumentations/replay/recorder/startRecording.cjs.map +1 -1
- package/dist/instrumentations/replay/recorder/startRecording.d.cts +2 -0
- package/dist/instrumentations/replay/recorder/startRecording.d.cts.map +1 -1
- package/dist/instrumentations/replay/recorder/startRecording.d.ts +2 -0
- package/dist/instrumentations/replay/recorder/startRecording.d.ts.map +1 -1
- package/dist/instrumentations/replay/recorder/startRecording.js +2 -4
- package/dist/instrumentations/replay/recorder/startRecording.js.map +1 -1
- package/dist/instrumentations/replay/recorder/types.d.cts +0 -1
- package/dist/instrumentations/replay/recorder/types.d.cts.map +1 -1
- package/dist/instrumentations/replay/recorder/types.d.ts +0 -1
- package/dist/instrumentations/replay/recorder/types.d.ts.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.esm.cjs +2 -2
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.esm.cjs.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.esm.d.cts.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.esm.d.ts.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.esm.js +2 -2
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.esm.js.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.iife.cjs +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.iife.cjs.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.iife.js +1 -1
- package/dist/instrumentations/replay/rrwebLoader/loadRrwebModule.iife.js.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/types.d.cts +4 -2
- package/dist/instrumentations/replay/rrwebLoader/types.d.cts.map +1 -1
- package/dist/instrumentations/replay/rrwebLoader/types.d.ts +4 -2
- package/dist/instrumentations/replay/rrwebLoader/types.d.ts.map +1 -1
- package/dist/instrumentations/replay/session-recording/SessionRecording.cjs +16 -1
- package/dist/instrumentations/replay/session-recording/SessionRecording.cjs.map +1 -1
- package/dist/instrumentations/replay/session-recording/SessionRecording.d.cts +2 -0
- package/dist/instrumentations/replay/session-recording/SessionRecording.d.cts.map +1 -1
- package/dist/instrumentations/replay/session-recording/SessionRecording.d.ts +2 -0
- package/dist/instrumentations/replay/session-recording/SessionRecording.d.ts.map +1 -1
- package/dist/instrumentations/replay/session-recording/SessionRecording.js +16 -1
- package/dist/instrumentations/replay/session-recording/SessionRecording.js.map +1 -1
- package/dist/instrumentations/replay/session-recording/lifecycle.cjs +6 -4
- package/dist/instrumentations/replay/session-recording/lifecycle.cjs.map +1 -1
- package/dist/instrumentations/replay/session-recording/lifecycle.d.cts +4 -3
- package/dist/instrumentations/replay/session-recording/lifecycle.d.cts.map +1 -1
- package/dist/instrumentations/replay/session-recording/lifecycle.d.ts +4 -3
- package/dist/instrumentations/replay/session-recording/lifecycle.d.ts.map +1 -1
- package/dist/instrumentations/replay/session-recording/lifecycle.js +6 -4
- package/dist/instrumentations/replay/session-recording/lifecycle.js.map +1 -1
- package/dist/instrumentations/replay/transport/idleFlushTimer.cjs.map +1 -1
- package/dist/instrumentations/replay/transport/idleFlushTimer.d.cts.map +1 -1
- package/dist/instrumentations/replay/transport/idleFlushTimer.d.ts.map +1 -1
- package/dist/instrumentations/replay/transport/idleFlushTimer.js.map +1 -1
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.cjs +4 -18
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.cts +0 -2
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.ts +0 -2
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.js +3 -17
- package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.js.map +1 -1
- package/dist/instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/SoftNavigationPerformanceInstrumentation.cjs +8 -11
- package/dist/instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/SoftNavigationPerformanceInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/SoftNavigationPerformanceInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/SoftNavigationPerformanceInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/SoftNavigationPerformanceInstrumentation.js +8 -11
- package/dist/instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/SoftNavigationPerformanceInstrumentation.js.map +1 -1
- package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.cjs +7 -10
- package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.js +6 -9
- package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.js.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.cjs +24 -16
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.cjs.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.cts +3 -2
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.cts.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.ts +3 -2
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.ts.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.js +24 -16
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.js.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.cjs +11 -63
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.cjs.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.cts +4 -56
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.cts.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.ts +4 -56
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.ts.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.js +11 -62
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.js.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.cts +1 -2
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.cts.map +1 -1
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.ts +1 -2
- package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.ts.map +1 -1
- package/dist/managers/MXLAnalyticsManager/MXLAnalyticsManager.cjs +5 -5
- package/dist/managers/MXLAnalyticsManager/MXLAnalyticsManager.cjs.map +1 -1
- package/dist/managers/MXLAnalyticsManager/MXLAnalyticsManager.d.cts.map +1 -1
- package/dist/managers/MXLAnalyticsManager/MXLAnalyticsManager.d.ts.map +1 -1
- package/dist/managers/MXLAnalyticsManager/MXLAnalyticsManager.js +4 -4
- package/dist/managers/MXLAnalyticsManager/MXLAnalyticsManager.js.map +1 -1
- package/dist/managers/MXLAnalyticsManager/types.d.cts +1 -2
- package/dist/managers/MXLAnalyticsManager/types.d.cts.map +1 -1
- package/dist/managers/MXLAnalyticsManager/types.d.ts +1 -2
- package/dist/managers/MXLAnalyticsManager/types.d.ts.map +1 -1
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.cjs +14 -0
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.cjs.map +1 -1
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.cts +4 -1
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.cts.map +1 -1
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.ts +4 -1
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.ts.map +1 -1
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.js +14 -0
- package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.js.map +1 -1
- package/dist/managers/MXLConfigManager/performanceDefaults.cjs +21 -0
- package/dist/managers/MXLConfigManager/performanceDefaults.cjs.map +1 -0
- package/dist/managers/MXLConfigManager/performanceDefaults.d.cts +12 -0
- package/dist/managers/MXLConfigManager/performanceDefaults.d.cts.map +1 -0
- package/dist/managers/MXLConfigManager/performanceDefaults.d.ts +12 -0
- package/dist/managers/MXLConfigManager/performanceDefaults.d.ts.map +1 -0
- package/dist/managers/MXLConfigManager/performanceDefaults.js +13 -0
- package/dist/managers/MXLConfigManager/performanceDefaults.js.map +1 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.cjs +29 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.cjs.map +1 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.d.cts +40 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.d.cts.map +1 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.d.ts +40 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.d.ts.map +1 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.js +27 -0
- package/dist/managers/MXLConfigManager/resolveEffectivePerformance.js.map +1 -0
- package/dist/managers/MXLConfigManager/types.d.cts +18 -1
- package/dist/managers/MXLConfigManager/types.d.cts.map +1 -1
- package/dist/managers/MXLConfigManager/types.d.ts +18 -1
- package/dist/managers/MXLConfigManager/types.d.ts.map +1 -1
- package/dist/managers/MXLConfigManager/utils.cjs +37 -0
- package/dist/managers/MXLConfigManager/utils.cjs.map +1 -1
- package/dist/managers/MXLConfigManager/utils.d.cts.map +1 -1
- package/dist/managers/MXLConfigManager/utils.d.ts.map +1 -1
- package/dist/managers/MXLConfigManager/utils.js +37 -0
- package/dist/managers/MXLConfigManager/utils.js.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.cjs +9 -8
- package/dist/managers/MXLLogManager/MXLLogManager.cjs.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.d.cts +2 -1
- package/dist/managers/MXLLogManager/MXLLogManager.d.cts.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.d.ts +2 -1
- package/dist/managers/MXLLogManager/MXLLogManager.d.ts.map +1 -1
- package/dist/managers/MXLLogManager/MXLLogManager.js +5 -4
- package/dist/managers/MXLLogManager/MXLLogManager.js.map +1 -1
- package/dist/managers/MXLLogManager/MXLLoggerProvider.cjs +46 -0
- package/dist/managers/MXLLogManager/MXLLoggerProvider.cjs.map +1 -0
- package/dist/managers/MXLLogManager/MXLLoggerProvider.d.cts +22 -0
- package/dist/managers/MXLLogManager/MXLLoggerProvider.d.cts.map +1 -0
- package/dist/managers/MXLLogManager/MXLLoggerProvider.d.ts +22 -0
- package/dist/managers/MXLLogManager/MXLLoggerProvider.d.ts.map +1 -0
- package/dist/managers/MXLLogManager/MXLLoggerProvider.js +44 -0
- package/dist/managers/MXLLogManager/MXLLoggerProvider.js.map +1 -0
- package/dist/managers/MXLLogManager/types.d.cts +9 -3
- package/dist/managers/MXLLogManager/types.d.cts.map +1 -1
- package/dist/managers/MXLLogManager/types.d.ts +9 -3
- package/dist/managers/MXLLogManager/types.d.ts.map +1 -1
- package/dist/managers/MXLPageManager/MXLPageManager.cjs +7 -6
- package/dist/managers/MXLPageManager/MXLPageManager.cjs.map +1 -1
- package/dist/managers/MXLPageManager/MXLPageManager.d.cts.map +1 -1
- package/dist/managers/MXLPageManager/MXLPageManager.d.ts.map +1 -1
- package/dist/managers/MXLPageManager/MXLPageManager.js +7 -6
- package/dist/managers/MXLPageManager/MXLPageManager.js.map +1 -1
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.cjs +56 -9
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.cjs.map +1 -1
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.cts +21 -5
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.cts.map +1 -1
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.ts +21 -5
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.ts.map +1 -1
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.js +56 -10
- package/dist/managers/MXLTraceManager/MXLExtendedSpan.js.map +1 -1
- package/dist/managers/MXLTraceManager/MXLTraceManager.cjs +2 -2
- package/dist/managers/MXLTraceManager/MXLTraceManager.cjs.map +1 -1
- package/dist/managers/MXLTraceManager/MXLTraceManager.js +2 -2
- package/dist/managers/MXLTraceManager/MXLTraceManager.js.map +1 -1
- package/dist/managers/MXLTraceManager/MXLTracerProvider.cjs +42 -0
- package/dist/managers/MXLTraceManager/MXLTracerProvider.cjs.map +1 -0
- package/dist/managers/MXLTraceManager/MXLTracerProvider.d.cts +22 -0
- package/dist/managers/MXLTraceManager/MXLTracerProvider.d.cts.map +1 -0
- package/dist/managers/MXLTraceManager/MXLTracerProvider.d.ts +22 -0
- package/dist/managers/MXLTraceManager/MXLTracerProvider.d.ts.map +1 -0
- package/dist/managers/MXLTraceManager/MXLTracerProvider.js +40 -0
- package/dist/managers/MXLTraceManager/MXLTracerProvider.js.map +1 -0
- package/dist/managers/MXLTraceManager/types.cjs +0 -0
- package/dist/managers/MXLTraceManager/types.d.cts +10 -0
- package/dist/managers/MXLTraceManager/types.d.cts.map +1 -0
- package/dist/managers/MXLTraceManager/types.d.ts +10 -0
- package/dist/managers/MXLTraceManager/types.d.ts.map +1 -0
- package/dist/managers/MXLTraceManager/types.js +0 -0
- package/dist/managers/MXLUserManager/MXLUserManager.cjs +1 -1
- package/dist/managers/MXLUserManager/MXLUserManager.js +1 -1
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.cjs +45 -21
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.cjs.map +1 -1
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.d.cts +5 -3
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.d.cts.map +1 -1
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.d.ts +5 -3
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.d.ts.map +1 -1
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.js +45 -21
- package/dist/managers/MXLUserSessionManager/MXLUserSessionManager.js.map +1 -1
- package/dist/managers/MXLUserSessionManager/constants.cjs +1 -1
- package/dist/managers/MXLUserSessionManager/constants.cjs.map +1 -1
- package/dist/managers/MXLUserSessionManager/constants.d.cts +1 -1
- package/dist/managers/MXLUserSessionManager/constants.d.ts +1 -1
- package/dist/managers/MXLUserSessionManager/constants.js +1 -1
- package/dist/managers/MXLUserSessionManager/constants.js.map +1 -1
- package/dist/managers/MXLUserSessionManager/types.d.cts +19 -2
- package/dist/managers/MXLUserSessionManager/types.d.cts.map +1 -1
- package/dist/managers/MXLUserSessionManager/types.d.ts +19 -2
- package/dist/managers/MXLUserSessionManager/types.d.ts.map +1 -1
- package/dist/managers/MXLUserSessionManager/utils/state.cjs +19 -6
- package/dist/managers/MXLUserSessionManager/utils/state.cjs.map +1 -1
- package/dist/managers/MXLUserSessionManager/utils/state.d.cts +3 -2
- package/dist/managers/MXLUserSessionManager/utils/state.d.cts.map +1 -1
- package/dist/managers/MXLUserSessionManager/utils/state.d.ts +3 -2
- package/dist/managers/MXLUserSessionManager/utils/state.d.ts.map +1 -1
- package/dist/managers/MXLUserSessionManager/utils/state.js +19 -7
- package/dist/managers/MXLUserSessionManager/utils/state.js.map +1 -1
- package/dist/managers/MXLUserSessionManager/utils/tabTracking.cjs +1 -1
- package/dist/managers/MXLUserSessionManager/utils/tabTracking.js +1 -1
- package/dist/mxl-web-sdk.js +12 -2
- package/dist/mxl-web-sdk.js.map +1 -1
- package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.cjs.map +1 -1
- package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.d.cts +2 -2
- package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.d.cts.map +1 -1
- package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.d.ts +2 -2
- package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.d.ts.map +1 -1
- package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.js.map +1 -1
- package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.cjs.map +1 -1
- package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.d.cts +2 -2
- package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.d.cts.map +1 -1
- package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.d.ts +2 -2
- package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.d.ts.map +1 -1
- package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.js.map +1 -1
- package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.cjs.map +1 -1
- package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.d.cts +2 -2
- package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.d.cts.map +1 -1
- package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.d.ts +2 -2
- package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.d.ts.map +1 -1
- package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.js.map +1 -1
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.cjs +1 -1
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.cjs.map +1 -1
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.d.cts +2 -2
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.d.cts.map +1 -1
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.d.ts +2 -2
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.d.ts.map +1 -1
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.js +1 -1
- package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.js.map +1 -1
- package/dist/processors/PageSpanProcessor/PageSpanProcessor.cjs +1 -1
- package/dist/processors/PageSpanProcessor/PageSpanProcessor.cjs.map +1 -1
- package/dist/processors/PageSpanProcessor/PageSpanProcessor.d.cts.map +1 -1
- package/dist/processors/PageSpanProcessor/PageSpanProcessor.d.ts.map +1 -1
- package/dist/processors/PageSpanProcessor/PageSpanProcessor.js +1 -1
- package/dist/processors/PageSpanProcessor/PageSpanProcessor.js.map +1 -1
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.cjs +26 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.cjs.map +1 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.d.cts +20 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.d.cts.map +1 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.d.ts +20 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.d.ts.map +1 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.js +25 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/PerfClockLagLogRecordProcessor.js.map +1 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/types.cjs +0 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/types.d.cts +9 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/types.d.cts.map +1 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/types.d.ts +9 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/types.d.ts.map +1 -0
- package/dist/processors/PerfClockLagLogRecordProcessor/types.js +0 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.cjs +27 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.cjs.map +1 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.d.cts +21 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.d.cts.map +1 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.d.ts +21 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.d.ts.map +1 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.js +26 -0
- package/dist/processors/PerfClockLagSpanProcessor/PerfClockLagSpanProcessor.js.map +1 -0
- package/dist/processors/PerfClockLagSpanProcessor/types.cjs +0 -0
- package/dist/processors/PerfClockLagSpanProcessor/types.d.cts +9 -0
- package/dist/processors/PerfClockLagSpanProcessor/types.d.cts.map +1 -0
- package/dist/processors/PerfClockLagSpanProcessor/types.d.ts +9 -0
- package/dist/processors/PerfClockLagSpanProcessor/types.d.ts.map +1 -0
- package/dist/processors/PerfClockLagSpanProcessor/types.js +0 -0
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.cjs +1 -1
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.cjs.map +1 -1
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.d.cts +2 -2
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.d.cts.map +1 -1
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.d.ts +2 -2
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.d.ts.map +1 -1
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.js +1 -1
- package/dist/processors/SignalCorrelationLogRecordProcessor/SignalCorrelationLogRecordProcessor.js.map +1 -1
- package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.cjs.map +1 -1
- package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.d.cts +2 -2
- package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.d.cts.map +1 -1
- package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.d.ts +2 -2
- package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.d.ts.map +1 -1
- package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.js.map +1 -1
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.cjs +1 -1
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.cjs.map +1 -1
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.d.cts +2 -2
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.d.cts.map +1 -1
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.d.ts +2 -2
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.d.ts.map +1 -1
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.js +1 -1
- package/dist/processors/UserSessionLogRecordProcessor/UserSessionLogRecordProcessor.js.map +1 -1
- package/dist/resources/sdkConstants.cjs +1 -1
- package/dist/resources/sdkConstants.cjs.map +1 -1
- package/dist/resources/sdkConstants.d.cts +1 -1
- package/dist/resources/sdkConstants.d.ts +1 -1
- package/dist/resources/sdkConstants.js +1 -1
- package/dist/resources/sdkConstants.js.map +1 -1
- package/dist/sdk/endpoints.cjs +2 -2
- package/dist/sdk/endpoints.cjs.map +1 -1
- package/dist/sdk/endpoints.d.cts +1 -1
- package/dist/sdk/endpoints.d.ts +1 -1
- package/dist/sdk/endpoints.js +2 -2
- package/dist/sdk/endpoints.js.map +1 -1
- package/dist/sdk/initSDK.cjs +42 -11
- package/dist/sdk/initSDK.cjs.map +1 -1
- package/dist/sdk/initSDK.js +45 -14
- package/dist/sdk/initSDK.js.map +1 -1
- package/dist/sdk/networkInstrumentations.cjs +1 -1
- package/dist/sdk/networkInstrumentations.cjs.map +1 -1
- package/dist/sdk/networkInstrumentations.d.cts.map +1 -1
- package/dist/sdk/networkInstrumentations.d.ts.map +1 -1
- package/dist/sdk/networkInstrumentations.js +1 -1
- package/dist/sdk/networkInstrumentations.js.map +1 -1
- package/dist/sdk/resolveInitConfig.cjs +2 -1
- package/dist/sdk/resolveInitConfig.cjs.map +1 -1
- package/dist/sdk/resolveInitConfig.d.cts +4 -0
- package/dist/sdk/resolveInitConfig.d.cts.map +1 -1
- package/dist/sdk/resolveInitConfig.d.ts +4 -0
- package/dist/sdk/resolveInitConfig.d.ts.map +1 -1
- package/dist/sdk/resolveInitConfig.js +2 -1
- package/dist/sdk/resolveInitConfig.js.map +1 -1
- package/dist/sdk/responseSpanContext.cjs +34 -0
- package/dist/sdk/responseSpanContext.cjs.map +1 -0
- package/dist/sdk/responseSpanContext.d.cts +16 -0
- package/dist/sdk/responseSpanContext.d.cts.map +1 -0
- package/dist/sdk/responseSpanContext.d.ts +16 -0
- package/dist/sdk/responseSpanContext.d.ts.map +1 -0
- package/dist/sdk/responseSpanContext.js +31 -0
- package/dist/sdk/responseSpanContext.js.map +1 -0
- package/dist/sdk/setupDefaultInstrumentations.cjs +17 -1
- package/dist/sdk/setupDefaultInstrumentations.cjs.map +1 -1
- package/dist/sdk/setupDefaultInstrumentations.d.cts +2 -1
- package/dist/sdk/setupDefaultInstrumentations.d.cts.map +1 -1
- package/dist/sdk/setupDefaultInstrumentations.d.ts +2 -1
- package/dist/sdk/setupDefaultInstrumentations.d.ts.map +1 -1
- package/dist/sdk/setupDefaultInstrumentations.js +17 -1
- package/dist/sdk/setupDefaultInstrumentations.js.map +1 -1
- package/dist/sdk/types.d.cts +42 -2
- package/dist/sdk/types.d.cts.map +1 -1
- package/dist/sdk/types.d.ts +42 -2
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/transport/RetryingTransport/RetryingTransport.cjs +2 -2
- package/dist/transport/RetryingTransport/RetryingTransport.cjs.map +1 -1
- package/dist/transport/RetryingTransport/RetryingTransport.js +2 -2
- package/dist/transport/RetryingTransport/RetryingTransport.js.map +1 -1
- package/dist/utils/InMemoryStorage/InMemoryStorage.cjs +27 -0
- package/dist/utils/InMemoryStorage/InMemoryStorage.cjs.map +1 -0
- package/dist/utils/InMemoryStorage/InMemoryStorage.d.cts +13 -0
- package/dist/utils/InMemoryStorage/InMemoryStorage.d.cts.map +1 -0
- package/dist/utils/InMemoryStorage/InMemoryStorage.d.ts +13 -0
- package/dist/utils/InMemoryStorage/InMemoryStorage.d.ts.map +1 -0
- package/dist/utils/InMemoryStorage/InMemoryStorage.js +26 -0
- package/dist/utils/InMemoryStorage/InMemoryStorage.js.map +1 -0
- package/dist/utils/PerformanceManager/OTelPerformanceManager.cjs +71 -24
- package/dist/utils/PerformanceManager/OTelPerformanceManager.cjs.map +1 -1
- package/dist/utils/PerformanceManager/OTelPerformanceManager.d.cts +18 -19
- package/dist/utils/PerformanceManager/OTelPerformanceManager.d.cts.map +1 -1
- package/dist/utils/PerformanceManager/OTelPerformanceManager.d.ts +18 -19
- package/dist/utils/PerformanceManager/OTelPerformanceManager.d.ts.map +1 -1
- package/dist/utils/PerformanceManager/OTelPerformanceManager.js +70 -22
- package/dist/utils/PerformanceManager/OTelPerformanceManager.js.map +1 -1
- package/dist/utils/PerformanceManager/types.d.cts +28 -12
- package/dist/utils/PerformanceManager/types.d.cts.map +1 -1
- package/dist/utils/PerformanceManager/types.d.ts +28 -12
- package/dist/utils/PerformanceManager/types.d.ts.map +1 -1
- package/dist/utils/getWindowStorageOrInMemory.cjs +24 -0
- package/dist/utils/getWindowStorageOrInMemory.cjs.map +1 -0
- package/dist/utils/getWindowStorageOrInMemory.d.cts +13 -0
- package/dist/utils/getWindowStorageOrInMemory.d.cts.map +1 -0
- package/dist/utils/getWindowStorageOrInMemory.d.ts +13 -0
- package/dist/utils/getWindowStorageOrInMemory.d.ts.map +1 -0
- package/dist/utils/getWindowStorageOrInMemory.js +23 -0
- package/dist/utils/getWindowStorageOrInMemory.js.map +1 -0
- package/dist/utils/sdkLoadOriginOffset.cjs +12 -0
- package/dist/utils/sdkLoadOriginOffset.cjs.map +1 -0
- package/dist/utils/sdkLoadOriginOffset.d.cts +10 -0
- package/dist/utils/sdkLoadOriginOffset.d.cts.map +1 -0
- package/dist/utils/sdkLoadOriginOffset.d.ts +10 -0
- package/dist/utils/sdkLoadOriginOffset.d.ts.map +1 -0
- package/dist/utils/sdkLoadOriginOffset.js +11 -0
- package/dist/utils/sdkLoadOriginOffset.js.map +1 -0
- package/package.json +20 -22
package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.js
CHANGED
|
@@ -6,11 +6,13 @@ import { MXLInstrumentationBase } from "../../MXLInstrumentationBase/MXLInstrume
|
|
|
6
6
|
const PATH_OPTIONS_RE = /\([^()]+\)/g;
|
|
7
7
|
var NavigationInstrumentation = class extends MXLInstrumentationBase {
|
|
8
8
|
_shouldCleanupPathOptionsFromRouteName = true;
|
|
9
|
+
_pageManager;
|
|
9
10
|
_currentRouteSpan = null;
|
|
11
|
+
_currentRouteSpanUrl = null;
|
|
12
|
+
_currentRouteSpanPath = void 0;
|
|
10
13
|
_instrumentationType = "manual";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
constructor({ diag, shouldCleanupPathOptionsFromRouteName = true }) {
|
|
14
|
+
_removeRouteChangedListener = null;
|
|
15
|
+
constructor({ diag, shouldCleanupPathOptionsFromRouteName = true, pageManager }) {
|
|
14
16
|
super({
|
|
15
17
|
config: {},
|
|
16
18
|
diag,
|
|
@@ -18,83 +20,88 @@ var NavigationInstrumentation = class extends MXLInstrumentationBase {
|
|
|
18
20
|
instrumentationVersion: "1.0.0"
|
|
19
21
|
});
|
|
20
22
|
this._shouldCleanupPathOptionsFromRouteName = shouldCleanupPathOptionsFromRouteName;
|
|
21
|
-
|
|
23
|
+
this._pageManager = pageManager ?? page.getPageManager();
|
|
22
24
|
}
|
|
23
25
|
setInstrumentationType = (instrumentationType) => {
|
|
24
26
|
this._instrumentationType = instrumentationType;
|
|
25
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Compatibility entry point for callers that historically drove spans
|
|
30
|
+
* through the instrumentation. Prefer `page.setCurrentRoute` — this just
|
|
31
|
+
* forwards there so the page-manager listener opens/renames the span.
|
|
32
|
+
*/
|
|
26
33
|
setCurrentRoute = (route) => {
|
|
27
|
-
|
|
28
|
-
const currentRoute = page.getCurrentRoute();
|
|
29
|
-
const urlChanged = route.url !== currentRoute?.url;
|
|
30
|
-
page.setCurrentRoute(route);
|
|
31
|
-
if (urlChanged) {
|
|
32
|
-
this._endRouteSpan(currentRoute);
|
|
33
|
-
this._startRouteSpan(route);
|
|
34
|
-
analytics.screenView();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (!this._currentRouteSpan) {
|
|
38
|
-
this._startRouteSpan(route);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (currentRoute?.path !== route.path) {
|
|
42
|
-
this._endRouteSpan(currentRoute);
|
|
43
|
-
this._startRouteSpan(route);
|
|
44
|
-
}
|
|
34
|
+
this._pageManager.setCurrentRoute(route);
|
|
45
35
|
};
|
|
46
|
-
|
|
47
|
-
if (!this.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this._diag.debug("Session started, starting route span.");
|
|
52
|
-
this._startRouteSpan(currentRoute);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
if (!this._removeSessionEndedFn) this._removeSessionEndedFn = this.userSessionManager.addSessionPartEndedListener(() => {
|
|
56
|
-
if (this._currentRouteSpan) {
|
|
57
|
-
this._diag.debug("Session ended, ending route span.");
|
|
58
|
-
this._endRouteSpan(page.getCurrentRoute());
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
_cleanUpSessionListeners = () => {
|
|
63
|
-
if (this._removeSessionStartedFn) {
|
|
64
|
-
this._removeSessionStartedFn();
|
|
65
|
-
this._removeSessionStartedFn = null;
|
|
66
|
-
}
|
|
67
|
-
if (this._removeSessionEndedFn) {
|
|
68
|
-
this._removeSessionEndedFn();
|
|
69
|
-
this._removeSessionEndedFn = null;
|
|
36
|
+
_onRouteChanged = (route) => {
|
|
37
|
+
if (!this._isEnabled) return;
|
|
38
|
+
if (this._currentRouteSpan && this._currentRouteSpanUrl === route.url) {
|
|
39
|
+
if (route.path && this._currentRouteSpanPath !== route.path) this._renameCurrentRouteSpan(route);
|
|
40
|
+
return;
|
|
70
41
|
}
|
|
42
|
+
const previousUrl = this._currentRouteSpanUrl;
|
|
43
|
+
this._endRouteSpan();
|
|
44
|
+
this._startRouteSpan(route);
|
|
45
|
+
if (previousUrl !== null && previousUrl !== route.url) analytics.screenView();
|
|
71
46
|
};
|
|
72
47
|
_startRouteSpan = (route) => {
|
|
73
48
|
this._diag.debug(`Starting route span for url: ${route.url}`);
|
|
74
|
-
this.
|
|
75
|
-
const pathName = this._shouldCleanupPathOptionsFromRouteName ? route.path.replace(PATH_OPTIONS_RE, "") : route.path;
|
|
49
|
+
const pathName = this._resolveRouteName(route);
|
|
76
50
|
this._currentRouteSpan = this.tracer.startSpan(pathName, { attributes: {
|
|
77
51
|
[KEY_MXL_TYPE]: "ux.surface",
|
|
78
|
-
[KEY_MXL_PAGE_PATH]: pathName,
|
|
79
|
-
[KEY_MXL_PAGE_ID]:
|
|
52
|
+
[KEY_MXL_PAGE_PATH]: route.path ? pathName : void 0,
|
|
53
|
+
[KEY_MXL_PAGE_ID]: this._pageManager.getCurrentPageId() || void 0
|
|
80
54
|
} });
|
|
55
|
+
this._currentRouteSpanUrl = route.url;
|
|
56
|
+
this._currentRouteSpanPath = route.path;
|
|
81
57
|
this._currentRouteSpan.setAttribute(KEY_MXL_INSTRUMENTATION, this._instrumentationType);
|
|
82
58
|
return this._currentRouteSpan;
|
|
83
59
|
};
|
|
84
|
-
_endRouteSpan = (
|
|
60
|
+
_endRouteSpan = () => {
|
|
85
61
|
if (this._currentRouteSpan) {
|
|
86
|
-
|
|
62
|
+
this._diag.debug(`Ending route span for url: ${this._currentRouteSpanUrl ?? "unknown"}`);
|
|
87
63
|
this._currentRouteSpan.end();
|
|
88
64
|
this._currentRouteSpan = null;
|
|
65
|
+
this._currentRouteSpanUrl = null;
|
|
66
|
+
this._currentRouteSpanPath = void 0;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
_renameCurrentRouteSpan = (route) => {
|
|
70
|
+
const pathName = this._resolveRouteName(route);
|
|
71
|
+
this._diag.debug(`Resolved route span path to: ${pathName}`);
|
|
72
|
+
this._currentRouteSpan?.updateName(pathName);
|
|
73
|
+
this._currentRouteSpan?.setAttribute(KEY_MXL_PAGE_PATH, pathName);
|
|
74
|
+
this._currentRouteSpanPath = route.path;
|
|
75
|
+
};
|
|
76
|
+
_resolveRouteName = (route) => {
|
|
77
|
+
const pathName = route.path ?? route.url;
|
|
78
|
+
return this._shouldCleanupPathOptionsFromRouteName ? pathName.replace(PATH_OPTIONS_RE, "") : pathName;
|
|
79
|
+
};
|
|
80
|
+
_onSessionPartEnded = () => {
|
|
81
|
+
if (this._currentRouteSpan) {
|
|
82
|
+
this._diag.debug("Session ended, ending route span.");
|
|
83
|
+
this._endRouteSpan();
|
|
89
84
|
}
|
|
90
85
|
};
|
|
86
|
+
_onSessionPartStarted = ({ reason }) => {
|
|
87
|
+
if (reason === "web_soft_navigation") return;
|
|
88
|
+
const currentRoute = this._pageManager.getCurrentRoute();
|
|
89
|
+
if (currentRoute) this._onRouteChanged(currentRoute);
|
|
90
|
+
};
|
|
91
91
|
onEnable() {
|
|
92
|
-
this.
|
|
92
|
+
this._removeRouteChangedListener = this._pageManager.addRouteChangedListener(this._onRouteChanged);
|
|
93
|
+
this.setSessionPartListeners({
|
|
94
|
+
end: this._onSessionPartEnded,
|
|
95
|
+
start: this._onSessionPartStarted
|
|
96
|
+
});
|
|
97
|
+
const currentRoute = this._pageManager.getCurrentRoute();
|
|
98
|
+
if (currentRoute) this._onRouteChanged(currentRoute);
|
|
93
99
|
this._diag.debug("NavigationInstrumentation enabled, listening for navigation events.");
|
|
94
100
|
}
|
|
95
101
|
onDisable() {
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
102
|
+
this._removeRouteChangedListener?.();
|
|
103
|
+
this._removeRouteChangedListener = null;
|
|
104
|
+
this._endRouteSpan();
|
|
98
105
|
this._diag.debug("NavigationInstrumentation disabled, stopped listening for navigation events.");
|
|
99
106
|
}
|
|
100
107
|
};
|
package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { analytics } from '../../../api-analytics/analyticsAPI';\nimport type { Route } from '../../../api-page/manager/types';\nimport { page } from '../../../api-page/pageAPI';\nimport type { SessionPartStartedEvent } from '../../../api-sessions/manager/types';\nimport {\n KEY_MXL_INSTRUMENTATION,\n KEY_MXL_PAGE_ID,\n KEY_MXL_PAGE_PATH,\n KEY_MXL_TYPE,\n MXL_NAVIGATION_INSTRUMENTATIONS,\n MXL_TYPES,\n} from '../../../constants/attributes';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/MXLInstrumentationBase';\nimport type { NavigationInstrumentationArgs } from './types';\n\n// Regular expression to match path options in the format \"(option)\"\n// Used to clean up paths that are like \"/order/:orderState(pending|shipped|delivered)/type:(sale|normal)\" to \"/order/:orderState/:type\"\n// Could be simplified but done this way to prevent: https://javascript.info/regexp-catastrophic-backtracking\nconst PATH_OPTIONS_RE = /\\([^()]+\\)/g;\n\nexport class NavigationInstrumentation extends MXLInstrumentationBase {\n private readonly _shouldCleanupPathOptionsFromRouteName: boolean = true;\n private _currentRouteSpan: Span | null = null;\n private
|
|
1
|
+
{"version":3,"file":"NavigationInstrumentation.js","names":[],"sources":["../../../../src/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { analytics } from '../../../api-analytics/analyticsAPI';\nimport type { PageManager, Route } from '../../../api-page/manager/types';\nimport { page } from '../../../api-page/pageAPI';\nimport type { SessionPartStartedEvent } from '../../../api-sessions/manager/types';\nimport {\n KEY_MXL_INSTRUMENTATION,\n KEY_MXL_PAGE_ID,\n KEY_MXL_PAGE_PATH,\n KEY_MXL_TYPE,\n MXL_NAVIGATION_INSTRUMENTATIONS,\n MXL_TYPES,\n} from '../../../constants/attributes';\nimport { MXLInstrumentationBase } from '../../MXLInstrumentationBase/MXLInstrumentationBase';\nimport type { NavigationInstrumentationArgs } from './types';\n\n// Regular expression to match path options in the format \"(option)\"\n// Used to clean up paths that are like \"/order/:orderState(pending|shipped|delivered)/type:(sale|normal)\" to \"/order/:orderState/:type\"\n// Could be simplified but done this way to prevent: https://javascript.info/regexp-catastrophic-backtracking\nconst PATH_OPTIONS_RE = /\\([^()]+\\)/g;\n\nexport class NavigationInstrumentation extends MXLInstrumentationBase {\n private readonly _shouldCleanupPathOptionsFromRouteName: boolean = true;\n private readonly _pageManager: PageManager;\n private _currentRouteSpan: Span | null = null;\n private _currentRouteSpanUrl: string | null = null;\n private _currentRouteSpanPath: string | undefined = undefined;\n private _instrumentationType: MXL_NAVIGATION_INSTRUMENTATIONS =\n MXL_NAVIGATION_INSTRUMENTATIONS.Manual;\n private _removeRouteChangedListener: (() => void) | null = null;\n\n public constructor({\n diag,\n shouldCleanupPathOptionsFromRouteName = true,\n pageManager,\n }: NavigationInstrumentationArgs) {\n super({\n config: {},\n diag,\n instrumentationName: 'NavigationInstrumentation',\n instrumentationVersion: '1.0.0',\n });\n\n this._shouldCleanupPathOptionsFromRouteName =\n shouldCleanupPathOptionsFromRouteName;\n this._pageManager = pageManager ?? page.getPageManager();\n }\n\n public setInstrumentationType = (\n instrumentationType: MXL_NAVIGATION_INSTRUMENTATIONS,\n ) => {\n this._instrumentationType = instrumentationType;\n };\n\n /**\n * Compatibility entry point for callers that historically drove spans\n * through the instrumentation. Prefer `page.setCurrentRoute` — this just\n * forwards there so the page-manager listener opens/renames the span.\n */\n public setCurrentRoute = (route: Route) => {\n this._pageManager.setCurrentRoute(route);\n };\n\n private readonly _onRouteChanged = (route: Route): void => {\n if (!this._isEnabled) {\n return;\n }\n\n if (this._currentRouteSpan && this._currentRouteSpanUrl === route.url) {\n // Same url as the currently open span: either the templated path just\n // resolved/changed (rename in place), or a redundant replay — no-op if\n // there's no new path to apply (path still unknown, or unchanged).\n if (route.path && this._currentRouteSpanPath !== route.path) {\n this._renameCurrentRouteSpan(route);\n }\n return;\n }\n\n const previousUrl = this._currentRouteSpanUrl;\n this._endRouteSpan();\n this._startRouteSpan(route);\n\n // Soft navigations already emit screenView from MXLPageManager. This covers\n // React-driven route changes in browsers without the Navigation API.\n if (previousUrl !== null && previousUrl !== route.url) {\n analytics.screenView();\n }\n };\n\n private readonly _startRouteSpan = (route: Route): Span => {\n this._diag.debug(`Starting route span for url: ${route.url}`);\n\n const pathName = this._resolveRouteName(route);\n this._currentRouteSpan = this.tracer.startSpan(pathName, {\n attributes: {\n [KEY_MXL_TYPE]: MXL_TYPES.Surface,\n [KEY_MXL_PAGE_PATH]: route.path ? pathName : undefined,\n [KEY_MXL_PAGE_ID]: this._pageManager.getCurrentPageId() || undefined,\n },\n });\n this._currentRouteSpanUrl = route.url;\n this._currentRouteSpanPath = route.path;\n\n this._currentRouteSpan.setAttribute(\n KEY_MXL_INSTRUMENTATION,\n this._instrumentationType,\n );\n\n return this._currentRouteSpan;\n };\n\n private readonly _endRouteSpan = (): void => {\n if (this._currentRouteSpan) {\n this._diag.debug(\n `Ending route span for url: ${this._currentRouteSpanUrl ?? 'unknown'}`,\n );\n\n this._currentRouteSpan.end();\n this._currentRouteSpan = null;\n this._currentRouteSpanUrl = null;\n this._currentRouteSpanPath = undefined;\n }\n };\n\n private readonly _renameCurrentRouteSpan = (route: Route): void => {\n const pathName = this._resolveRouteName(route);\n this._diag.debug(`Resolved route span path to: ${pathName}`);\n\n this._currentRouteSpan?.updateName(pathName);\n this._currentRouteSpan?.setAttribute(KEY_MXL_PAGE_PATH, pathName);\n this._currentRouteSpanPath = route.path;\n };\n\n private readonly _resolveRouteName = (route: Route): string => {\n const pathName = route.path ?? route.url;\n\n return this._shouldCleanupPathOptionsFromRouteName\n ? pathName.replace(PATH_OPTIONS_RE, '')\n : pathName;\n };\n\n // A route span must not outlive the session part it started in — e.g. the\n // tab backgrounds, or the session ends, with no further navigation to\n // trigger _onRouteChanged.\n private readonly _onSessionPartEnded = (): void => {\n if (this._currentRouteSpan) {\n this._diag.debug('Session ended, ending route span.');\n this._endRouteSpan();\n }\n };\n\n // Only needed when a session part starts with no route change (e.g.\n // resuming after background/inactivity). Skipped for soft-nav rollovers,\n // since the real new route is reported right after (see\n // MXLPageManager._onSoftNavigation).\n private readonly _onSessionPartStarted = ({\n reason,\n }: SessionPartStartedEvent): void => {\n if (reason === 'web_soft_navigation') {\n return;\n }\n\n const currentRoute = this._pageManager.getCurrentRoute();\n if (currentRoute) {\n this._onRouteChanged(currentRoute);\n }\n };\n\n protected override onEnable(): void {\n this._removeRouteChangedListener =\n this._pageManager.addRouteChangedListener(this._onRouteChanged);\n this.setSessionPartListeners({\n end: this._onSessionPartEnded,\n start: this._onSessionPartStarted,\n });\n\n // No route listener exists while disabled, so a route set before enabling\n // is replayed here to open its span.\n const currentRoute = this._pageManager.getCurrentRoute();\n if (currentRoute) {\n this._onRouteChanged(currentRoute);\n }\n\n this._diag.debug(\n 'NavigationInstrumentation enabled, listening for navigation events.',\n );\n }\n\n protected override onDisable(): void {\n this._removeRouteChangedListener?.();\n this._removeRouteChangedListener = null;\n this._endRouteSpan();\n this._diag.debug(\n 'NavigationInstrumentation disabled, stopped listening for navigation events.',\n );\n }\n}\n"],"mappings":";;;;;AAmBA,MAAM,kBAAkB;AAExB,IAAa,4BAAb,cAA+C,uBAAuB;CACpE,yCAAmE;CACnE;CACA,oBAAyC;CACzC,uBAA8C;CAC9C,wBAAoD,KAAA;CACpD,uBAAQ;CAER,8BAA2D;CAE3D,YAAmB,EACjB,MACA,wCAAwC,MACxC,eACgC;AAChC,QAAM;GACJ,QAAQ,EAAE;GACV;GACA,qBAAqB;GACrB,wBAAwB;GACzB,CAAC;AAEF,OAAK,yCACH;AACF,OAAK,eAAe,eAAe,KAAK,gBAAgB;;CAG1D,0BACE,wBACG;AACH,OAAK,uBAAuB;;;;;;;CAQ9B,mBAA0B,UAAiB;AACzC,OAAK,aAAa,gBAAgB,MAAM;;CAG1C,mBAAoC,UAAuB;AACzD,MAAI,CAAC,KAAK,WACR;AAGF,MAAI,KAAK,qBAAqB,KAAK,yBAAyB,MAAM,KAAK;AAIrE,OAAI,MAAM,QAAQ,KAAK,0BAA0B,MAAM,KACrD,MAAK,wBAAwB,MAAM;AAErC;;EAGF,MAAM,cAAc,KAAK;AACzB,OAAK,eAAe;AACpB,OAAK,gBAAgB,MAAM;AAI3B,MAAI,gBAAgB,QAAQ,gBAAgB,MAAM,IAChD,WAAU,YAAY;;CAI1B,mBAAoC,UAAuB;AACzD,OAAK,MAAM,MAAM,gCAAgC,MAAM,MAAM;EAE7D,MAAM,WAAW,KAAK,kBAAkB,MAAM;AAC9C,OAAK,oBAAoB,KAAK,OAAO,UAAU,UAAU,EACvD,YAAY;IACT,eAAA;IACA,oBAAoB,MAAM,OAAO,WAAW,KAAA;IAC5C,kBAAkB,KAAK,aAAa,kBAAkB,IAAI,KAAA;GAC5D,EACF,CAAC;AACF,OAAK,uBAAuB,MAAM;AAClC,OAAK,wBAAwB,MAAM;AAEnC,OAAK,kBAAkB,aACrB,yBACA,KAAK,qBACN;AAED,SAAO,KAAK;;CAGd,sBAA6C;AAC3C,MAAI,KAAK,mBAAmB;AAC1B,QAAK,MAAM,MACT,8BAA8B,KAAK,wBAAwB,YAC5D;AAED,QAAK,kBAAkB,KAAK;AAC5B,QAAK,oBAAoB;AACzB,QAAK,uBAAuB;AAC5B,QAAK,wBAAwB,KAAA;;;CAIjC,2BAA4C,UAAuB;EACjE,MAAM,WAAW,KAAK,kBAAkB,MAAM;AAC9C,OAAK,MAAM,MAAM,gCAAgC,WAAW;AAE5D,OAAK,mBAAmB,WAAW,SAAS;AAC5C,OAAK,mBAAmB,aAAa,mBAAmB,SAAS;AACjE,OAAK,wBAAwB,MAAM;;CAGrC,qBAAsC,UAAyB;EAC7D,MAAM,WAAW,MAAM,QAAQ,MAAM;AAErC,SAAO,KAAK,yCACR,SAAS,QAAQ,iBAAiB,GAAG,GACrC;;CAMN,4BAAmD;AACjD,MAAI,KAAK,mBAAmB;AAC1B,QAAK,MAAM,MAAM,oCAAoC;AACrD,QAAK,eAAe;;;CAQxB,yBAA0C,EACxC,aACmC;AACnC,MAAI,WAAW,sBACb;EAGF,MAAM,eAAe,KAAK,aAAa,iBAAiB;AACxD,MAAI,aACF,MAAK,gBAAgB,aAAa;;CAItC,WAAoC;AAClC,OAAK,8BACH,KAAK,aAAa,wBAAwB,KAAK,gBAAgB;AACjE,OAAK,wBAAwB;GAC3B,KAAK,KAAK;GACV,OAAO,KAAK;GACb,CAAC;EAIF,MAAM,eAAe,KAAK,aAAa,iBAAiB;AACxD,MAAI,aACF,MAAK,gBAAgB,aAAa;AAGpC,OAAK,MAAM,MACT,sEACD;;CAGH,YAAqC;AACnC,OAAK,+BAA+B;AACpC,OAAK,8BAA8B;AACnC,OAAK,eAAe;AACpB,OAAK,MAAM,MACT,+EACD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_api_page_pageAPI = require("../../../../../api-page/pageAPI.cjs");
|
|
3
4
|
require("../../../../../constants/attributes.cjs");
|
|
4
5
|
const require_instrumentations_navigation_NavigationInstrumentation_instance = require("../../instance.cjs");
|
|
5
6
|
const require_hoist_non_react_statics_cjs$1 = require("../../../../../node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.cjs");
|
|
@@ -8,12 +9,11 @@ react = require_runtime.__toESM(react, 1);
|
|
|
8
9
|
//#region src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts
|
|
9
10
|
var import_hoist_non_react_statics_cjs = /* @__PURE__ */ require_runtime.__toESM(require_hoist_non_react_statics_cjs$1.default, 1);
|
|
10
11
|
const withMXLRoutingLegacy = (WrappedComponent) => {
|
|
11
|
-
|
|
12
|
-
navigationInstrumentation.setInstrumentationType("react_router_declarative_legacy");
|
|
12
|
+
require_instrumentations_navigation_NavigationInstrumentation_instance.getNavigationInstrumentation().setInstrumentationType("react_router_declarative_legacy");
|
|
13
13
|
const RouteWithMXLRoutingLegacy = (props) => {
|
|
14
14
|
if (props.path) {
|
|
15
15
|
const routeProps = props;
|
|
16
|
-
if (routeProps.computedMatch)
|
|
16
|
+
if (routeProps.computedMatch) require_api_page_pageAPI.page.setCurrentRoute({
|
|
17
17
|
path: routeProps.computedMatch.path,
|
|
18
18
|
url: routeProps.computedMatch.url
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRoutingLegacy.cjs","names":["getNavigationInstrumentation","React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RouteComponentProps, SwitchedRouteComponentProps } from './types';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/
|
|
1
|
+
{"version":3,"file":"withMXLRoutingLegacy.cjs","names":["getNavigationInstrumentation","React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { page } from '../../../../../api-page/pageAPI';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RouteComponentProps, SwitchedRouteComponentProps } from './types';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/reactjs/react-router/blob/v5.3.4/packages/react-router/modules/Switch.js#L40\n // It shouldn't change as this version is legacy, and it's not being actively worked on\n if (routeProps.computedMatch) {\n page.setCurrentRoute({\n path: routeProps.computedMatch.path,\n url: routeProps.computedMatch.url,\n });\n }\n }\n\n return React.createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RouteWithMXLRoutingLegacy.displayName = `withMXLRoutingLegacy(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RouteWithMXLRoutingLegacy, WrappedComponent);\n\n return RouteWithMXLRoutingLegacy;\n};\n"],"mappings":";;;;;;;;;;AAOA,MAAa,wBACX,qBACG;AAC+BA,wEAAAA,8BACT,CAAC,uBAAA,kCAEzB;CAED,MAAM,6BAA0C,UAAa;AAE3D,MAAI,MAAM,MAAM;GAGd,MAAM,aAAa;AAKnB,OAAI,WAAW,cACb,0BAAA,KAAK,gBAAgB;IACnB,MAAM,WAAW,cAAc;IAC/B,KAAK,WAAW,cAAc;IAC/B,CAAC;;AAIN,SAAOC,MAAM,cAAiB,kBAAkB,MAAM;;AAIxD,2BAA0B,cAAc,wBAAwB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AACrI,EAAA,GAAA,mCAAA,SAAqB,2BAA2B,iBAAiB;AAEjE,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRoutingLegacy.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"withMXLRoutingLegacy.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;cAOa,oBAAA,aAAkC,mBAAA,EAC7C,gBAAA,EAAkB,OAAA,CAAM,aAAA,CAAc,CAAA,MAAE,OAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRoutingLegacy.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"withMXLRoutingLegacy.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"mappings":";;;;cAOa,oBAAA,aAAkC,mBAAA,EAC7C,gBAAA,EAAkB,OAAA,CAAM,aAAA,CAAc,CAAA,MAAE,OAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __toESM } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { page } from "../../../../../api-page/pageAPI.js";
|
|
2
3
|
import "../../../../../constants/attributes.js";
|
|
3
4
|
import { getNavigationInstrumentation } from "../../instance.js";
|
|
4
5
|
import { require_hoist_non_react_statics_cjs } from "../../../../../node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";
|
|
@@ -6,12 +7,11 @@ import * as React$1 from "react";
|
|
|
6
7
|
//#region src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts
|
|
7
8
|
var import_hoist_non_react_statics_cjs = /* @__PURE__ */ __toESM(require_hoist_non_react_statics_cjs(), 1);
|
|
8
9
|
const withMXLRoutingLegacy = (WrappedComponent) => {
|
|
9
|
-
|
|
10
|
-
navigationInstrumentation.setInstrumentationType("react_router_declarative_legacy");
|
|
10
|
+
getNavigationInstrumentation().setInstrumentationType("react_router_declarative_legacy");
|
|
11
11
|
const RouteWithMXLRoutingLegacy = (props) => {
|
|
12
12
|
if (props.path) {
|
|
13
13
|
const routeProps = props;
|
|
14
|
-
if (routeProps.computedMatch)
|
|
14
|
+
if (routeProps.computedMatch) page.setCurrentRoute({
|
|
15
15
|
path: routeProps.computedMatch.path,
|
|
16
16
|
url: routeProps.computedMatch.url
|
|
17
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRoutingLegacy.js","names":["React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RouteComponentProps, SwitchedRouteComponentProps } from './types';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/
|
|
1
|
+
{"version":3,"file":"withMXLRoutingLegacy.js","names":["React"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { page } from '../../../../../api-page/pageAPI';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RouteComponentProps, SwitchedRouteComponentProps } from './types';\n\nexport const withMXLRoutingLegacy = <P extends RouteComponentProps>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.DeclarativeLegacy,\n );\n\n const RouteWithMXLRoutingLegacy: React.FC<P> = (props: P) => {\n // Make sure this is Route component\n if (props.path) {\n // Routes get injected with computedMatch when they are children of a <Switch> but the types do not reflect that\n // Manually setting the type here.\n const routeProps = props as SwitchedRouteComponentProps;\n\n // Depends on this internal behaviour\n // https://github.com/reactjs/react-router/blob/v5.3.4/packages/react-router/modules/Switch.js#L40\n // It shouldn't change as this version is legacy, and it's not being actively worked on\n if (routeProps.computedMatch) {\n page.setCurrentRoute({\n path: routeProps.computedMatch.path,\n url: routeProps.computedMatch.url,\n });\n }\n }\n\n return React.createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RouteWithMXLRoutingLegacy.displayName = `withMXLRoutingLegacy(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RouteWithMXLRoutingLegacy, WrappedComponent);\n\n return RouteWithMXLRoutingLegacy;\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,wBACX,qBACG;AAC+B,+BACT,CAAC,uBAAA,kCAEzB;CAED,MAAM,6BAA0C,UAAa;AAE3D,MAAI,MAAM,MAAM;GAGd,MAAM,aAAa;AAKnB,OAAI,WAAW,cACb,MAAK,gBAAgB;IACnB,MAAM,WAAW,cAAc;IAC/B,KAAK,WAAW,cAAc;IAC/B,CAAC;;AAIN,SAAOA,QAAM,cAAiB,kBAAkB,MAAM;;AAIxD,2BAA0B,cAAc,wBAAwB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AACrI,EAAA,GAAA,mCAAA,SAAqB,2BAA2B,iBAAiB;AAEjE,QAAO"}
|
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_api_page_pageAPI = require("../../../../../api-page/pageAPI.cjs");
|
|
2
3
|
require("../../../../../constants/attributes.cjs");
|
|
3
4
|
const require_instrumentations_navigation_NavigationInstrumentation_instance = require("../../instance.cjs");
|
|
4
5
|
//#region src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Filtering by currentPathname ensures that we only consider routes that are relevant to the current URL.
|
|
7
|
+
* matchRoutes already scopes `matches` to the given pathname, ordered from
|
|
8
|
+
* the root route to the deepest one, so the full pattern is built by
|
|
9
|
+
* reducing over all of them. Pathless layout and index routes contribute no
|
|
10
|
+
* `route.path` of their own, so they're skipped.
|
|
11
11
|
*/
|
|
12
12
|
const getRouteFromMatches = (matches, currentPathname) => {
|
|
13
|
-
|
|
14
|
-
if (currentMatchIndex === -1 || !matches[currentMatchIndex].route.path) return null;
|
|
15
|
-
return matches.slice(0, currentMatchIndex + 1).reduce((acc, match) => {
|
|
13
|
+
return matches.reduce((acc, match) => {
|
|
16
14
|
const routePath = match.route.path;
|
|
17
15
|
if (!routePath) return acc;
|
|
18
16
|
return {
|
|
19
17
|
path: routePath.startsWith("/") ? routePath : `${acc?.path ?? ""}/${routePath}`,
|
|
20
|
-
url:
|
|
18
|
+
url: currentPathname
|
|
21
19
|
};
|
|
22
20
|
}, null);
|
|
23
21
|
};
|
|
24
22
|
const listenToRouterChanges = ({ router, routesMatcher, config: { pathnameDocument = window.location } = {} }) => {
|
|
25
|
-
|
|
26
|
-
navigationInstrumentation.setInstrumentationType("react_router_data");
|
|
23
|
+
require_instrumentations_navigation_NavigationInstrumentation_instance.getNavigationInstrumentation().setInstrumentationType("react_router_data");
|
|
27
24
|
const initialMatches = routesMatcher(router.routes, { pathname: pathnameDocument.pathname });
|
|
28
25
|
const initialRoute = initialMatches ? getRouteFromMatches(initialMatches, pathnameDocument.pathname) : null;
|
|
29
|
-
if (initialRoute)
|
|
26
|
+
if (initialRoute) require_api_page_pageAPI.page.setCurrentRoute(initialRoute);
|
|
30
27
|
return router.subscribe((state) => {
|
|
31
28
|
const currentRoute = getRouteFromMatches(state.matches, state.location.pathname);
|
|
32
|
-
if (currentRoute)
|
|
29
|
+
if (currentRoute) require_api_page_pageAPI.page.setCurrentRoute(currentRoute);
|
|
33
30
|
});
|
|
34
31
|
};
|
|
35
32
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listenToRouterChanges.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page/manager/types';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { ListenToRouterChangesArgs, Match } from './types';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"listenToRouterChanges.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page/manager/types';\nimport { page } from '../../../../../api-page/pageAPI';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { ListenToRouterChangesArgs, Match } from './types';\n\n/**\n * matchRoutes already scopes `matches` to the given pathname, ordered from\n * the root route to the deepest one, so the full pattern is built by\n * reducing over all of them. Pathless layout and index routes contribute no\n * `route.path` of their own, so they're skipped.\n */\nconst getRouteFromMatches = (\n matches: Match[],\n currentPathname: string,\n): Route | null => {\n return matches.reduce<Route | null>((acc, match) => {\n const routePath = match.route.path;\n\n if (!routePath) {\n return acc;\n }\n\n // If the route path starts with '/', it's an absolute path and should reset the accumulated path.\n // Otherwise, it's a relative path and should be appended to the accumulated path.\n const path = routePath.startsWith('/')\n ? routePath\n : `${acc?.path ?? ''}/${routePath}`;\n\n return { path, url: currentPathname };\n }, null);\n};\n\nexport const listenToRouterChanges = ({\n router,\n routesMatcher,\n config: { pathnameDocument = window.location } = {},\n}: ListenToRouterChangesArgs) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Data,\n );\n\n const initialMatches = routesMatcher(router.routes, {\n pathname: pathnameDocument.pathname,\n });\n\n const initialRoute = initialMatches\n ? getRouteFromMatches(initialMatches, pathnameDocument.pathname)\n : null;\n\n if (initialRoute) {\n page.setCurrentRoute(initialRoute);\n }\n\n return router.subscribe((state) => {\n // State has a list of already matched routes\n // https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/router.ts#L954\n const currentRoute = getRouteFromMatches(\n state.matches,\n state.location.pathname,\n );\n\n if (currentRoute) {\n page.setCurrentRoute(currentRoute);\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,uBACJ,SACA,oBACiB;AACjB,QAAO,QAAQ,QAAsB,KAAK,UAAU;EAClD,MAAM,YAAY,MAAM,MAAM;AAE9B,MAAI,CAAC,UACH,QAAO;AAST,SAAO;GAAE,MAJI,UAAU,WAAW,IAAI,GAClC,YACA,GAAG,KAAK,QAAQ,GAAG,GAAG;GAEX,KAAK;GAAiB;IACpC,KAAK;;AAGV,MAAa,yBAAyB,EACpC,QACA,eACA,QAAQ,EAAE,mBAAmB,OAAO,aAAa,EAAE,OACpB;AACGA,wEAAAA,8BACT,CAAC,uBAAA,oBAEzB;CAED,MAAM,iBAAiB,cAAc,OAAO,QAAQ,EAClD,UAAU,iBAAiB,UAC5B,CAAC;CAEF,MAAM,eAAe,iBACjB,oBAAoB,gBAAgB,iBAAiB,SAAS,GAC9D;AAEJ,KAAI,aACF,0BAAA,KAAK,gBAAgB,aAAa;AAGpC,QAAO,OAAO,WAAW,UAAU;EAGjC,MAAM,eAAe,oBACnB,MAAM,SACN,MAAM,SAAS,SAChB;AAED,MAAI,aACF,0BAAA,KAAK,gBAAgB,aAAa;GAEpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listenToRouterChanges.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"listenToRouterChanges.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"mappings":";;;cAiCa,qBAAA;EAAyB,MAAA;EAAA,aAAA;EAAA,MAAA;IAAA;EAAA;AAAA,GAInC,yBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listenToRouterChanges.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"listenToRouterChanges.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"mappings":";;;cAiCa,qBAAA;EAAyB,MAAA;EAAA,aAAA;EAAA,MAAA;IAAA;EAAA;AAAA,GAInC,yBAAA"}
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
+
import { page } from "../../../../../api-page/pageAPI.js";
|
|
1
2
|
import "../../../../../constants/attributes.js";
|
|
2
3
|
import { getNavigationInstrumentation } from "../../instance.js";
|
|
3
4
|
//#region src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Filtering by currentPathname ensures that we only consider routes that are relevant to the current URL.
|
|
6
|
+
* matchRoutes already scopes `matches` to the given pathname, ordered from
|
|
7
|
+
* the root route to the deepest one, so the full pattern is built by
|
|
8
|
+
* reducing over all of them. Pathless layout and index routes contribute no
|
|
9
|
+
* `route.path` of their own, so they're skipped.
|
|
10
10
|
*/
|
|
11
11
|
const getRouteFromMatches = (matches, currentPathname) => {
|
|
12
|
-
|
|
13
|
-
if (currentMatchIndex === -1 || !matches[currentMatchIndex].route.path) return null;
|
|
14
|
-
return matches.slice(0, currentMatchIndex + 1).reduce((acc, match) => {
|
|
12
|
+
return matches.reduce((acc, match) => {
|
|
15
13
|
const routePath = match.route.path;
|
|
16
14
|
if (!routePath) return acc;
|
|
17
15
|
return {
|
|
18
16
|
path: routePath.startsWith("/") ? routePath : `${acc?.path ?? ""}/${routePath}`,
|
|
19
|
-
url:
|
|
17
|
+
url: currentPathname
|
|
20
18
|
};
|
|
21
19
|
}, null);
|
|
22
20
|
};
|
|
23
21
|
const listenToRouterChanges = ({ router, routesMatcher, config: { pathnameDocument = window.location } = {} }) => {
|
|
24
|
-
|
|
25
|
-
navigationInstrumentation.setInstrumentationType("react_router_data");
|
|
22
|
+
getNavigationInstrumentation().setInstrumentationType("react_router_data");
|
|
26
23
|
const initialMatches = routesMatcher(router.routes, { pathname: pathnameDocument.pathname });
|
|
27
24
|
const initialRoute = initialMatches ? getRouteFromMatches(initialMatches, pathnameDocument.pathname) : null;
|
|
28
|
-
if (initialRoute)
|
|
25
|
+
if (initialRoute) page.setCurrentRoute(initialRoute);
|
|
29
26
|
return router.subscribe((state) => {
|
|
30
27
|
const currentRoute = getRouteFromMatches(state.matches, state.location.pathname);
|
|
31
|
-
if (currentRoute)
|
|
28
|
+
if (currentRoute) page.setCurrentRoute(currentRoute);
|
|
32
29
|
});
|
|
33
30
|
};
|
|
34
31
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listenToRouterChanges.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page/manager/types';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { ListenToRouterChangesArgs, Match } from './types';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"listenToRouterChanges.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.ts"],"sourcesContent":["import type { Route } from '../../../../../api-page/manager/types';\nimport { page } from '../../../../../api-page/pageAPI';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { ListenToRouterChangesArgs, Match } from './types';\n\n/**\n * matchRoutes already scopes `matches` to the given pathname, ordered from\n * the root route to the deepest one, so the full pattern is built by\n * reducing over all of them. Pathless layout and index routes contribute no\n * `route.path` of their own, so they're skipped.\n */\nconst getRouteFromMatches = (\n matches: Match[],\n currentPathname: string,\n): Route | null => {\n return matches.reduce<Route | null>((acc, match) => {\n const routePath = match.route.path;\n\n if (!routePath) {\n return acc;\n }\n\n // If the route path starts with '/', it's an absolute path and should reset the accumulated path.\n // Otherwise, it's a relative path and should be appended to the accumulated path.\n const path = routePath.startsWith('/')\n ? routePath\n : `${acc?.path ?? ''}/${routePath}`;\n\n return { path, url: currentPathname };\n }, null);\n};\n\nexport const listenToRouterChanges = ({\n router,\n routesMatcher,\n config: { pathnameDocument = window.location } = {},\n}: ListenToRouterChangesArgs) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Data,\n );\n\n const initialMatches = routesMatcher(router.routes, {\n pathname: pathnameDocument.pathname,\n });\n\n const initialRoute = initialMatches\n ? getRouteFromMatches(initialMatches, pathnameDocument.pathname)\n : null;\n\n if (initialRoute) {\n page.setCurrentRoute(initialRoute);\n }\n\n return router.subscribe((state) => {\n // State has a list of already matched routes\n // https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/router.ts#L954\n const currentRoute = getRouteFromMatches(\n state.matches,\n state.location.pathname,\n );\n\n if (currentRoute) {\n page.setCurrentRoute(currentRoute);\n }\n });\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAM,uBACJ,SACA,oBACiB;AACjB,QAAO,QAAQ,QAAsB,KAAK,UAAU;EAClD,MAAM,YAAY,MAAM,MAAM;AAE9B,MAAI,CAAC,UACH,QAAO;AAST,SAAO;GAAE,MAJI,UAAU,WAAW,IAAI,GAClC,YACA,GAAG,KAAK,QAAQ,GAAG,GAAG;GAEX,KAAK;GAAiB;IACpC,KAAK;;AAGV,MAAa,yBAAyB,EACpC,QACA,eACA,QAAQ,EAAE,mBAAmB,OAAO,aAAa,EAAE,OACpB;AACG,+BACT,CAAC,uBAAA,oBAEzB;CAED,MAAM,iBAAiB,cAAc,OAAO,QAAQ,EAClD,UAAU,iBAAiB,UAC5B,CAAC;CAEF,MAAM,eAAe,iBACjB,oBAAoB,gBAAgB,iBAAiB,SAAS,GAC9D;AAEJ,KAAI,aACF,MAAK,gBAAgB,aAAa;AAGpC,QAAO,OAAO,WAAW,UAAU;EAGjC,MAAM,eAAe,oBACnB,MAAM,SACN,MAAM,SAAS,SAChB;AAED,MAAI,aACF,MAAK,gBAAgB,aAAa;GAEpC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_api_page_pageAPI = require("../../../../../api-page/pageAPI.cjs");
|
|
3
4
|
require("../../../../../constants/attributes.cjs");
|
|
4
5
|
const require_instrumentations_navigation_NavigationInstrumentation_instance = require("../../instance.cjs");
|
|
5
6
|
const require_hoist_non_react_statics_cjs$1 = require("../../../../../node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.cjs");
|
|
@@ -9,7 +10,11 @@ var import_hoist_non_react_statics_cjs = /* @__PURE__ */ require_runtime.__toESM
|
|
|
9
10
|
const getLastRoute = (matchedComponent, lastRoute) => {
|
|
10
11
|
if (!matchedComponent.props.match?.route) return null;
|
|
11
12
|
const childPath = matchedComponent.props.match.route.path;
|
|
12
|
-
|
|
13
|
+
if (!childPath) {
|
|
14
|
+
if (matchedComponent.props.routeContext?.outlet) return getLastRoute(matchedComponent.props.routeContext.outlet, lastRoute);
|
|
15
|
+
return lastRoute;
|
|
16
|
+
}
|
|
17
|
+
const path = lastRoute?.path && !childPath.startsWith("/") ? `${lastRoute.path}/${childPath}` : childPath;
|
|
13
18
|
if (matchedComponent.props.routeContext?.outlet) return getLastRoute(matchedComponent.props.routeContext.outlet, {
|
|
14
19
|
path,
|
|
15
20
|
url: matchedComponent.props.match.pathname
|
|
@@ -20,8 +25,7 @@ const getLastRoute = (matchedComponent, lastRoute) => {
|
|
|
20
25
|
};
|
|
21
26
|
};
|
|
22
27
|
const withMXLRouting = (WrappedComponent) => {
|
|
23
|
-
|
|
24
|
-
navigationInstrumentation.setInstrumentationType("react_router_declarative");
|
|
28
|
+
require_instrumentations_navigation_NavigationInstrumentation_instance.getNavigationInstrumentation().setInstrumentationType("react_router_declarative");
|
|
25
29
|
const RoutesWithMXLRouting = (props) => {
|
|
26
30
|
/**
|
|
27
31
|
* React-router v6+ implementation is very different from v5
|
|
@@ -37,7 +41,7 @@ const withMXLRouting = (WrappedComponent) => {
|
|
|
37
41
|
const matchedComponent = WrappedComponent(props);
|
|
38
42
|
if (matchedComponent.props.match?.route) {
|
|
39
43
|
const lastRoute = getLastRoute(matchedComponent, null);
|
|
40
|
-
if (lastRoute)
|
|
44
|
+
if (lastRoute) require_api_page_pageAPI.page.setCurrentRoute(lastRoute);
|
|
41
45
|
}
|
|
42
46
|
return (0, react.createElement)(WrappedComponent, props);
|
|
43
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRouting.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page/manager/types';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RoutesFunctionalComponentReturn } from './types';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n const path =\n lastRoute && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n
|
|
1
|
+
{"version":3,"file":"withMXLRouting.cjs","names":["getNavigationInstrumentation"],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page/manager/types';\nimport { page } from '../../../../../api-page/pageAPI';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RoutesFunctionalComponentReturn } from './types';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n if (!childPath) {\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(\n matchedComponent.props.routeContext.outlet,\n lastRoute,\n );\n }\n return lastRoute;\n }\n\n const path =\n lastRoute?.path && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n page.setCurrentRoute(lastRoute);\n }\n }\n\n return createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RoutesWithMXLRouting.displayName = `withMXLRouting(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RoutesWithMXLRouting, WrappedComponent);\n\n return RoutesWithMXLRouting;\n};\n"],"mappings":";;;;;;;;;AAUA,MAAM,gBACJ,kBACA,cACiB;AACjB,KAAI,CAAC,iBAAiB,MAAM,OAAO,MACjC,QAAO;CAGT,MAAM,YAAY,iBAAiB,MAAM,MAAM,MAAM;AACrD,KAAI,CAAC,WAAW;AACd,MAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aACL,iBAAiB,MAAM,aAAa,QACpC,UACD;AAEH,SAAO;;CAGT,MAAM,OACJ,WAAW,QAAQ,CAAC,UAAU,WAAW,IAAI,GACzC,GAAG,UAAU,KAAK,GAAG,cACrB;AAEN,KAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aAAa,iBAAiB,MAAM,aAAa,QAAQ;EAC9D;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC,CAAC;AAGJ,QAAO;EACL;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC;;AAGH,MAAa,kBACX,qBACG;AAC+BA,wEAAAA,8BACT,CAAC,uBAAA,2BAEzB;CAED,MAAM,wBAAqC,UAAa;;;;;;;;;;;;EAYtD,MAAM,mBAAmB,iBACvB,MACD;AAED,MAAI,iBAAiB,MAAM,OAAO,OAAO;GACvC,MAAM,YAAY,aAAa,kBAAkB,KAAK;AACtD,OAAI,UACF,0BAAA,KAAK,gBAAgB,UAAU;;AAInC,UAAA,GAAA,MAAA,eAAwB,kBAAkB,MAAM;;AAIlD,sBAAqB,cAAc,kBAAkB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AAC1H,EAAA,GAAA,mCAAA,SAAqB,sBAAsB,iBAAiB;AAE5D,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRouting.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"withMXLRouting.d.cts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"mappings":";;;cA+Ca,cAAA,qBACX,gBAAA,EAAkB,KAAA,CAAM,iBAAA,CAAkB,CAAA,MAAE,KAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRouting.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"withMXLRouting.d.ts","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"mappings":";;;cA+Ca,cAAA,qBACX,gBAAA,EAAkB,KAAA,CAAM,iBAAA,CAAkB,CAAA,MAAE,KAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __toESM } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { page } from "../../../../../api-page/pageAPI.js";
|
|
2
3
|
import "../../../../../constants/attributes.js";
|
|
3
4
|
import { getNavigationInstrumentation } from "../../instance.js";
|
|
4
5
|
import { require_hoist_non_react_statics_cjs } from "../../../../../node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";
|
|
@@ -8,7 +9,11 @@ var import_hoist_non_react_statics_cjs = /* @__PURE__ */ __toESM(require_hoist_n
|
|
|
8
9
|
const getLastRoute = (matchedComponent, lastRoute) => {
|
|
9
10
|
if (!matchedComponent.props.match?.route) return null;
|
|
10
11
|
const childPath = matchedComponent.props.match.route.path;
|
|
11
|
-
|
|
12
|
+
if (!childPath) {
|
|
13
|
+
if (matchedComponent.props.routeContext?.outlet) return getLastRoute(matchedComponent.props.routeContext.outlet, lastRoute);
|
|
14
|
+
return lastRoute;
|
|
15
|
+
}
|
|
16
|
+
const path = lastRoute?.path && !childPath.startsWith("/") ? `${lastRoute.path}/${childPath}` : childPath;
|
|
12
17
|
if (matchedComponent.props.routeContext?.outlet) return getLastRoute(matchedComponent.props.routeContext.outlet, {
|
|
13
18
|
path,
|
|
14
19
|
url: matchedComponent.props.match.pathname
|
|
@@ -19,8 +24,7 @@ const getLastRoute = (matchedComponent, lastRoute) => {
|
|
|
19
24
|
};
|
|
20
25
|
};
|
|
21
26
|
const withMXLRouting = (WrappedComponent) => {
|
|
22
|
-
|
|
23
|
-
navigationInstrumentation.setInstrumentationType("react_router_declarative");
|
|
27
|
+
getNavigationInstrumentation().setInstrumentationType("react_router_declarative");
|
|
24
28
|
const RoutesWithMXLRouting = (props) => {
|
|
25
29
|
/**
|
|
26
30
|
* React-router v6+ implementation is very different from v5
|
|
@@ -36,7 +40,7 @@ const withMXLRouting = (WrappedComponent) => {
|
|
|
36
40
|
const matchedComponent = WrappedComponent(props);
|
|
37
41
|
if (matchedComponent.props.match?.route) {
|
|
38
42
|
const lastRoute = getLastRoute(matchedComponent, null);
|
|
39
|
-
if (lastRoute)
|
|
43
|
+
if (lastRoute) page.setCurrentRoute(lastRoute);
|
|
40
44
|
}
|
|
41
45
|
return createElement(WrappedComponent, props);
|
|
42
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMXLRouting.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page/manager/types';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RoutesFunctionalComponentReturn } from './types';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n const path =\n lastRoute && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n
|
|
1
|
+
{"version":3,"file":"withMXLRouting.js","names":[],"sources":["../../../../../../src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.ts"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type React from 'react';\nimport { createElement } from 'react';\nimport type { Route } from '../../../../../api-page/manager/types';\nimport { page } from '../../../../../api-page/pageAPI';\nimport { MXL_NAVIGATION_INSTRUMENTATIONS } from '../../../../../constants/attributes';\nimport { getNavigationInstrumentation } from '../../instance';\nimport type { RoutesFunctionalComponentReturn } from './types';\n\n// Routes can be nested, we need to traverse the routeContext to find the last route\nconst getLastRoute = (\n matchedComponent: RoutesFunctionalComponentReturn,\n lastRoute: Route | null,\n): Route | null => {\n if (!matchedComponent.props.match?.route) {\n return null;\n }\n\n const childPath = matchedComponent.props.match.route.path;\n if (!childPath) {\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(\n matchedComponent.props.routeContext.outlet,\n lastRoute,\n );\n }\n return lastRoute;\n }\n\n const path =\n lastRoute?.path && !childPath.startsWith('/')\n ? `${lastRoute.path}/${childPath}`\n : childPath;\n\n if (matchedComponent.props.routeContext?.outlet) {\n return getLastRoute(matchedComponent.props.routeContext.outlet, {\n path,\n url: matchedComponent.props.match.pathname,\n });\n }\n\n return {\n path,\n url: matchedComponent.props.match.pathname,\n };\n};\n\nexport const withMXLRouting = <P extends object>(\n WrappedComponent: React.FunctionComponent<P>,\n) => {\n const navigationInstrumentation = getNavigationInstrumentation();\n navigationInstrumentation.setInstrumentationType(\n MXL_NAVIGATION_INSTRUMENTATIONS.Declarative,\n );\n\n const RoutesWithMXLRouting: React.FC<P> = (props: P) => {\n /**\n * React-router v6+ implementation is very different from v5\n * It doesn't have a <Switch> component that injects props into <Route>\n * Instead, it has <Routes> which internally calculates the matched route\n * and returns it as a children, <Route> cannot be wrapped since it requires all children to be a <Route> component\n * here we rely on that matching to get the current route.\n * It's not ideal to rely on internal implementation details, but it's the easier way of getting the current route\n * without having to manually match it or using hooks on each children component\n *\n * See: https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L553\n */\n const matchedComponent = WrappedComponent(\n props,\n ) as unknown as RoutesFunctionalComponentReturn;\n\n if (matchedComponent.props.match?.route) {\n const lastRoute = getLastRoute(matchedComponent, null);\n if (lastRoute) {\n page.setCurrentRoute(lastRoute);\n }\n }\n\n return createElement<P>(WrappedComponent, props);\n };\n\n // Keep wrapped component metadata\n RoutesWithMXLRouting.displayName = `withMXLRouting(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;\n hoistNonReactStatics(RoutesWithMXLRouting, WrappedComponent);\n\n return RoutesWithMXLRouting;\n};\n"],"mappings":";;;;;;;;AAUA,MAAM,gBACJ,kBACA,cACiB;AACjB,KAAI,CAAC,iBAAiB,MAAM,OAAO,MACjC,QAAO;CAGT,MAAM,YAAY,iBAAiB,MAAM,MAAM,MAAM;AACrD,KAAI,CAAC,WAAW;AACd,MAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aACL,iBAAiB,MAAM,aAAa,QACpC,UACD;AAEH,SAAO;;CAGT,MAAM,OACJ,WAAW,QAAQ,CAAC,UAAU,WAAW,IAAI,GACzC,GAAG,UAAU,KAAK,GAAG,cACrB;AAEN,KAAI,iBAAiB,MAAM,cAAc,OACvC,QAAO,aAAa,iBAAiB,MAAM,aAAa,QAAQ;EAC9D;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC,CAAC;AAGJ,QAAO;EACL;EACA,KAAK,iBAAiB,MAAM,MAAM;EACnC;;AAGH,MAAa,kBACX,qBACG;AAC+B,+BACT,CAAC,uBAAA,2BAEzB;CAED,MAAM,wBAAqC,UAAa;;;;;;;;;;;;EAYtD,MAAM,mBAAmB,iBACvB,MACD;AAED,MAAI,iBAAiB,MAAM,OAAO,OAAO;GACvC,MAAM,YAAY,aAAa,kBAAkB,KAAK;AACtD,OAAI,UACF,MAAK,gBAAgB,UAAU;;AAInC,SAAO,cAAiB,kBAAkB,MAAM;;AAIlD,sBAAqB,cAAc,kBAAkB,iBAAiB,eAAe,iBAAiB,QAAQ,YAAY;AAC1H,EAAA,GAAA,mCAAA,SAAqB,sBAAsB,iBAAiB;AAE5D,QAAO"}
|