@nathanclaire/edge-telemetry-sdk 3.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +985 -185
- package/dist/appLifecycle-DS_fEclk.cjs +2 -0
- package/dist/appLifecycle-DS_fEclk.cjs.map +1 -0
- package/dist/appLifecycle-PffQ4vC1.js +24 -0
- package/dist/appLifecycle-PffQ4vC1.js.map +1 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs +2 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs.map +1 -0
- package/dist/autoTaps.native-DQCXevD7.js +66 -0
- package/dist/autoTaps.native-DQCXevD7.js.map +1 -0
- package/dist/crashHandler.web-6KvedEB-.cjs +2 -0
- package/dist/crashHandler.web-6KvedEB-.cjs.map +1 -0
- package/dist/crashHandler.web-BUlSXYoS.js +30 -0
- package/dist/crashHandler.web-BUlSXYoS.js.map +1 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs +2 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs.map +1 -0
- package/dist/crashHandlerNative.native-DsCRd-oN.js +39 -0
- package/dist/crashHandlerNative.native-DsCRd-oN.js.map +1 -0
- package/dist/deviceInfo.native-D5gNBG7m.cjs +2 -0
- package/dist/deviceInfo.native-D5gNBG7m.cjs.map +1 -0
- package/dist/deviceInfo.native-DiiHrnI3.js +53 -0
- package/dist/deviceInfo.native-DiiHrnI3.js.map +1 -0
- package/dist/deviceInfo.web-BHsjVveq.js +41 -0
- package/dist/deviceInfo.web-BHsjVveq.js.map +1 -0
- package/dist/deviceInfo.web-DGCUHAnv.cjs +2 -0
- package/dist/deviceInfo.web-DGCUHAnv.cjs.map +1 -0
- package/dist/deviceState.native-BEysbZ6O.js +58 -0
- package/dist/deviceState.native-BEysbZ6O.js.map +1 -0
- package/dist/deviceState.native-CrQMy11_.cjs +2 -0
- package/dist/deviceState.native-CrQMy11_.cjs.map +1 -0
- package/dist/deviceState.web-ByaQm9Ry.js +14 -0
- package/dist/deviceState.web-ByaQm9Ry.js.map +1 -0
- package/dist/deviceState.web-CSfUgHDU.cjs +2 -0
- package/dist/deviceState.web-CSfUgHDU.cjs.map +1 -0
- package/dist/frameTracker-9j0en6Zm.cjs +2 -0
- package/dist/frameTracker-9j0en6Zm.cjs.map +1 -0
- package/dist/frameTracker-BzXnxSkb.js +53 -0
- package/dist/frameTracker-BzXnxSkb.js.map +1 -0
- package/dist/httpAttributes-BWXOr4eP.js +70 -0
- package/dist/httpAttributes-BWXOr4eP.js.map +1 -0
- package/dist/httpAttributes-COY0_kiF.cjs +2 -0
- package/dist/httpAttributes-COY0_kiF.cjs.map +1 -0
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.cjs.map +1 -1
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.js +173 -81
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.cjs +1 -1
- package/dist/index.web.cjs.map +1 -1
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +107 -39
- package/dist/index.web.js.map +1 -1
- package/dist/interactionWeb.web-BWBjmovb.js +109 -0
- package/dist/interactionWeb.web-BWBjmovb.js.map +1 -0
- package/dist/interactionWeb.web-CKDJLD9r.cjs +2 -0
- package/dist/interactionWeb.web-CKDJLD9r.cjs.map +1 -0
- package/dist/interceptFetchWeb.web-DjSR_Rft.js +62 -0
- package/dist/interceptFetchWeb.web-DjSR_Rft.js.map +1 -0
- package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs +2 -0
- package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs.map +1 -0
- package/dist/interceptHttpNative.native-C5scIcgY.cjs +2 -0
- package/dist/interceptHttpNative.native-C5scIcgY.cjs.map +1 -0
- package/dist/interceptHttpNative.native-vF_Fksjk.js +18 -0
- package/dist/interceptHttpNative.native-vF_Fksjk.js.map +1 -0
- package/dist/loadingTime-Cj5Oh8lT.cjs +2 -0
- package/dist/loadingTime-Cj5Oh8lT.cjs.map +1 -0
- package/dist/loadingTime-DMc0zTY8.js +70 -0
- package/dist/loadingTime-DMc0zTY8.js.map +1 -0
- package/dist/memoryNative.native-CK3QFVjY.cjs +2 -0
- package/dist/memoryNative.native-CK3QFVjY.cjs.map +1 -0
- package/dist/memoryNative.native-DkA6f7id.js +54 -0
- package/dist/memoryNative.native-DkA6f7id.js.map +1 -0
- package/dist/nativeSender-Dt1HLaLi.js +37 -0
- package/dist/nativeSender-Dt1HLaLi.js.map +1 -0
- package/dist/nativeSender-hCgUa7Vz.cjs +2 -0
- package/dist/nativeSender-hCgUa7Vz.cjs.map +1 -0
- package/dist/navigationRef-CVIv0aIK.js +30 -0
- package/dist/navigationRef-CVIv0aIK.js.map +1 -0
- package/dist/navigationRef-CfIbeXX8.cjs +2 -0
- package/dist/navigationRef-CfIbeXX8.cjs.map +1 -0
- package/dist/navigationWeb.web-CRHpr5zl.js +51 -0
- package/dist/navigationWeb.web-CRHpr5zl.js.map +1 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs +2 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs.map +1 -0
- package/dist/{networkChange-CUO1hRLj.cjs → networkChange-2FGIQM-N.cjs} +2 -2
- package/dist/networkChange-2FGIQM-N.cjs.map +1 -0
- package/dist/{networkChange-D39hdSb0.js → networkChange-QA0893vW.js} +2 -2
- package/dist/networkChange-QA0893vW.js.map +1 -0
- package/dist/networkInfo.native-CcJ3JVRF.js +31 -0
- package/dist/networkInfo.native-CcJ3JVRF.js.map +1 -0
- package/dist/networkInfo.native-whB2wf6a.cjs +2 -0
- package/dist/networkInfo.native-whB2wf6a.cjs.map +1 -0
- package/dist/{networkInfo.web-twcNn_hc.js → networkInfo.web-CcUpXMUK.js} +4 -4
- package/dist/networkInfo.web-CcUpXMUK.js.map +1 -0
- package/dist/networkInfo.web-DfO-BUFx.cjs +2 -0
- package/dist/networkInfo.web-DfO-BUFx.cjs.map +1 -0
- package/dist/react-bqe7KPOf.cjs +4 -0
- package/dist/react-bqe7KPOf.cjs.map +1 -0
- package/dist/react-urNtDGTL.js +413 -0
- package/dist/react-urNtDGTL.js.map +1 -0
- package/dist/runtimeReady.native-CxFl1rQR.js +35 -0
- package/dist/runtimeReady.native-CxFl1rQR.js.map +1 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs +2 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs.map +1 -0
- package/dist/runtimeReady.web-JuE239Tg.js +25 -0
- package/dist/runtimeReady.web-JuE239Tg.js.map +1 -0
- package/dist/runtimeReady.web-vhAJFU61.cjs +2 -0
- package/dist/runtimeReady.web-vhAJFU61.cjs.map +1 -0
- package/dist/seedRuntimeReady-BlRdf3pR.js +10 -0
- package/dist/seedRuntimeReady-BlRdf3pR.js.map +1 -0
- package/dist/seedRuntimeReady-CbjqbWCd.cjs +2 -0
- package/dist/seedRuntimeReady-CbjqbWCd.cjs.map +1 -0
- package/dist/src/adapters/appLifecycle.d.ts +11 -4
- package/dist/src/adapters/batch.d.ts +46 -0
- package/dist/src/adapters/crashCapture.d.ts +42 -9
- package/dist/src/adapters/deviceState.d.ts +9 -0
- package/dist/src/adapters/failedEvents.d.ts +43 -0
- package/dist/src/adapters/frameAggregate.d.ts +19 -12
- package/dist/src/adapters/frameTracker.d.ts +30 -0
- package/dist/src/adapters/hangDetector.d.ts +41 -0
- package/dist/src/adapters/httpAttributes.d.ts +18 -0
- package/dist/src/adapters/loadingTime.d.ts +67 -0
- package/dist/src/adapters/manualSpans.d.ts +41 -0
- package/dist/src/adapters/native/autoTaps.native.d.ts +15 -0
- package/dist/src/adapters/native/deviceState.native.d.ts +15 -0
- package/dist/src/adapters/native/interceptHttpNative.native.d.ts +18 -0
- package/dist/src/adapters/native/memoryNative.native.d.ts +15 -11
- package/dist/src/adapters/native/networkInfo.native.d.ts +1 -1
- package/dist/src/adapters/native/runtimeReady.native.d.ts +17 -0
- package/dist/src/adapters/native/store.native.d.ts +10 -0
- package/dist/src/adapters/nativeSender.d.ts +2 -2
- package/dist/src/adapters/navigationRef.d.ts +29 -0
- package/dist/src/adapters/networkChange.d.ts +2 -2
- package/dist/src/adapters/seedRuntimeReady.d.ts +8 -0
- package/dist/src/adapters/traceHeader.d.ts +33 -0
- package/dist/src/adapters/traceManager.d.ts +144 -0
- package/dist/src/adapters/uiInteraction.d.ts +111 -0
- package/dist/src/adapters/viewManager.d.ts +177 -0
- package/dist/src/adapters/viewport.d.ts +15 -0
- package/dist/src/adapters/web/deviceState.web.d.ts +10 -0
- package/dist/src/adapters/web/interactionWeb.web.d.ts +36 -0
- package/dist/src/adapters/web/interceptFetchWeb.web.d.ts +3 -11
- package/dist/src/adapters/web/navigationWeb.web.d.ts +13 -7
- package/dist/src/adapters/web/runtimeReady.web.d.ts +5 -0
- package/dist/src/adapters/web/store.web.d.ts +12 -0
- package/dist/src/adapters/web/webVitals.web.d.ts +56 -0
- package/dist/src/adapters/webSender.d.ts +2 -2
- package/dist/src/adapters/webVitals.d.ts +25 -0
- package/dist/src/adapters/xhrIntercept.d.ts +55 -0
- package/dist/src/core/beforeSend.d.ts +20 -0
- package/dist/src/core/breadcrumbs.d.ts +10 -0
- package/dist/src/core/debug.d.ts +7 -0
- package/dist/src/core/memoryStore.d.ts +23 -0
- package/dist/src/core/store.d.ts +41 -0
- package/dist/src/core/telemetry.d.ts +422 -42
- package/dist/src/core/userProfile.d.ts +19 -0
- package/dist/src/core/utils/json.d.ts +7 -0
- package/dist/src/core/utils/uuid.d.ts +10 -1
- package/dist/src/createTelemetry.native.d.ts +10 -1
- package/dist/src/createTelemetry.web.d.ts +9 -1
- package/dist/src/golden.helper.d.ts +4 -0
- package/dist/src/index.base.d.ts +93 -3
- package/dist/src/index.native.d.ts +7 -27
- package/dist/src/index.web.d.ts +7 -23
- package/dist/src/react.d.ts +45 -0
- package/dist/src/telemetryNative.native.d.ts +79 -0
- package/dist/src/telemetryWeb.web.d.ts +59 -0
- package/dist/store.native-BbS76uWV.cjs +2 -0
- package/dist/store.native-BbS76uWV.cjs.map +1 -0
- package/dist/store.native-MlWyGgBp.js +32 -0
- package/dist/store.native-MlWyGgBp.js.map +1 -0
- package/dist/store.web-BzKaP57Z.cjs +2 -0
- package/dist/store.web-BzKaP57Z.cjs.map +1 -0
- package/dist/store.web-rhh0NOfs.js +31 -0
- package/dist/store.web-rhh0NOfs.js.map +1 -0
- package/dist/telemetry-60sfWkh0.js +1754 -0
- package/dist/telemetry-60sfWkh0.js.map +1 -0
- package/dist/telemetry-CW63glwb.cjs +2 -0
- package/dist/telemetry-CW63glwb.cjs.map +1 -0
- package/dist/uiInteraction-BIDOMcrL.js +109 -0
- package/dist/uiInteraction-BIDOMcrL.js.map +1 -0
- package/dist/uiInteraction-DxlwCVSn.cjs +2 -0
- package/dist/uiInteraction-DxlwCVSn.cjs.map +1 -0
- package/dist/viewport-9JcVIXYF.cjs +2 -0
- package/dist/viewport-9JcVIXYF.cjs.map +1 -0
- package/dist/viewport-GWTEBt2K.js +15 -0
- package/dist/viewport-GWTEBt2K.js.map +1 -0
- package/dist/web-vitals.attribution-DAvBvdng.cjs +2 -0
- package/dist/web-vitals.attribution-DAvBvdng.cjs.map +1 -0
- package/dist/web-vitals.attribution-DcoMtvlY.js +488 -0
- package/dist/web-vitals.attribution-DcoMtvlY.js.map +1 -0
- package/dist/webSender-DA087xb5.cjs +2 -0
- package/dist/webSender-DA087xb5.cjs.map +1 -0
- package/dist/webSender-g4rs5TIg.js +44 -0
- package/dist/webSender-g4rs5TIg.js.map +1 -0
- package/dist/webVitals.web-DRTDK6s5.js +100 -0
- package/dist/webVitals.web-DRTDK6s5.js.map +1 -0
- package/dist/webVitals.web-DvScDIjX.cjs +2 -0
- package/dist/webVitals.web-DvScDIjX.cjs.map +1 -0
- package/dist/xhrIntercept-9uAkQh3N.js +55 -0
- package/dist/xhrIntercept-9uAkQh3N.js.map +1 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs +2 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs.map +1 -0
- package/docs/migration-v4.md +190 -0
- package/docs/migration-v5.md +178 -0
- package/package.json +22 -6
- package/dist/appLifecycle-Cynw0kAv.js +0 -14
- package/dist/appLifecycle-Cynw0kAv.js.map +0 -1
- package/dist/appLifecycle-DvJIt7ym.cjs +0 -2
- package/dist/appLifecycle-DvJIt7ym.cjs.map +0 -1
- package/dist/batch-CLBFgYPC.cjs +0 -2
- package/dist/batch-CLBFgYPC.cjs.map +0 -1
- package/dist/batch-DLG_gtOm.js +0 -12
- package/dist/batch-DLG_gtOm.js.map +0 -1
- package/dist/crashCapture-BYTM4FLC.cjs +0 -2
- package/dist/crashCapture-BYTM4FLC.cjs.map +0 -1
- package/dist/crashCapture-D_rkkBVa.js +0 -31
- package/dist/crashCapture-D_rkkBVa.js.map +0 -1
- package/dist/crashHandler.web-BSxDpFTo.cjs +0 -2
- package/dist/crashHandler.web-BSxDpFTo.cjs.map +0 -1
- package/dist/crashHandler.web-D59bmhg9.js +0 -32
- package/dist/crashHandler.web-D59bmhg9.js.map +0 -1
- package/dist/crashHandlerNative.native-DeAFze4E.cjs +0 -2
- package/dist/crashHandlerNative.native-DeAFze4E.cjs.map +0 -1
- package/dist/crashHandlerNative.native-d7qJkzA6.js +0 -41
- package/dist/crashHandlerNative.native-d7qJkzA6.js.map +0 -1
- package/dist/debug-DsvQ9y3W.js +0 -68
- package/dist/debug-DsvQ9y3W.js.map +0 -1
- package/dist/debug-rnOOxFpN.cjs +0 -2
- package/dist/debug-rnOOxFpN.cjs.map +0 -1
- package/dist/deviceInfo.native-7hbRYixR.cjs +0 -2
- package/dist/deviceInfo.native-7hbRYixR.cjs.map +0 -1
- package/dist/deviceInfo.native-D2k0LDhI.js +0 -1171
- package/dist/deviceInfo.native-D2k0LDhI.js.map +0 -1
- package/dist/deviceInfo.web-ByNAlEJh.cjs +0 -2
- package/dist/deviceInfo.web-ByNAlEJh.cjs.map +0 -1
- package/dist/deviceInfo.web-DzQyEku6.js +0 -40
- package/dist/deviceInfo.web-DzQyEku6.js.map +0 -1
- package/dist/frameAggregate-C_HoVFcK.cjs +0 -2
- package/dist/frameAggregate-C_HoVFcK.cjs.map +0 -1
- package/dist/frameAggregate-Cwh1juw1.js +0 -17
- package/dist/frameAggregate-Cwh1juw1.js.map +0 -1
- package/dist/frameDropsNative.native-CP7zrXDf.js +0 -23
- package/dist/frameDropsNative.native-CP7zrXDf.js.map +0 -1
- package/dist/frameDropsNative.native-DKqEDqip.cjs +0 -2
- package/dist/frameDropsNative.native-DKqEDqip.cjs.map +0 -1
- package/dist/frameDropsWeb.web-C9Lt3Fuj.js +0 -22
- package/dist/frameDropsWeb.web-C9Lt3Fuj.js.map +0 -1
- package/dist/frameDropsWeb.web-azpwQCUz.cjs +0 -2
- package/dist/frameDropsWeb.web-azpwQCUz.cjs.map +0 -1
- package/dist/httpAttributes-BV50UKQU.js +0 -19
- package/dist/httpAttributes-BV50UKQU.js.map +0 -1
- package/dist/httpAttributes-xXOD9trQ.cjs +0 -2
- package/dist/httpAttributes-xXOD9trQ.cjs.map +0 -1
- package/dist/interaction-CH8yoY5-.js +0 -23
- package/dist/interaction-CH8yoY5-.js.map +0 -1
- package/dist/interaction-DcNFBW7a.cjs +0 -2
- package/dist/interaction-DcNFBW7a.cjs.map +0 -1
- package/dist/interceptFetchNative.native-VlhtMG-U.js +0 -49
- package/dist/interceptFetchNative.native-VlhtMG-U.js.map +0 -1
- package/dist/interceptFetchNative.native-jEAldH14.cjs +0 -2
- package/dist/interceptFetchNative.native-jEAldH14.cjs.map +0 -1
- package/dist/interceptFetchWeb.web-DFzZliik.cjs +0 -2
- package/dist/interceptFetchWeb.web-DFzZliik.cjs.map +0 -1
- package/dist/interceptFetchWeb.web-DfsMfoRP.js +0 -77
- package/dist/interceptFetchWeb.web-DfsMfoRP.js.map +0 -1
- package/dist/memoryNative.native-BWLh2S9L.js +0 -48
- package/dist/memoryNative.native-BWLh2S9L.js.map +0 -1
- package/dist/memoryNative.native-DCXSOd4Q.cjs +0 -2
- package/dist/memoryNative.native-DCXSOd4Q.cjs.map +0 -1
- package/dist/memoryWeb.web-B3YuV-cB.js +0 -48
- package/dist/memoryWeb.web-B3YuV-cB.js.map +0 -1
- package/dist/memoryWeb.web-CheXAcJn.cjs +0 -2
- package/dist/memoryWeb.web-CheXAcJn.cjs.map +0 -1
- package/dist/nativeSender-BE_mzw_S.js +0 -70
- package/dist/nativeSender-BE_mzw_S.js.map +0 -1
- package/dist/nativeSender-DyAUGY7c.cjs +0 -2
- package/dist/nativeSender-DyAUGY7c.cjs.map +0 -1
- package/dist/navigationNative.native-3tO5JxSd.cjs +0 -2
- package/dist/navigationNative.native-3tO5JxSd.cjs.map +0 -1
- package/dist/navigationNative.native-BUCGPQX2.js +0 -25
- package/dist/navigationNative.native-BUCGPQX2.js.map +0 -1
- package/dist/navigationTracker-B2GMwyKk.cjs +0 -2
- package/dist/navigationTracker-B2GMwyKk.cjs.map +0 -1
- package/dist/navigationTracker-Cts68dgG.js +0 -19
- package/dist/navigationTracker-Cts68dgG.js.map +0 -1
- package/dist/navigationWeb.web-B0necr5j.cjs +0 -2
- package/dist/navigationWeb.web-B0necr5j.cjs.map +0 -1
- package/dist/navigationWeb.web-CORzE_Id.js +0 -46
- package/dist/navigationWeb.web-CORzE_Id.js.map +0 -1
- package/dist/networkChange-CUO1hRLj.cjs.map +0 -1
- package/dist/networkChange-D39hdSb0.js.map +0 -1
- package/dist/networkInfo.native-BK5fpAOL.js +0 -343
- package/dist/networkInfo.native-BK5fpAOL.js.map +0 -1
- package/dist/networkInfo.native-cxuw93Uy.cjs +0 -2
- package/dist/networkInfo.native-cxuw93Uy.cjs.map +0 -1
- package/dist/networkInfo.web-DJmw1sNK.cjs +0 -2
- package/dist/networkInfo.web-DJmw1sNK.cjs.map +0 -1
- package/dist/networkInfo.web-twcNn_hc.js.map +0 -1
- package/dist/src/adapters/interaction.d.ts +0 -17
- package/dist/src/adapters/native/frameDropsNative.native.d.ts +0 -16
- package/dist/src/adapters/native/interceptFetchNative.native.d.ts +0 -23
- package/dist/src/adapters/native/navigationNative.native.d.ts +0 -12
- package/dist/src/adapters/navigationTracker.d.ts +0 -6
- package/dist/src/adapters/screenTiming.d.ts +0 -9
- package/dist/src/adapters/web/frameDropsWeb.web.d.ts +0 -16
- package/dist/src/adapters/web/memoryWeb.web.d.ts +0 -26
- package/dist/telemetry-Co4MYdwa.cjs +0 -2
- package/dist/telemetry-Co4MYdwa.cjs.map +0 -1
- package/dist/telemetry-KI0x4gzC.js +0 -389
- package/dist/telemetry-KI0x4gzC.js.map +0 -1
- package/dist/v4-BysszJq8.js +0 -31
- package/dist/v4-BysszJq8.js.map +0 -1
- package/dist/v4-CqdK_b8Y.cjs +0 -2
- package/dist/v4-CqdK_b8Y.cjs.map +0 -1
- package/dist/webSender-B27tmT1w.js +0 -42
- package/dist/webSender-B27tmT1w.js.map +0 -1
- package/dist/webSender-BWi4x1df.cjs +0 -2
- package/dist/webSender-BWi4x1df.cjs.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function i(e) {
|
|
2
|
+
if (typeof e != "number" || !(e > 0)) return;
|
|
3
|
+
if (e > 1e12) return e;
|
|
4
|
+
const r = globalThis.performance?.now?.();
|
|
5
|
+
return typeof r == "number" ? Date.now() - r + e : void 0;
|
|
6
|
+
}
|
|
7
|
+
function u() {
|
|
8
|
+
return i(globalThis.performance?.rnStartupTiming?.startTime);
|
|
9
|
+
}
|
|
10
|
+
function n() {
|
|
11
|
+
return i(globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd);
|
|
12
|
+
}
|
|
13
|
+
async function a() {
|
|
14
|
+
const e = n();
|
|
15
|
+
return e !== void 0 ? e : (await new Promise((r) => {
|
|
16
|
+
setTimeout(r, 0)?.unref?.();
|
|
17
|
+
}), n());
|
|
18
|
+
}
|
|
19
|
+
async function m() {
|
|
20
|
+
for (let e = 0; e <= 100; e++) {
|
|
21
|
+
const r = globalThis.performance?.rnStartupTiming;
|
|
22
|
+
if (typeof r?.startTime != "number") return;
|
|
23
|
+
if (typeof r.endTime == "number" && r.endTime >= r.startTime) return r.endTime - r.startTime;
|
|
24
|
+
await new Promise((t) => {
|
|
25
|
+
setTimeout(t, 100)?.unref?.();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
u as processStartAt,
|
|
31
|
+
a as runtimeReadyAt,
|
|
32
|
+
m as startupDurationMs,
|
|
33
|
+
i as toEpoch
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=runtimeReady.native-CxFl1rQR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.native-CxFl1rQR.js","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\ntype StartupTiming = { startTime?: unknown; endTime?: unknown; executeJavaScriptBundleEntryPointEnd?: unknown };\ntype Perf = { now?: () => number; rnStartupTiming?: StartupTiming };\n\n/**\n * The markers are stamped on the native monotonic clock — iOS `CACurrentMediaTime()`, Android\n * `SystemClock.uptimeMillis()` — the same clock `performance.now()` reads, not epoch. Shifted\n * onto `Date.now()`'s timeline here so every caller can compare them with wall time.\n * ponytail: a value already past 1e12 is taken as epoch (31 years of uptime is not a device).\n */\nexport function toEpoch(t: unknown): number | undefined {\n if (typeof t !== \"number\" || !(t > 0)) return undefined;\n if (t > 1e12) return t;\n const now = (globalThis as { performance?: Perf }).performance?.now?.();\n return typeof now === \"number\" ? Date.now() - now + t : undefined;\n}\n\n/** Epoch ms of process start (#171's initial-view anchor), or undefined where unpublished. */\nexport function processStartAt(): number | undefined {\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.startTime);\n}\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd);\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n\n/**\n * `app.start.duration_ms` (#179, catalogue app_start.yaml): process start → first display, read\n * as `rnStartupTiming.endTime − startTime` (both on the native monotonic clock). `endTime` is\n * stamped when the first content appears, usually after a module-scope init, so it is polled\n * every 100 ms for up to 10 s. No marker at all (Old Architecture) resolves `undefined` at once.\n */\nexport async function startupDurationMs(): Promise<number | undefined> {\n for (let i = 0; i <= 100; i++) {\n const t = (globalThis as { performance?: Perf }).performance?.rnStartupTiming;\n if (typeof t?.startTime !== \"number\") return undefined;\n if (typeof t.endTime === \"number\" && t.endTime >= t.startTime) return t.endTime - t.startTime;\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 100);\n (timer as { unref?: () => void })?.unref?.();\n });\n }\n return undefined;\n}\n"],"names":["toEpoch","t","now","processStartAt","read","runtimeReadyAt","early","resolve","startupDurationMs","i"],"mappings":"AAkBO,SAASA,EAAQC,GAAgC;AACpD,MAAI,OAAOA,KAAM,YAAY,EAAEA,IAAI,GAAI;AACvC,MAAIA,IAAI,KAAM,QAAOA;AACrB,QAAMC,IAAO,WAAsC,aAAa,MAAA;AAChE,SAAO,OAAOA,KAAQ,WAAW,KAAK,QAAQA,IAAMD,IAAI;AAC5D;AAGO,SAASE,IAAqC;AACjD,SAAOH,EAAS,WAAsC,aAAa,iBAAiB,SAAS;AACjG;AAEA,SAASI,IAA2B;AAGhC,SAAOJ,EAAS,WAAsC,aAAa,iBAAiB,oCAAoC;AAC5H;AAEA,eAAsBK,IAA8C;AAChE,QAAMC,IAAQF,EAAA;AACd,SAAIE,MAAU,SAAkBA,KAMhC,MAAM,IAAI,QAAc,CAACC,MAAY;AAEhC,IADa,WAAWA,GAAS,CAAC,GACA,QAAA;AAAA,EACvC,CAAC,GACMH,EAAA;AACX;AAQA,eAAsBI,IAAiD;AACnE,WAASC,IAAI,GAAGA,KAAK,KAAKA,KAAK;AAC3B,UAAMR,IAAK,WAAsC,aAAa;AAC9D,QAAI,OAAOA,GAAG,aAAc,SAAU;AACtC,QAAI,OAAOA,EAAE,WAAY,YAAYA,EAAE,WAAWA,EAAE,UAAW,QAAOA,EAAE,UAAUA,EAAE;AACpF,UAAM,IAAI,QAAc,CAACM,MAAY;AAEhC,MADa,WAAWA,GAAS,GAAG,GACF,QAAA;AAAA,IACvC,CAAC;AAAA,EACL;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t){if(typeof t!="number"||!(t>0))return;if(t>1e12)return t;const e=globalThis.performance?.now?.();return typeof e=="number"?Date.now()-e+t:void 0}function o(){return r(globalThis.performance?.rnStartupTiming?.startTime)}function i(){return r(globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd)}async function u(){const t=i();return t!==void 0?t:(await new Promise(e=>{setTimeout(e,0)?.unref?.()}),i())}async function a(){for(let t=0;t<=100;t++){const e=globalThis.performance?.rnStartupTiming;if(typeof e?.startTime!="number")return;if(typeof e.endTime=="number"&&e.endTime>=e.startTime)return e.endTime-e.startTime;await new Promise(n=>{setTimeout(n,100)?.unref?.()})}}exports.processStartAt=o;exports.runtimeReadyAt=u;exports.startupDurationMs=a;exports.toEpoch=r;
|
|
2
|
+
//# sourceMappingURL=runtimeReady.native-zueSbsEv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.native-zueSbsEv.cjs","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\ntype StartupTiming = { startTime?: unknown; endTime?: unknown; executeJavaScriptBundleEntryPointEnd?: unknown };\ntype Perf = { now?: () => number; rnStartupTiming?: StartupTiming };\n\n/**\n * The markers are stamped on the native monotonic clock — iOS `CACurrentMediaTime()`, Android\n * `SystemClock.uptimeMillis()` — the same clock `performance.now()` reads, not epoch. Shifted\n * onto `Date.now()`'s timeline here so every caller can compare them with wall time.\n * ponytail: a value already past 1e12 is taken as epoch (31 years of uptime is not a device).\n */\nexport function toEpoch(t: unknown): number | undefined {\n if (typeof t !== \"number\" || !(t > 0)) return undefined;\n if (t > 1e12) return t;\n const now = (globalThis as { performance?: Perf }).performance?.now?.();\n return typeof now === \"number\" ? Date.now() - now + t : undefined;\n}\n\n/** Epoch ms of process start (#171's initial-view anchor), or undefined where unpublished. */\nexport function processStartAt(): number | undefined {\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.startTime);\n}\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd);\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n\n/**\n * `app.start.duration_ms` (#179, catalogue app_start.yaml): process start → first display, read\n * as `rnStartupTiming.endTime − startTime` (both on the native monotonic clock). `endTime` is\n * stamped when the first content appears, usually after a module-scope init, so it is polled\n * every 100 ms for up to 10 s. No marker at all (Old Architecture) resolves `undefined` at once.\n */\nexport async function startupDurationMs(): Promise<number | undefined> {\n for (let i = 0; i <= 100; i++) {\n const t = (globalThis as { performance?: Perf }).performance?.rnStartupTiming;\n if (typeof t?.startTime !== \"number\") return undefined;\n if (typeof t.endTime === \"number\" && t.endTime >= t.startTime) return t.endTime - t.startTime;\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 100);\n (timer as { unref?: () => void })?.unref?.();\n });\n }\n return undefined;\n}\n"],"names":["toEpoch","now","processStartAt","read","runtimeReadyAt","early","resolve","startupDurationMs","i","t"],"mappings":"gFAkBO,SAASA,EAAQ,EAAgC,CACpD,GAAI,OAAO,GAAM,UAAY,EAAE,EAAI,GAAI,OACvC,GAAI,EAAI,KAAM,OAAO,EACrB,MAAMC,EAAO,WAAsC,aAAa,MAAA,EAChE,OAAO,OAAOA,GAAQ,SAAW,KAAK,MAAQA,EAAM,EAAI,MAC5D,CAGO,SAASC,GAAqC,CACjD,OAAOF,EAAS,WAAsC,aAAa,iBAAiB,SAAS,CACjG,CAEA,SAASG,GAA2B,CAGhC,OAAOH,EAAS,WAAsC,aAAa,iBAAiB,oCAAoC,CAC5H,CAEA,eAAsBI,GAA8C,CAChE,MAAMC,EAAQF,EAAA,EACd,OAAIE,IAAU,OAAkBA,GAMhC,MAAM,IAAI,QAAeC,GAAY,CACnB,WAAWA,EAAS,CAAC,GACA,QAAA,CACvC,CAAC,EACMH,EAAA,EACX,CAQA,eAAsBI,GAAiD,CACnE,QAASC,EAAI,EAAGA,GAAK,IAAKA,IAAK,CAC3B,MAAMC,EAAK,WAAsC,aAAa,gBAC9D,GAAI,OAAOA,GAAG,WAAc,SAAU,OACtC,GAAI,OAAOA,EAAE,SAAY,UAAYA,EAAE,SAAWA,EAAE,UAAW,OAAOA,EAAE,QAAUA,EAAE,UACpF,MAAM,IAAI,QAAeH,GAAY,CACnB,WAAWA,EAAS,GAAG,GACF,QAAA,CACvC,CAAC,CACL,CAEJ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { L as d } from "./loadingTime-DMc0zTY8.js";
|
|
2
|
+
function o() {
|
|
3
|
+
if (typeof performance > "u") return;
|
|
4
|
+
const e = performance.getEntriesByType?.("navigation")?.[0];
|
|
5
|
+
if (e && e.loadEventEnd > 0) return performance.timeOrigin + e.loadEventEnd;
|
|
6
|
+
const n = performance.timing?.loadEventEnd;
|
|
7
|
+
return typeof n == "number" && n > 0 ? n : void 0;
|
|
8
|
+
}
|
|
9
|
+
function m() {
|
|
10
|
+
if (typeof window > "u") return Promise.resolve(void 0);
|
|
11
|
+
const e = o();
|
|
12
|
+
return e !== void 0 ? Promise.resolve(e) : typeof document < "u" && document.readyState === "complete" ? Promise.resolve(void 0) : new Promise((n) => {
|
|
13
|
+
let r = !1;
|
|
14
|
+
const t = (i) => {
|
|
15
|
+
r || (r = !0, n(i));
|
|
16
|
+
};
|
|
17
|
+
window.addEventListener("load", () => {
|
|
18
|
+
t(o() ?? Date.now());
|
|
19
|
+
}, { once: !0 }), setTimeout(() => t(void 0), d)?.unref?.();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
m as runtimeReadyAt
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=runtimeReady.web-JuE239Tg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.web-JuE239Tg.js","sources":["../src/adapters/web/runtimeReady.web.ts"],"sourcesContent":["// The web half of §4.5.2's `initial_load` seed: the launch view is busy until the document's\n// own load marker, then settles. `loadEventEnd` is the platform's answer to \"the runtime is\n// ready\"; the SDK does not invent one.\n//\n// ⚠ Web's `initial_load` is systematically LARGER than native's — it includes DNS, TLS and\n// document download where native reads a bundle off local disk. Cross-platform `initial_load`\n// comparison is not apples-to-apples (§4.5.2); within-platform release comparison is fine.\n\nimport { LOADING_TIME_CAP_MS } from \"../loadingTime\";\n\n/** Epoch ms of `loadEventEnd`, or undefined where the entry is unavailable. */\nfunction readMarker(): number | undefined {\n if (typeof performance === \"undefined\") return undefined;\n const nav = performance.getEntriesByType?.(\"navigation\")?.[0] as PerformanceNavigationTiming | undefined;\n // Navigation-timing values are relative to timeOrigin; the settle module works in epoch ms.\n if (nav && nav.loadEventEnd > 0) return performance.timeOrigin + nav.loadEventEnd;\n // `performance.timing` is the removed-but-still-shipped legacy API; not in lib.dom's types.\n const legacy = (performance as unknown as { timing?: { loadEventEnd?: number } }).timing?.loadEventEnd;\n return typeof legacy === \"number\" && legacy > 0 ? legacy : undefined;\n}\n\n/**\n * Resolves once the marker is known — `undefined` when the platform has none to give, which\n * releases the gate rather than leaving every launch reporting `abandoned` (§4.5.2).\n */\nexport function runtimeReadyAt(): Promise<number | undefined> {\n if (typeof window === \"undefined\") return Promise.resolve(undefined);\n\n const early = readMarker();\n if (early !== undefined) return Promise.resolve(early);\n // Already loaded but the entry is missing (an old browser, a same-document navigation):\n // nothing more is coming, so release rather than wait forever.\n if (typeof document !== \"undefined\" && document.readyState === \"complete\") {\n return Promise.resolve(undefined);\n }\n\n return new Promise((resolve) => {\n let settled = false;\n const finish = (at?: number) => { if (!settled) { settled = true; resolve(at); } };\n\n window.addEventListener(\"load\", () => {\n // `loadEventEnd` is stamped *after* the load handlers run, so it is still 0 inside\n // one of them. Now is a truthful marker either way — we are in the load event.\n finish(readMarker() ?? Date.now());\n }, { once: true });\n\n // A `load` that never fires — a stalled subresource, a runtime with no such event —\n // would otherwise leave the gate shut forever and make every launch report\n // `abandoned`, which is the exact failure this module exists to avoid. Past the cap\n // the launch view is capped anyway, so there is nothing left to wait for.\n const timer = setTimeout(() => finish(undefined), LOADING_TIME_CAP_MS);\n (timer as any)?.unref?.(); // never hold a Node process open for a marker\n });\n}\n"],"names":["readMarker","nav","legacy","runtimeReadyAt","early","resolve","settled","finish","at","LOADING_TIME_CAP_MS"],"mappings":";AAWA,SAASA,IAAiC;AACtC,MAAI,OAAO,cAAgB,IAAa;AACxC,QAAMC,IAAM,YAAY,mBAAmB,YAAY,IAAI,CAAC;AAE5D,MAAIA,KAAOA,EAAI,eAAe,EAAG,QAAO,YAAY,aAAaA,EAAI;AAErE,QAAMC,IAAU,YAAkE,QAAQ;AAC1F,SAAO,OAAOA,KAAW,YAAYA,IAAS,IAAIA,IAAS;AAC/D;AAMO,SAASC,IAA8C;AAC1D,MAAI,OAAO,SAAW,IAAa,QAAO,QAAQ,QAAQ,MAAS;AAEnE,QAAMC,IAAQJ,EAAA;AACd,SAAII,MAAU,SAAkB,QAAQ,QAAQA,CAAK,IAGjD,OAAO,WAAa,OAAe,SAAS,eAAe,aACpD,QAAQ,QAAQ,MAAS,IAG7B,IAAI,QAAQ,CAACC,MAAY;AAC5B,QAAIC,IAAU;AACd,UAAMC,IAAS,CAACC,MAAgB;AAAE,MAAKF,MAAWA,IAAU,IAAMD,EAAQG,CAAE;AAAA,IAAK;AAEjF,WAAO,iBAAiB,QAAQ,MAAM;AAGlC,MAAAD,EAAOP,EAAA,KAAgB,KAAK,IAAA,CAAK;AAAA,IACrC,GAAG,EAAE,MAAM,IAAM,GAMH,WAAW,MAAMO,EAAO,MAAS,GAAGE,CAAmB,GACrD,QAAA;AAAA,EACpB,CAAC;AACL;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./loadingTime-Cj5Oh8lT.cjs");function o(){if(typeof performance>"u")return;const e=performance.getEntriesByType?.("navigation")?.[0];if(e&&e.loadEventEnd>0)return performance.timeOrigin+e.loadEventEnd;const n=performance.timing?.loadEventEnd;return typeof n=="number"&&n>0?n:void 0}function a(){if(typeof window>"u")return Promise.resolve(void 0);const e=o();return e!==void 0?Promise.resolve(e):typeof document<"u"&&document.readyState==="complete"?Promise.resolve(void 0):new Promise(n=>{let t=!1;const r=i=>{t||(t=!0,n(i))};window.addEventListener("load",()=>{r(o()??Date.now())},{once:!0}),setTimeout(()=>r(void 0),d.LOADING_TIME_CAP_MS)?.unref?.()})}exports.runtimeReadyAt=a;
|
|
2
|
+
//# sourceMappingURL=runtimeReady.web-vhAJFU61.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.web-vhAJFU61.cjs","sources":["../src/adapters/web/runtimeReady.web.ts"],"sourcesContent":["// The web half of §4.5.2's `initial_load` seed: the launch view is busy until the document's\n// own load marker, then settles. `loadEventEnd` is the platform's answer to \"the runtime is\n// ready\"; the SDK does not invent one.\n//\n// ⚠ Web's `initial_load` is systematically LARGER than native's — it includes DNS, TLS and\n// document download where native reads a bundle off local disk. Cross-platform `initial_load`\n// comparison is not apples-to-apples (§4.5.2); within-platform release comparison is fine.\n\nimport { LOADING_TIME_CAP_MS } from \"../loadingTime\";\n\n/** Epoch ms of `loadEventEnd`, or undefined where the entry is unavailable. */\nfunction readMarker(): number | undefined {\n if (typeof performance === \"undefined\") return undefined;\n const nav = performance.getEntriesByType?.(\"navigation\")?.[0] as PerformanceNavigationTiming | undefined;\n // Navigation-timing values are relative to timeOrigin; the settle module works in epoch ms.\n if (nav && nav.loadEventEnd > 0) return performance.timeOrigin + nav.loadEventEnd;\n // `performance.timing` is the removed-but-still-shipped legacy API; not in lib.dom's types.\n const legacy = (performance as unknown as { timing?: { loadEventEnd?: number } }).timing?.loadEventEnd;\n return typeof legacy === \"number\" && legacy > 0 ? legacy : undefined;\n}\n\n/**\n * Resolves once the marker is known — `undefined` when the platform has none to give, which\n * releases the gate rather than leaving every launch reporting `abandoned` (§4.5.2).\n */\nexport function runtimeReadyAt(): Promise<number | undefined> {\n if (typeof window === \"undefined\") return Promise.resolve(undefined);\n\n const early = readMarker();\n if (early !== undefined) return Promise.resolve(early);\n // Already loaded but the entry is missing (an old browser, a same-document navigation):\n // nothing more is coming, so release rather than wait forever.\n if (typeof document !== \"undefined\" && document.readyState === \"complete\") {\n return Promise.resolve(undefined);\n }\n\n return new Promise((resolve) => {\n let settled = false;\n const finish = (at?: number) => { if (!settled) { settled = true; resolve(at); } };\n\n window.addEventListener(\"load\", () => {\n // `loadEventEnd` is stamped *after* the load handlers run, so it is still 0 inside\n // one of them. Now is a truthful marker either way — we are in the load event.\n finish(readMarker() ?? Date.now());\n }, { once: true });\n\n // A `load` that never fires — a stalled subresource, a runtime with no such event —\n // would otherwise leave the gate shut forever and make every launch report\n // `abandoned`, which is the exact failure this module exists to avoid. Past the cap\n // the launch view is capped anyway, so there is nothing left to wait for.\n const timer = setTimeout(() => finish(undefined), LOADING_TIME_CAP_MS);\n (timer as any)?.unref?.(); // never hold a Node process open for a marker\n });\n}\n"],"names":["readMarker","nav","legacy","runtimeReadyAt","early","resolve","settled","finish","at","LOADING_TIME_CAP_MS"],"mappings":"8HAWA,SAASA,GAAiC,CACtC,GAAI,OAAO,YAAgB,IAAa,OACxC,MAAMC,EAAM,YAAY,mBAAmB,YAAY,IAAI,CAAC,EAE5D,GAAIA,GAAOA,EAAI,aAAe,EAAG,OAAO,YAAY,WAAaA,EAAI,aAErE,MAAMC,EAAU,YAAkE,QAAQ,aAC1F,OAAO,OAAOA,GAAW,UAAYA,EAAS,EAAIA,EAAS,MAC/D,CAMO,SAASC,GAA8C,CAC1D,GAAI,OAAO,OAAW,IAAa,OAAO,QAAQ,QAAQ,MAAS,EAEnE,MAAMC,EAAQJ,EAAA,EACd,OAAII,IAAU,OAAkB,QAAQ,QAAQA,CAAK,EAGjD,OAAO,SAAa,KAAe,SAAS,aAAe,WACpD,QAAQ,QAAQ,MAAS,EAG7B,IAAI,QAASC,GAAY,CAC5B,IAAIC,EAAU,GACd,MAAMC,EAAUC,GAAgB,CAAOF,IAAWA,EAAU,GAAMD,EAAQG,CAAE,EAAK,EAEjF,OAAO,iBAAiB,OAAQ,IAAM,CAGlCD,EAAOP,EAAA,GAAgB,KAAK,IAAA,CAAK,CACrC,EAAG,CAAE,KAAM,GAAM,EAMH,WAAW,IAAMO,EAAO,MAAS,EAAGE,EAAAA,mBAAmB,GACrD,QAAA,CACpB,CAAC,CACL"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { d as r } from "./react-urNtDGTL.js";
|
|
2
|
+
function i(a, d, n) {
|
|
3
|
+
Promise.resolve().then(d).then((e) => a.seedRuntimeReady(e)).catch((e) => {
|
|
4
|
+
r.warn(`${n} runtime-ready marker unavailable:`, e), a.seedRuntimeReady(void 0);
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as seedRuntimeReady
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=seedRuntimeReady-BlRdf3pR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seedRuntimeReady-BlRdf3pR.js","sources":["../src/adapters/seedRuntimeReady.ts"],"sourcesContent":["// Arming §4.5.2's `initial_load` seed, shared by both entries because only the *source* of the\n// marker is platform-specific — the failure handling around it is not, and it is the part that\n// must not be got wrong twice.\n//\n// Every path here ends in exactly one `seedRuntimeReady()` call. A gate that is never released\n// makes every launch report `abandoned`, which is the one outcome this seed exists to prevent.\n\nimport { debug } from \"../core/debug\";\nimport type { ViewManager } from \"./viewManager\";\n\nexport type RuntimeReadyReader = () => Promise<number | undefined>;\n\n/**\n * Fire-and-forget on purpose: on web the marker arrives with the load event, and blocking init\n * on it would put every host call behind the page's own images. The caller awaits the *module*\n * import instead, so the seed is armed before the instance is visible.\n */\nexport function seedRuntimeReady(views: ViewManager, read: RuntimeReadyReader, build: string): void {\n // `Promise.resolve().then` and not a bare call: a reader that throws *synchronously* would\n // sidestep the catch below and leave the gate shut.\n void Promise.resolve()\n .then(read)\n .then((at) => views.seedRuntimeReady(at))\n .catch((err: unknown) => {\n debug.warn(`${build} runtime-ready marker unavailable:`, err);\n views.seedRuntimeReady(undefined); // release the gate anyway\n });\n}\n"],"names":["seedRuntimeReady","views","read","build","at","err","debug"],"mappings":";AAiBO,SAASA,EAAiBC,GAAoBC,GAA0BC,GAAqB;AAGhG,EAAK,QAAQ,QAAA,EACR,KAAKD,CAAI,EACT,KAAK,CAACE,MAAOH,EAAM,iBAAiBG,CAAE,CAAC,EACvC,MAAM,CAACC,MAAiB;AACrB,IAAAC,EAAM,KAAK,GAAGH,CAAK,sCAAsCE,CAAG,GAC5DJ,EAAM,iBAAiB,MAAS;AAAA,EACpC,CAAC;AACT;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./react-bqe7KPOf.cjs");function r(t,a,d){Promise.resolve().then(a).then(e=>t.seedRuntimeReady(e)).catch(e=>{n.debug.warn(`${d} runtime-ready marker unavailable:`,e),t.seedRuntimeReady(void 0)})}exports.seedRuntimeReady=r;
|
|
2
|
+
//# sourceMappingURL=seedRuntimeReady-CbjqbWCd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seedRuntimeReady-CbjqbWCd.cjs","sources":["../src/adapters/seedRuntimeReady.ts"],"sourcesContent":["// Arming §4.5.2's `initial_load` seed, shared by both entries because only the *source* of the\n// marker is platform-specific — the failure handling around it is not, and it is the part that\n// must not be got wrong twice.\n//\n// Every path here ends in exactly one `seedRuntimeReady()` call. A gate that is never released\n// makes every launch report `abandoned`, which is the one outcome this seed exists to prevent.\n\nimport { debug } from \"../core/debug\";\nimport type { ViewManager } from \"./viewManager\";\n\nexport type RuntimeReadyReader = () => Promise<number | undefined>;\n\n/**\n * Fire-and-forget on purpose: on web the marker arrives with the load event, and blocking init\n * on it would put every host call behind the page's own images. The caller awaits the *module*\n * import instead, so the seed is armed before the instance is visible.\n */\nexport function seedRuntimeReady(views: ViewManager, read: RuntimeReadyReader, build: string): void {\n // `Promise.resolve().then` and not a bare call: a reader that throws *synchronously* would\n // sidestep the catch below and leave the gate shut.\n void Promise.resolve()\n .then(read)\n .then((at) => views.seedRuntimeReady(at))\n .catch((err: unknown) => {\n debug.warn(`${build} runtime-ready marker unavailable:`, err);\n views.seedRuntimeReady(undefined); // release the gate anyway\n });\n}\n"],"names":["seedRuntimeReady","views","read","build","at","err","debug"],"mappings":"wHAiBO,SAASA,EAAiBC,EAAoBC,EAA0BC,EAAqB,CAG3F,QAAQ,QAAA,EACR,KAAKD,CAAI,EACT,KAAME,GAAOH,EAAM,iBAAiBG,CAAE,CAAC,EACvC,MAAOC,GAAiB,CACrBC,EAAAA,MAAM,KAAK,GAAGH,CAAK,qCAAsCE,CAAG,EAC5DJ,EAAM,iBAAiB,MAAS,CACpC,CAAC,CACT"}
|
|
@@ -2,14 +2,21 @@ import { Telemetry } from '../core/telemetry';
|
|
|
2
2
|
/**
|
|
3
3
|
* Shared foreground/background emitter — the single source of truth so the native
|
|
4
4
|
* (RN AppState) and web (visibilitychange) lifecycle adapters stay in lockstep on the
|
|
5
|
-
*
|
|
5
|
+
* `app.lifecycle` catalogue event (#30, #179).
|
|
6
6
|
*
|
|
7
|
-
* Feed it the current active state via `onState(isActive)`. It emits `
|
|
8
|
-
* on a transition, carrying the direction as `
|
|
7
|
+
* Feed it the current active state via `onState(isActive)`. It emits `app.lifecycle` only
|
|
8
|
+
* on a transition, carrying the direction as `lifecycle.state` (foreground|background).
|
|
9
9
|
*/
|
|
10
10
|
export declare class AppLifecycleEmitter {
|
|
11
11
|
private telemetry;
|
|
12
12
|
private active?;
|
|
13
13
|
constructor(telemetry: Telemetry);
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Returns once the transition's rows are enqueued — **await it before flushing**. The
|
|
16
|
+
* background boundary's `view` row is the one most likely to be lost to an OS kill, and
|
|
17
|
+
* the whole point of §4.5's background boundary is that it flushes while the app is still
|
|
18
|
+
* reliably alive. A caller that fires the flush on the next line instead sends the batch
|
|
19
|
+
* before the row exists.
|
|
20
|
+
*/
|
|
21
|
+
onState(isActive: boolean): Promise<void>;
|
|
15
22
|
}
|
|
@@ -1,2 +1,48 @@
|
|
|
1
1
|
import { TelemetryEvent } from '../core/telemetry';
|
|
2
|
+
/**
|
|
3
|
+
* The catalogue's contract version this build speaks (#179, processor #29). Only the major gates
|
|
4
|
+
* parsing; the minor follows the catalogue tag pinned in `catalogue.version`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CONTRACT_VERSION = "4.3.0";
|
|
7
|
+
/**
|
|
8
|
+
* The 8-key 4.x envelope (`envelope.yaml`), shared by both senders so the web and native POST
|
|
9
|
+
* bodies stay byte-identical. Identity comes from the rows themselves, so a batch persisted by
|
|
10
|
+
* a prior launch replays under that launch's `app` block. Every row of one batch shares it:
|
|
11
|
+
* the live queue has one identity per process, and `byIdentity()` splits a replayed one.
|
|
12
|
+
*/
|
|
2
13
|
export declare function buildBatch(events: TelemetryEvent[]): string;
|
|
14
|
+
/** Rows grouped by identity, first-seen order — one envelope per group on replay. */
|
|
15
|
+
export declare function byIdentity(events: TelemetryEvent[]): TelemetryEvent[][];
|
|
16
|
+
/**
|
|
17
|
+
* Replay a recovered queue, one POST per identity. On a failure the unsent rows go back to the
|
|
18
|
+
* store — minus the failed group itself when it was rejected (§2.5: a 4xx is dropped, never kept).
|
|
19
|
+
*/
|
|
20
|
+
export declare function replayGroups(stored: TelemetryEvent[], post: (events: TelemetryEvent[]) => Promise<void>, persist: (events: TelemetryEvent[]) => unknown): Promise<void>;
|
|
21
|
+
export declare function buildHeaders(credential: string | undefined): Record<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* A non-2xx the senders refuse to retry (§2.5): any 4xx, 429 included. `resetAt` is the epoch
|
|
24
|
+
* ms `X-RateLimit-Reset` names, when the collector sent one. Core reads `status` by shape, so
|
|
25
|
+
* a consumer's own sender can throw `{ status: 401 }` and get the same handling.
|
|
26
|
+
*/
|
|
27
|
+
export declare class HttpStatusError extends Error {
|
|
28
|
+
readonly status: number;
|
|
29
|
+
readonly resetAt?: number | undefined;
|
|
30
|
+
constructor(status: number, resetAt?: number | undefined);
|
|
31
|
+
}
|
|
32
|
+
/** The status a send failed with, when it failed with one; `undefined` for network and the rest. */
|
|
33
|
+
export declare function statusOf(err: unknown): number | undefined;
|
|
34
|
+
/** 4xx except 429: drop the batch — no retry, no persist (§2.5). */
|
|
35
|
+
export declare const isRejected: (err: unknown) => boolean;
|
|
36
|
+
type PostResult = {
|
|
37
|
+
ok: boolean;
|
|
38
|
+
status: number;
|
|
39
|
+
headers?: any;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Retry + backoff, shared by both senders so the §2.5 status table is one rule. 5xx and network
|
|
43
|
+
* errors retry; a 4xx — 429 included — throws at once, because retrying a wrong credential three
|
|
44
|
+
* times only delays the drop and retrying a 429 is the stampede the header exists to stop.
|
|
45
|
+
*/
|
|
46
|
+
export declare function sendWithRetry(post: () => Promise<PostResult>, retryCount: number, backoffMs: (attempt: number) => number): Promise<void>;
|
|
47
|
+
export declare const DEFAULT_ENDPOINT = "https://your.telemetry.endpoint/telemetry";
|
|
48
|
+
export {};
|
|
@@ -1,13 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* §4.7 — the error surface. Two event names, not one: `app.crash` is unhandled /
|
|
3
|
+
* fatal-ish, `app.error` is handled or non-fatal, so
|
|
4
|
+
* `COUNT(event_name='app.crash') / sessions` is a crash-free rate with no `WHERE`
|
|
5
|
+
* clause anyone can forget. All five v3 `crash.*` keys are retired for dotted
|
|
6
|
+
* `error.*`, and both explicit wire nulls go with them. #100
|
|
7
|
+
*/
|
|
8
|
+
/** `error.source` — a full re-cut of v3's `crash.cause`, not a rename. 5 values. */
|
|
9
|
+
export type ErrorSource = "global_handler" | "unhandled_rejection" | "cross_origin" | "console" | "reported" | "boundary";
|
|
10
|
+
/** `error.component_stack` (#166): raw, same 2000 cap, cut on a line boundary like a stack. */
|
|
11
|
+
export declare const capComponentStack: (stack: string) => string;
|
|
12
|
+
export declare function markBoundaryCaught(error: unknown): void;
|
|
13
|
+
export declare function isBoundaryCaught(error: unknown): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* `error.type` is read from `error.name` **only, never `constructor.name`**: RN production
|
|
16
|
+
* bundles minify class names, so `class PaymentError extends Error {}` would report as `"a"`
|
|
17
|
+
* — not merely unreadable but *unstable across builds*, refragmenting grouping on every
|
|
18
|
+
* deploy. `error.name` is a string literal in the author's source. Un-named classes report
|
|
19
|
+
* `"Error"`: low cardinality, but honest.
|
|
20
|
+
*/
|
|
21
|
+
export declare function errorType(error: unknown): string;
|
|
22
|
+
/**
|
|
23
|
+
* The `error.*` block for both event names. `error.handled` does not exist — the event name
|
|
24
|
+
* carries that bit, and carrying both is a denormalization that can disagree. `error.fatal`
|
|
25
|
+
* is passed only by the native build (§4.7: on web nothing is fatal).
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildErrorAttributes(source: ErrorSource, error: unknown, opts?: {
|
|
28
|
+
fallbackMessage?: unknown;
|
|
6
29
|
fatal?: boolean;
|
|
7
30
|
}): Record<string, any>;
|
|
31
|
+
/** What `captureConsole` needs of a `Telemetry` — structural. */
|
|
32
|
+
type ErrorSink = {
|
|
33
|
+
captureError(error: unknown, context?: Record<string, any>, source?: ErrorSource): unknown;
|
|
34
|
+
addBreadcrumb(name: string, data?: Record<string, any>): void;
|
|
35
|
+
};
|
|
8
36
|
/**
|
|
9
|
-
* Patch console.error
|
|
10
|
-
*
|
|
11
|
-
*
|
|
37
|
+
* Patch console.error → `app.error` (source `console`) and console.warn → a **breadcrumb**.
|
|
38
|
+
* `ConsoleWarn` is deleted outright: React's own dev-mode warnings were the dominant
|
|
39
|
+
* contributor to v3's crash count, which is what made "is my app crashing more?"
|
|
40
|
+
* unanswerable. Opt-*in* now — `captureConsole` defaults off (§4.7).
|
|
41
|
+
*
|
|
42
|
+
* Returns a restore fn. A reentrancy guard keeps the SDK's own console writes during
|
|
43
|
+
* logging from re-capturing.
|
|
12
44
|
*/
|
|
13
|
-
export declare function captureConsole(telemetry:
|
|
45
|
+
export declare function captureConsole(telemetry: ErrorSink, target?: Pick<Console, "error" | "warn">): () => void;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A failure row's battery keys, or none. `-1` (simulator), non-finite or out of range → omitted. */
|
|
2
|
+
export declare function batteryAttributes(level: unknown, charging: unknown, powerSave: unknown): Record<string, number | boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* One read, settled to a value or `undefined` — a throw, a rejection, a missing method or a
|
|
5
|
+
* non-boolean/non-finite answer all omit that one key, never the others.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readOr<T>(read: () => T | Promise<T>, valid: (v: unknown) => boolean): Promise<T | undefined>;
|
|
8
|
+
export declare const isBool: (v: unknown) => v is boolean;
|
|
9
|
+
export declare const isFiniteNumber: (v: unknown) => boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StoreRead } from '../core/store';
|
|
2
|
+
import { TelemetryEvent } from '../core/telemetry';
|
|
3
|
+
export declare const FAILED_EVENTS_KEY = "telemetry_failed_events";
|
|
4
|
+
/**
|
|
5
|
+
* Decode a stored batch.
|
|
6
|
+
*
|
|
7
|
+
* The Store port never throws, and neither does this. An unavailable store, a key that
|
|
8
|
+
* was never written, a half-written payload and a non-array JSON value all mean the
|
|
9
|
+
* same thing to a caller — nothing replayable — so they all return `[]`. Before the
|
|
10
|
+
* port, this was a bare `JSON.parse(... || "[]")` that threw straight through
|
|
11
|
+
* `replayFailed()` on any corrupt payload and took startup with it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function decodeFailed(read: StoreRead): TelemetryEvent[];
|
|
14
|
+
/**
|
|
15
|
+
* The offline store's cap (§9.4). Real numbers, not chosen ones: Android caps AsyncStorage
|
|
16
|
+
* at 6 MB for the whole app and web `localStorage` is the *host app's* ~5 MB — an
|
|
17
|
+
* append-only telemetry queue inside either is a slow eviction of the consumer's own data.
|
|
18
|
+
*/
|
|
19
|
+
export declare const STORE_MAX_EVENTS = 500;
|
|
20
|
+
export declare const STORE_MAX_BYTES = 1000000;
|
|
21
|
+
/**
|
|
22
|
+
* Encode the queue after appending `incoming`, oldest first, capped per §9.4 and
|
|
23
|
+
* reporting how many rows the cap cost.
|
|
24
|
+
*
|
|
25
|
+
* The caller books the count as `sdk.drop_reason = "store_full"`; returning it rather
|
|
26
|
+
* than counting in here keeps this module free of the Telemetry instance it would
|
|
27
|
+
* otherwise need a handle on.
|
|
28
|
+
*/
|
|
29
|
+
export declare function encodeFailed(existing: TelemetryEvent[], incoming: TelemetryEvent[]): {
|
|
30
|
+
json: string;
|
|
31
|
+
dropped: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* One drain per sender, however many callers there are (#113).
|
|
35
|
+
*
|
|
36
|
+
* `takeFailed()` clears the key before the send is attempted, so a *single* drain can
|
|
37
|
+
* never double-send. Two concurrent drains can: both read the payload before either
|
|
38
|
+
* removes it, and the recovered batch goes out twice — worst exactly when the network
|
|
39
|
+
* was bad, which is when the data mattered. Returning the in-flight promise makes the
|
|
40
|
+
* second caller a no-op that still awaits the first, and the guard is per-sender rather
|
|
41
|
+
* than per-module so two `Telemetry` instances in one process keep their own.
|
|
42
|
+
*/
|
|
43
|
+
export declare function guardedDrain(drain: () => Promise<void>): () => Promise<void>;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
|
|
1
|
+
export type FrameWindow = {
|
|
2
|
+
"frame.total_frames": number;
|
|
3
|
+
"frame.slow_frames": number;
|
|
4
|
+
"frame.frozen_frames": number;
|
|
5
|
+
"frame.max_total_duration_ms": number;
|
|
6
|
+
"frame.p95_ms": number;
|
|
7
|
+
"display.refresh_rate": number;
|
|
8
|
+
"frame.window_duration_ms": number;
|
|
9
|
+
"frame.source": string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `deltas` must be non-empty. Percentile is nearest-rank on the sorted deltas.
|
|
13
|
+
* `windowMs` is the *actual* elapsed window — variable-length since §5.1's view-boundary
|
|
14
|
+
* reset, which is exactly why `frame.window_duration_ms` rides every window.
|
|
15
|
+
*
|
|
16
|
+
* A rAF delta is a vsync interval, quantized to the budget: "slow" is a missed vsync, read as
|
|
17
|
+
* over twice the budget so jitter around one interval never counts.
|
|
18
|
+
*/
|
|
19
|
+
export declare function aggregateFrames(deltas: number[], windowMs: number, source: string): FrameWindow;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All this tracker needs of core. Structural, so it is testable without a `Telemetry`.
|
|
3
|
+
*/
|
|
4
|
+
type FrameEmitter = {
|
|
5
|
+
log(name: string, data?: Record<string, any>): unknown;
|
|
6
|
+
views: {
|
|
7
|
+
onBoundary(fn: () => unknown): () => void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare class FrameDropTracker {
|
|
11
|
+
private telemetry;
|
|
12
|
+
private windowMs;
|
|
13
|
+
private lastFrameTime;
|
|
14
|
+
private windowStart;
|
|
15
|
+
private deltas;
|
|
16
|
+
private started;
|
|
17
|
+
constructor(telemetry: FrameEmitter, windowMs?: number);
|
|
18
|
+
/** Idempotent in full: a second call must not start a second rAF loop double-counting frames. */
|
|
19
|
+
start(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Close the open window and ship it. `ViewManager` **awaits** this at a boundary and
|
|
22
|
+
* before the successor mints, which is what lands a route change's dropped frames on the
|
|
23
|
+
* departing `view.id` rather than the arriving one (§5.1).
|
|
24
|
+
*
|
|
25
|
+
* An empty window emits nothing — a p95 over no samples is not a number — but it still
|
|
26
|
+
* resets the clock, so `frame.window_duration_ms` always describes the samples it carries.
|
|
27
|
+
*/
|
|
28
|
+
private emitWindow;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LogSnapshot } from '../core/telemetry';
|
|
2
|
+
import { TraceAttributes } from './traceManager';
|
|
3
|
+
/** Internal constants, never `TelemetryOpts` surface. */
|
|
4
|
+
export declare const HANG_TICK_MS = 1000;
|
|
5
|
+
export declare const HANG_THRESHOLD_MS = 2000;
|
|
6
|
+
/** Longer than this is a suspension (device sleep, a frozen tab), not a hang the user sat through. */
|
|
7
|
+
export declare const HANG_SUSPENSION_MS = 60000;
|
|
8
|
+
/**
|
|
9
|
+
* The stall between two ticks, or `undefined` when there is none to report: how late the
|
|
10
|
+
* timer fired past its schedule, so the tick interval itself is never booked as stall.
|
|
11
|
+
* ⚠ At 1 s resolution this under-reports by up to one tick — a stall that began mid-interval
|
|
12
|
+
* is partly absorbed by the wait the timer would have done anyway. Never over-reports.
|
|
13
|
+
*/
|
|
14
|
+
export declare function stallMs(prevTick: number, now: number): number | undefined;
|
|
15
|
+
type Core = {
|
|
16
|
+
snapshot(at?: number): LogSnapshot;
|
|
17
|
+
trace: {
|
|
18
|
+
annotate(now?: number): TraceAttributes;
|
|
19
|
+
};
|
|
20
|
+
log(name: string, data?: Record<string, any>, snapshot?: LogSnapshot): Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export declare class HangDetector {
|
|
23
|
+
private core;
|
|
24
|
+
private now;
|
|
25
|
+
private timer?;
|
|
26
|
+
/** The last good tick — what a stall is attributed to: where the user was when it froze. */
|
|
27
|
+
private last?;
|
|
28
|
+
constructor(core: Core, now?: () => number);
|
|
29
|
+
private active;
|
|
30
|
+
private suspended;
|
|
31
|
+
/** Driven by the lifecycle emitter: foreground only, so background suspension never reads as a hang. */
|
|
32
|
+
setActive(active: boolean): void;
|
|
33
|
+
/** `disable()` / `enable()` (#172): off while collection is off, whatever the lifecycle says. */
|
|
34
|
+
suspend(suspended: boolean): void;
|
|
35
|
+
private sync;
|
|
36
|
+
start(): void;
|
|
37
|
+
/** Idempotent. `shutdown()` and backgrounding call it; the next start begins a fresh baseline. */
|
|
38
|
+
stop(): void;
|
|
39
|
+
private tick;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path → route template. `/` stays `/`, no case folding, trailing slash dropped, depth capped
|
|
3
|
+
* at 6 segments with a trailing `/…`. No cardinality guard: a client-side rolling collapse
|
|
4
|
+
* would make one row mean different things on different phones.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeRoute(path: string): string;
|
|
7
|
+
/** UTF-8 byte length. v3 shipped `String.length` — UTF-16 code units, 2-3× short on non-ASCII. */
|
|
8
|
+
export declare function utf8Bytes(s: string): number;
|
|
9
|
+
/**
|
|
10
|
+
* Body size for every type measurable **without consuming the body**. `FormData` and streams
|
|
11
|
+
* return undefined and the key is omitted — draining a consumer's request body is a far worse
|
|
12
|
+
* bug than a missing key.
|
|
13
|
+
*/
|
|
14
|
+
export declare function requestBodySize(body: unknown): number | undefined;
|
|
15
|
+
/** `content-length` → a response size. Absent or unparseable → undefined, so the key is omitted. */
|
|
16
|
+
export declare function contentLengthSize(header: string | null | undefined): number | undefined;
|
|
17
|
+
/** The #95 invariant, in one place: an `http.request` never describes the collector POST. */
|
|
18
|
+
export declare function isCollectorUrl(url: string, endpoint: string | undefined): boolean;
|
|
1
19
|
export declare function buildHttpAttributes(args: {
|
|
2
20
|
url: string;
|
|
3
21
|
method: string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The quiet window, and **the same constant as §4.6's dead-click window** — one constant, not
|
|
3
|
+
* two. `ui.dead` (web only, not built yet) must import this rather than declare a second 1000.
|
|
4
|
+
*/
|
|
5
|
+
export declare const QUIET_WINDOW_MS = 1000;
|
|
6
|
+
/** Hard cap (§4.5.2). A capped view emits **null, not the cap**: at 30 s, 30 s and 90 s are the same row. */
|
|
7
|
+
export declare const LOADING_TIME_CAP_MS = 30000;
|
|
8
|
+
/** §4.5's `view.loading_time_outcome` domain — never null, exactly four values. */
|
|
9
|
+
export type LoadingTimeOutcome = "settled" | "no_activity" | "capped" | "abandoned";
|
|
10
|
+
export type LoadingTimeResult = {
|
|
11
|
+
/** Milliseconds, or null — and null has three causes, which is why the outcome ships beside it. */
|
|
12
|
+
loadingTime: number | null;
|
|
13
|
+
outcome: LoadingTimeOutcome;
|
|
14
|
+
};
|
|
15
|
+
export type NetworkSettleOpts = {
|
|
16
|
+
/**
|
|
17
|
+
* `initial_load` only: the view starts **busy** until the platform's own runtime-ready
|
|
18
|
+
* marker (`loadEventEnd` on web, `performance.rnStartupTiming` on native), then settles.
|
|
19
|
+
* Every other `load_type` runs the same column with no seed.
|
|
20
|
+
*/
|
|
21
|
+
awaitRuntimeReady?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* One view's settle state. Constructed per view and handed the requests that **started** in
|
|
25
|
+
* it — a request in flight across a view boundary belongs to the old view and does not hold
|
|
26
|
+
* the new one open (§4.5.2), which is why the completion callback is bound to this instance
|
|
27
|
+
* rather than looked up on whatever view is live when the response lands.
|
|
28
|
+
*/
|
|
29
|
+
export declare class NetworkSettle {
|
|
30
|
+
private readonly viewStart;
|
|
31
|
+
private started;
|
|
32
|
+
private inFlight;
|
|
33
|
+
private lastEnd?;
|
|
34
|
+
/** Frozen the first time quiet is *observed*, so a later request cannot un-settle the view. */
|
|
35
|
+
private settledAt?;
|
|
36
|
+
private awaitingRuntimeReady;
|
|
37
|
+
private runtimeReadyAt?;
|
|
38
|
+
constructor(viewStart: number, opts?: NetworkSettleOpts);
|
|
39
|
+
/** `view.request_count` — requests **started** in this view, failures included (§4.5). */
|
|
40
|
+
get requestCount(): number;
|
|
41
|
+
/**
|
|
42
|
+
* The platform's runtime-ready marker, or `undefined` where the platform has none —
|
|
43
|
+
* Old Architecture, or a runtime that omits it (§4.3). Either way this releases the gate:
|
|
44
|
+
* a marker that never arrives must not make every launch report `abandoned`.
|
|
45
|
+
*/
|
|
46
|
+
seedRuntimeReady(at?: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* A request started in this view. Returns its completion callback — idempotent, because an
|
|
49
|
+
* XHR `loadend` can fire more than once for a reused instance and an unbalanced in-flight
|
|
50
|
+
* count would hold the view open forever.
|
|
51
|
+
*/
|
|
52
|
+
requestStarted(now?: number): (endedAt?: number) => void;
|
|
53
|
+
/**
|
|
54
|
+
* The view's verdict at exit. Idempotent, not pure: it may freeze the settle timestamp as
|
|
55
|
+
* a side effect, which is deliberate — once quiet has been *observed* it cannot be undone
|
|
56
|
+
* by a later call, and calling this twice must not produce two different answers.
|
|
57
|
+
*/
|
|
58
|
+
resolve(now?: number): LoadingTimeResult;
|
|
59
|
+
/**
|
|
60
|
+
* Settle is the *completion* timestamp, not the moment we noticed it — the quiet window is
|
|
61
|
+
* detection delay and is subtracted back out. That is free precisely because the `view`
|
|
62
|
+
* event emits at view exit rather than at settle, so nothing waits on the window.
|
|
63
|
+
*/
|
|
64
|
+
private freezeIfQuiet;
|
|
65
|
+
/** When the network last went quiet, or undefined while the view is still busy. */
|
|
66
|
+
private quietSince;
|
|
67
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TraceAttributes } from './traceManager';
|
|
2
|
+
/** A leak in host code must not grow without bound. Internal, never `TelemetryOpts`. */
|
|
3
|
+
export declare const MAX_OPEN_SPANS = 32;
|
|
4
|
+
export type TaskOutcome = "completed" | "failed" | "abandoned";
|
|
5
|
+
export type OpenSpan = {
|
|
6
|
+
name: string;
|
|
7
|
+
start: number;
|
|
8
|
+
attrs?: Record<string, unknown>;
|
|
9
|
+
/** Frozen at start (§3.1). Unset only while a start waits on an expired session's rotation. */
|
|
10
|
+
keys?: TraceAttributes;
|
|
11
|
+
viewId?: string;
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
sessionStart?: number;
|
|
14
|
+
/** That rotation — an end arriving before it settles waits on it. */
|
|
15
|
+
ready?: Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
/** The persisted form: identity frozen, attributes as a JSON string so a cycle cannot break the record. */
|
|
18
|
+
export type PersistedSpan = Omit<OpenSpan, "attrs" | "ready"> & {
|
|
19
|
+
attrs?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function spanAttributes(attrs: unknown): Record<string, unknown> | undefined;
|
|
22
|
+
/** Unnormalized and capped at 255; blank or non-string is inert (`undefined`). */
|
|
23
|
+
export declare function taskName(name: unknown): string | undefined;
|
|
24
|
+
export declare class SpanRegistry {
|
|
25
|
+
private open;
|
|
26
|
+
/**
|
|
27
|
+
* Opens `name`, superseding an open span of the same name — dropped without a row, since
|
|
28
|
+
* `abandoned` means "the session ended first" and nothing else. `undefined` past the cap.
|
|
29
|
+
*/
|
|
30
|
+
start(name: string, start: number, attrs?: Record<string, unknown>): OpenSpan | undefined;
|
|
31
|
+
/** Close by name. With `only`, a superseded handle cannot close its successor. */
|
|
32
|
+
take(name: string, only?: OpenSpan): OpenSpan | undefined;
|
|
33
|
+
/** `disable()` (#172): an opt-out keeps nothing, open journeys included. */
|
|
34
|
+
clear(): void;
|
|
35
|
+
has(span: OpenSpan): boolean;
|
|
36
|
+
/** Every span frozen to `sessionId`, removed — the ones a finalize owes `abandoned`. */
|
|
37
|
+
takeSession(sessionId: string): OpenSpan[];
|
|
38
|
+
toJSON(): PersistedSpan[];
|
|
39
|
+
/** Adopt a persisted record's spans. Anything malformed is skipped, never thrown. */
|
|
40
|
+
restore(saved: unknown): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type AutoTapKind = "tap" | "long_press";
|
|
2
|
+
/** What the entry hands in: called synchronously at activation, *before* the host handler. */
|
|
3
|
+
export type AutoTapSink = {
|
|
4
|
+
/** Snapshot identity and mint the root now; returns the emit to run after the handler, or nothing. */
|
|
5
|
+
prepare(kind: AutoTapKind, testID: unknown): (() => void) | undefined;
|
|
6
|
+
/** Increments on every explicit `trackTap()` — an explicit call inside the handler wins. */
|
|
7
|
+
explicitCount(): number;
|
|
8
|
+
};
|
|
9
|
+
export declare function wrapProps(props: any): any;
|
|
10
|
+
/**
|
|
11
|
+
* Patch the element factories on the given module exports objects (`react/jsx-runtime`,
|
|
12
|
+
* `react/jsx-dev-runtime`, `react`). Idempotent per module. Never throws: a frozen exports
|
|
13
|
+
* object just stays unpatched.
|
|
14
|
+
*/
|
|
15
|
+
export declare function patchElementFactories(modules: unknown[], next: AutoTapSink): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DeviceStateHandler } from '../../core/telemetry';
|
|
2
|
+
/**
|
|
3
|
+
* #173, native. Battery is a **cached** read — refreshed at start, on foreground and every 60 s —
|
|
4
|
+
* so a failure row never awaits a native call. `react-native-device-info` is an optional peer and
|
|
5
|
+
* an older one lacks these methods, so every read is optional-chained and guarded.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DeviceStateNative implements DeviceStateHandler {
|
|
8
|
+
private cached;
|
|
9
|
+
private timer;
|
|
10
|
+
battery(): Record<string, number | boolean>;
|
|
11
|
+
refresh(): Promise<void>;
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): void;
|
|
14
|
+
accessibility(): Promise<Record<string, number | boolean>>;
|
|
15
|
+
}
|