Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
chore: remove datadog sessionreplay (#6084)
Browse files Browse the repository at this point in the history
  • Loading branch information
habib-deriv authored Dec 1, 2023
1 parent b49530d commit 3b93ba2
Show file tree
Hide file tree
Showing 12 changed files with 5,412 additions and 5 deletions.
5 changes: 0 additions & 5 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export const onClientEntry = () => {
env: 'production',
version: '1.0.6',
sessionSampleRate: 10,
sessionReplaySampleRate: 10,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
Expand All @@ -122,10 +121,6 @@ export const onClientEntry = () => {
dd_options,
)})});`
document.head.appendChild(dd_script)
// Start session replay recording
window.DD_RUM.onReady(function () {
window.DD_RUM.startSessionReplayRecording()
})

addScript({
src: 'https://static.deriv.com/scripts/cookie.js',
Expand Down
572 changes: 572 additions & 0 deletions static/~partytown/debug/partytown-atomics.js

Large diffs are not rendered by default.

374 changes: 374 additions & 0 deletions static/~partytown/debug/partytown-media.js

Large diffs are not rendered by default.

559 changes: 559 additions & 0 deletions static/~partytown/debug/partytown-sandbox-sw.js

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions static/~partytown/debug/partytown-sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* Partytown 0.8.1 - MIT builder.io */
const resolves = new Map;

const swMessageError = (accessReq, $error$) => ({
$msgId$: accessReq.$msgId$,
$error$: $error$
});

const httpRequestFromWebWorker = req => new Promise((async resolve => {
const accessReq = await req.clone().json();
const responseData = await (accessReq => new Promise((async resolve => {
const clients = await self.clients.matchAll();
const client = [ ...clients ].sort(((a, b) => a.url > b.url ? -1 : a.url < b.url ? 1 : 0))[0];
if (client) {
const timeout = 12e4;
const msgResolve = [ resolve, setTimeout((() => {
resolves.delete(accessReq.$msgId$);
resolve(swMessageError(accessReq, "Timeout"));
}), timeout) ];
resolves.set(accessReq.$msgId$, msgResolve);
client.postMessage(accessReq);
} else {
resolve(swMessageError(accessReq, "NoParty"));
}
})))(accessReq);
resolve(response(JSON.stringify(responseData), "application/json"));
}));

const response = (body, contentType) => new Response(body, {
headers: {
"content-type": contentType || "text/html",
"Cache-Control": "no-store"
}
});

self.oninstall = () => self.skipWaiting();

self.onactivate = () => self.clients.claim();

self.onmessage = ev => {
const accessRsp = ev.data;
const r = resolves.get(accessRsp.$msgId$);
if (r) {
resolves.delete(accessRsp.$msgId$);
clearTimeout(r[1]);
r[0](accessRsp);
}
};

self.onfetch = ev => {
const req = ev.request;
const url = new URL(req.url);
const pathname = url.pathname;
if (pathname.endsWith("sw.html")) {
ev.respondWith(response('<!DOCTYPE html><html><head><meta charset="utf-8"><script src="./partytown-sandbox-sw.js?v=0.8.1"><\/script></head></html>'));
} else {
pathname.endsWith("proxytown") && ev.respondWith(httpRequestFromWebWorker(req));
}
};
1,884 changes: 1,884 additions & 0 deletions static/~partytown/debug/partytown-ww-atomics.js

Large diffs are not rendered by default.

1,876 changes: 1,876 additions & 0 deletions static/~partytown/debug/partytown-ww-sw.js

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions static/~partytown/debug/partytown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* Partytown 0.8.1 - MIT builder.io */
!function(win, doc, nav, top, useAtomics, config, libPath, timeout, scripts, sandbox, mainForwardFn, isReady) {
function ready() {
if (!isReady) {
isReady = 1;
libPath = (config.lib || "/~partytown/") + (false !== config.debug ? "debug/" : "");
if ("/" == libPath[0]) {
scripts = doc.querySelectorAll('script[type="text/partytown"]');
if (top != win) {
top.dispatchEvent(new CustomEvent("pt1", {
detail: win
}));
} else {
timeout = setTimeout(fallback, 1e4);
doc.addEventListener("pt0", clearFallback);
useAtomics ? loadSandbox(1) : nav.serviceWorker ? nav.serviceWorker.register(libPath + (config.swPath || "partytown-sw.js"), {
scope: libPath
}).then((function(swRegistration) {
if (swRegistration.active) {
loadSandbox();
} else if (swRegistration.installing) {
swRegistration.installing.addEventListener("statechange", (function(ev) {
"activated" == ev.target.state && loadSandbox();
}));
} else {
console.warn(swRegistration);

Check warning on line 26 in static/~partytown/debug/partytown.js

View workflow job for this annotation

GitHub Actions / ESLint

static/~partytown/debug/partytown.js#L26

Unexpected console statement (no-console)
}
}), console.error) : fallback();

Check warning on line 28 in static/~partytown/debug/partytown.js

View workflow job for this annotation

GitHub Actions / ESLint

static/~partytown/debug/partytown.js#L28

Unexpected console statement (no-console)
}
} else {
console.warn('Partytown config.lib url must start with "/"');

Check warning on line 31 in static/~partytown/debug/partytown.js

View workflow job for this annotation

GitHub Actions / ESLint

static/~partytown/debug/partytown.js#L31

Unexpected console statement (no-console)
}
}
}
function loadSandbox(isAtomics) {
sandbox = doc.createElement(isAtomics ? "script" : "iframe");
if (!isAtomics) {
sandbox.style.display = "block";
sandbox.style.width = "0";
sandbox.style.height = "0";
sandbox.style.border = "0";
sandbox.style.visibility = "hidden";
sandbox.setAttribute("aria-hidden", !0);
}
sandbox.src = libPath + "partytown-" + (isAtomics ? "atomics.js?v=0.8.1" : "sandbox-sw.html?" + Date.now());
doc.querySelector(config.sandboxParent || "body").appendChild(sandbox);
}
function fallback(i, script) {
console.warn("Partytown script fallback");

Check warning on line 49 in static/~partytown/debug/partytown.js

View workflow job for this annotation

GitHub Actions / ESLint

static/~partytown/debug/partytown.js#L49

Unexpected console statement (no-console)
clearFallback();
top == win && (config.forward || []).map((function(forwardProps) {
delete win[forwardProps.split(".")[0]];
}));
for (i = 0; i < scripts.length; i++) {
script = doc.createElement("script");
script.innerHTML = scripts[i].innerHTML;
script.nonce = config.nonce;
doc.head.appendChild(script);
}
sandbox && sandbox.parentNode.removeChild(sandbox);
}
function clearFallback() {
clearTimeout(timeout);
}
config = win.partytown || {};
top == win && (config.forward || []).map((function(forwardProps) {
mainForwardFn = win;
forwardProps.split(".").map((function(_, i, forwardPropsArr) {
mainForwardFn = mainForwardFn[forwardPropsArr[i]] = i + 1 < forwardPropsArr.length ? "push" == forwardPropsArr[i + 1] ? [] : mainForwardFn[forwardPropsArr[i]] || {} : function() {
(win._ptf = win._ptf || []).push(forwardPropsArr, arguments);
};
}));
}));
if ("complete" == doc.readyState) {
ready();
} else {
win.addEventListener("DOMContentLoaded", ready);
win.addEventListener("load", ready);
}
}(window, document, navigator, top, window.crossOriginIsolated);
2 changes: 2 additions & 0 deletions static/~partytown/partytown-atomics.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/~partytown/partytown-media.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions static/~partytown/partytown-sw.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/~partytown/partytown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 3b93ba2

@vercel
Copy link

@vercel vercel bot commented on 3b93ba2 Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-com – ./

deriv-com-git-master.binary.sx
deriv-com.binary.sx

Please sign in to comment.