@datadog/browser-rum-shopify 7.16.2 → 7.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/chunks/{datadogProfiler-2aa04984c2bf50fa9be4-datadog-rum-shopify.js → datadogProfiler-69f13dc9a235dcd5b806-datadog-rum-shopify.js} +1 -1
- package/bundle/datadog-rum-shopify.js +1 -1
- package/cjs/boot/patchSandboxedIframeApis.js +1 -2
- package/cjs/domain/shopifyAnalytics.js +1 -2
- package/cjs/domain/shopifyBindings.js +1 -2
- package/cjs/domain/shopifyPlugin.js +1 -2
- package/cjs/entries/main.js +1 -2
- package/esm/boot/patchSandboxedIframeApis.mjs +1 -2
- package/esm/domain/shopifyAnalytics.mjs +1 -2
- package/esm/domain/shopifyBindings.mjs +1 -2
- package/esm/domain/shopifyPlugin.mjs +1 -2
- package/esm/entries/main.mjs +1 -2
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __webpack_esm_ids__=["datadogProfiler"];export const __webpack_esm_modules__={7492(e,t,n){n.d(t,{createRumProfiler:()=>O});var s=n(5762),o=n(2128),a=n(8975),r=n(449),i=n(8333),l=n(9305),c=n(4215),u=n(5648),d=n(1e3);function p(){const e=(0,l.Y9)();return t=>{e.send("profile",t)}}var f=n(
|
|
1
|
+
export const __webpack_esm_ids__=["datadogProfiler"];export const __webpack_esm_modules__={7492(e,t,n){n.d(t,{createRumProfiler:()=>O});var s=n(5762),o=n(2128),a=n(8975),r=n(449),i=n(8333),l=n(9305),c=n(4215),u=n(5648),d=n(1e3);function p(){const e=(0,l.Y9)();return t=>{e.send("profile",t)}}var f=n(6196);function v(e,t,n){const s=(0,f.wP)(e,t,n,6);return({profile:e,trace:t})=>{const n={event:e,"wall-time.json":t};s.send(n)}}const m=/\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g,k=(e,t)=>e||function(e){return e?e.replace(m,"/?"):"/"}(t);var b=n(98);function g(e,t,n){const s=(0,b.m5)(t),o=function(e,t,n){const{ids:s,names:o}=function(e){const t={ids:[],names:[]};for(const n of e)t.ids.push(n.viewId),n.viewName&&t.names.push(n.viewName);return t.names=Array.from(new Set(t.names)),t}(e.views),a=e.longTasks.map(e=>e.id).filter(e=>void 0!==e),r=e.actions?.map(e=>e.id).filter(e=>void 0!==e)??[],{ids:i,labels:l}=function(e){const t={ids:[],labels:[]};if(!e)return t;for(const n of e)t.ids.push(n.id),t.labels.push(n.label);return t.labels=Array.from(new Set(t.labels)),t}(e.vitals),c={application:{id:t}};return n&&(c.session={id:n}),s.length&&(c.view={id:s,name:o}),a.length&&(c.long_task={id:a}),r.length&&(c.action={id:r,label:[]}),i.length&&(c.vital={id:i,label:l}),c}(e,t.applicationId,n),a=function(e){return e.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"])}(s);return{...o,attachments:["wall-time.json"],start:new Date(e.startClocks.timeStamp).toISOString(),end:new Date(e.endClocks.timeStamp).toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:a.join(","),_dd:{clock_drift:(0,i._O)()}}}var _=n(603),h=n(2511);const w=_.AQ;function y(e){const t=(0,h.qj)({expireDelay:w});return e.subscribe(12,({rawRumEvent:e,startClocks:n,duration:s})=>{"long_task"===e.type&&t.add({id:e.long_task.id,startClocks:n,duration:s,entryType:e.long_task.entry_type===f.K.LONG_TASK?f.do.LONG_TASK:f.do.LONG_ANIMATION_FRAME},n.relative).close((0,i.Gw)(n.relative,s))}),t}const C=_.AQ;function I(e){const t=(0,h.qj)({expireDelay:C});return e.subscribe(15,e=>{t.add({id:e.id,label:"",startClocks:e.startClocks,duration:void 0},e.startClocks.relative)}),e.subscribe(12,({rawRumEvent:e,startClocks:n,duration:s})=>{if("action"===e.type){const o=t.getEntries(n.relative).find(t=>t.value.id===e.action.id),a=s??0;o?(o.value.duration=a,o.close((0,i.Gw)(n.relative,a))):t.add({id:e.action.id,label:"",startClocks:n,duration:s},n.relative).close((0,i.Gw)(n.relative,a))}}),t}const T=_.AQ;function D(e){const t=(0,h.qj)({expireDelay:T});return e.subscribe(16,e=>{t.add({id:e.id,type:f.DL.DURATION,startClocks:e.startClocks,duration:void 0,label:e.name},e.startClocks.relative)}),e.subscribe(12,({rawRumEvent:e,startClocks:n,duration:s})=>{if("vital"!==e.type)return;if(e.vital.type===f.DL.WEBSOCKET)return;const o=e.vital;if(o.type===f.DL.OPERATION_STEP){if("start"===o.step_type)t.add({id:o.id,type:o.type,operationKey:o.operation_key,startClocks:n,label:o.name},n.relative);else if("end"===o.step_type){const e=t.findAllEntries().find(e=>e.value.type===f.DL.OPERATION_STEP&&e.value.label===o.name&&e.value.operationKey===o.operation_key);if(!e)return;e.value.duration=(0,i.vk)(e.value.startClocks.relative,n.relative),e.close(n.relative)}return}const a=t.getEntries(n.relative).find(e=>e.value.id===o.id);if(a)return a.value.duration=s,void a.close((0,i.Gw)(n.relative,s));t.add({id:o.id,type:o.type,operationKey:o.operation_key,startClocks:n,duration:s,label:o.name},n.relative).close((0,i.Gw)(n.relative,s))}),t}var E=n(5358),S=n(5387);function q(e,t,n=5e3){const s=function(e,t){return(0,S.Hg)({proxy:e.proxy,site:e.site,path:"/api/v2/profiling/quota",parameters:"session_id="+t,subdomain:"quota"})}(e,t),o=new AbortController;let r;const i=(0,E.h)(s,{credentials:"omit",signal:o.signal,headers:new Headers({"DD-CLIENT-TOKEN":e.clientToken})}).then(e=>{const t=429===e.status?{decision:"quota_ko",reason:"quota_exceeded"}:{decision:"quota_ok",reason:"api-error"};return e.json().then(e=>((0,a.DJ)(r),function(e,t){const n=e?.data?.attributes;if(!n||"boolean"!=typeof n.admitted||"string"!=typeof n.reason)return t;const s="backend_client_not_initialized"===n.reason?"backend_unavailable":n.reason;return{decision:n.admitted?"quota_ok":"quota_ko",reason:s}}(e,t)),()=>((0,a.DJ)(r),t))}).catch(()=>((0,a.DJ)(r),{decision:"quota_ok",reason:"api-error"})),l=new Promise(e=>{r=(0,a.wg)(()=>{o.abort(),e({decision:"quota_ok",reason:"timeout"})},n)});return Promise.race([i,l])}var A=n(8032);function M(e){const t=new Map((0,A.Jv)(e)?.map(e=>[e.url,e.id])),n=[];return e.forEach((e,s)=>{const o=t.get(e);void 0!==o&&n.push({resourceId:s,debugId:o})}),n.length?n:void 0}const R={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3};function O(e,t,n,f,m,b,_=R){const h=(0,l.d0)()?(0,s.B)(p)():(0,s.B)(v)(e,t,m);let w;const C=[],T=(0,s.B)(y)(t),E=(0,s.B)(I)(t),S=(0,s.B)(D)(t);let A={state:"stopped",stateReason:"initializing"},O=0;function P(){if("running"===A.state)return;const t=b.findView();w=t?{startClocks:t.startClocks,viewId:t.id,viewName:k(t.name,document.location.pathname)}:void 0,C.push((0,r.q2)(window,"visibilitychange",G).stop,(0,r.q2)(window,"beforeunload",K).stop),N(),function(){if((0,l.d0)())return;const t=++O,o=n.findTrackedSession()?.id;o&&(0,s.B)(q)(e,o).then(e=>{t===O&&("running"!==A.state&&"paused"!==A.state||"quota_ko"===e.decision&&x("quota_ko",e.reason))}).catch(d.Dx)}()}function x(e,t){!function(e){if("running"!==A.state)return void(("paused"===A.state||"stopped"===A.state&&"stopped-by-user"===e)&&(A={state:"stopped",stateReason:e}));const t=A;A={state:"stopped",stateReason:e},t.cleanupTasks.forEach(e=>e()),"quota_ko"===e?((0,a.DJ)(t.timeoutId),t.profiler.removeEventListener("samplebufferfull",B),t.profiler.stop().catch(d.Dx)):L(t)}(e),C.forEach(e=>e()),C.length=0,f.set({status:"stopped",error_reason:void 0,quota_reason:t})}function N(){const e=o.J.Profiler;if(!e)throw f.set({status:"error",error_reason:"not-supported-by-browser"}),Error("RUM Profiler is not supported in this browser.");"running"===A.state&&L(A);const{cleanupTasks:s}=function(e){if("running"===e.state)return{cleanupTasks:e.cleanupTasks};const n=[],s=t.subscribe(2,e=>{const t={viewId:e.id,viewName:k(e.name,document.location.pathname),startClocks:e.startClocks};j(t),w=t});return n.push(s.unsubscribe),{cleanupTasks:n}}(A);let r;try{r=new e({sampleInterval:_.sampleIntervalMs,maxBufferSize:Math.round(1.5*_.collectIntervalMs/_.sampleIntervalMs)})}catch(e){return void(e instanceof Error&&e.message.includes("disabled by Document Policy")?(u.V.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",e),f.set({status:"error",error_reason:"missing-document-policy-header"})):f.set({status:"error",error_reason:"unexpected-exception"}))}f.set({status:"running",error_reason:void 0}),A={state:"running",startClocks:(0,i.M8)(),profiler:r,timeoutId:(0,a.wg)(N,_.collectIntervalMs),views:[],cleanupTasks:s,longTasks:[],sessionId:n.findTrackedSession()?.id},j(w),r.addEventListener("samplebufferfull",B)}function L(t){(0,a.DJ)(t.timeoutId),t.profiler.removeEventListener("samplebufferfull",B);const{startClocks:n,views:s,sessionId:o}=t;t.profiler.stop().then(t=>{const a=(0,i.M8)(),r=(0,i.vk)(n.relative,a.relative),l=T.findAll(n.relative,r),c=E.findAll(n.relative,r),u=S.findAll(n.relative,r).map(e=>({id:e.id,label:e.label,startClocks:e.startClocks,duration:e.duration})),d=r<_.minProfileDurationMs;0===l.length&&d||function(t,n){const s={profile:g(t,e,n),trace:t};h(s)}(Object.assign({},t,{startClocks:n,endClocks:a,clocksOrigin:(0,i.Oc)(),longTasks:l,actions:c,vitals:u,views:s,sampleInterval:_.sampleIntervalMs,debugIds:M(t.resources)}),o)}).catch(d.Dx)}function j(e){"running"===A.state&&e&&A.views.push(e)}function B(){N()}function G(){"hidden"===document.visibilityState&&"running"===A.state?function(){if("running"!==A.state)return;const e=A;A={state:"paused"},e.cleanupTasks.forEach(e=>e()),L(e)}():"visible"===document.visibilityState&&"paused"===A.state&&N()}function K(){N()}return t.subscribe(9,()=>{x("session-expired")}),t.subscribe(10,()=>{if("stopped"===A.state&&("session-expired"===A.stateReason||"quota_ko"===A.stateReason)){const t=n.findTrackedSession();if(!t||!(0,c.$5)(t.id,(0,c.it)(e.sessionSampleRate,e.profilingSampleRate)))return;P()}}),{start:P,stop(){x("stopped-by-user")},isStopped:()=>"stopped"===A.state,isRunning:()=>"running"===A.state,isPaused:()=>"paused"===A.state}}}};
|