From 5b8b22f0f55650a207ce2ea143733667188effa6 Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Thu, 29 Feb 2024 11:38:35 +0000 Subject: [PATCH 1/3] Add netlify build steps --- package.json | 3 ++ public/~partytown/debug/partytown-atomics.js | 31 ++++++++-------- public/~partytown/debug/partytown-media.js | 2 +- .../~partytown/debug/partytown-sandbox-sw.js | 31 ++++++++-------- public/~partytown/debug/partytown-sw.js | 4 +-- .../~partytown/debug/partytown-ww-atomics.js | 36 +++++++++++++------ public/~partytown/debug/partytown-ww-sw.js | 36 +++++++++++++------ public/~partytown/debug/partytown.js | 11 ++++-- public/~partytown/partytown-atomics.js | 4 +-- public/~partytown/partytown-media.js | 2 +- public/~partytown/partytown-sw.js | 4 +-- public/~partytown/partytown.js | 4 +-- 12 files changed, 103 insertions(+), 65 deletions(-) diff --git a/package.json b/package.json index b0d868c..1357222 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,10 @@ "test": "postdoc test -- test/src -o tests_output --headless", "start": "postdoc run", "prebuild": "postdoc build", + "clone:docs": "rm -rf nightwatch-docs/ && git clone https://github.com/nightwatchjs/nightwatch-docs.git", + "clone:nightwatch": "rm -rf nightwatch/ && git clone https://github.com/nightwatchjs/nightwatch.git", "build": "npm run partytown && postdoc build && node build/optimize.mjs", + "netlify": "npm run clone:docs && npm run clone:nightwatch && npm run build", "partytown": "partytown copylib public/~partytown", "eslint": "eslint src test --quiet" }, diff --git a/public/~partytown/debug/partytown-atomics.js b/public/~partytown/debug/partytown-atomics.js index 96685b5..6ca06ec 100644 --- a/public/~partytown/debug/partytown-atomics.js +++ b/public/~partytown/debug/partytown-atomics.js @@ -1,4 +1,4 @@ -/* Partytown 0.8.0 - MIT builder.io */ +/* Partytown 0.8.2 - MIT builder.io */ (window => { const isPromise = v => "object" == typeof v && v && v.then; const noop = () => {}; @@ -282,11 +282,12 @@ let win = winCtx.$window$; let doc = win.document; let scriptSelector = 'script[type="text/partytown"]:not([data-ptid]):not([data-pterror])'; + let blockingScriptSelector = scriptSelector + ":not([async]):not([defer])"; let scriptElm; let $instanceId$; let scriptData; if (doc && doc.body) { - scriptElm = doc.querySelector('script[type="text/partytown"]:not([data-ptid]):not([data-pterror]):not([async]):not([defer])'); + scriptElm = doc.querySelector(blockingScriptSelector); scriptElm || (scriptElm = doc.querySelector(scriptSelector)); if (scriptElm) { scriptElm.dataset.ptid = $instanceId$ = getAndSetInstanceId(scriptElm, $winId$); @@ -367,16 +368,14 @@ const pushState = history.pushState.bind(history); const replaceState = history.replaceState.bind(history); const onLocationChange = (type, state, newUrl, oldUrl) => () => { - setTimeout((() => { - worker.postMessage([ 13, { - $winId$: $winId$, - type: type, - state: state, - url: doc.baseURI, - newUrl: newUrl, - oldUrl: oldUrl - } ]); - })); + worker.postMessage([ 13, { + $winId$: $winId$, + type: type, + state: state, + url: doc.baseURI, + newUrl: newUrl, + oldUrl: oldUrl + } ]); }; history.pushState = (state, _, newUrl) => { pushState(state, _, newUrl); @@ -433,8 +432,8 @@ })(docImpl, interfaceName))).filter((elm => elm)).map((elm => [ elm ])); return readImplementations(elms, []); }; - const cstrs = new Set([ "Object" ]); const readImplementations = (impls, interfaces) => { + const cstrs = new Set([ "Object" ]); const cstrImpls = impls.filter((implData => implData[0])).map((implData => { const impl = implData[0]; const interfaceType = implData[1]; @@ -476,7 +475,7 @@ (String(value).includes("[native") || Object.getPrototypeOf(implementation)[memberName]) && interfaceMembers.push([ memberName, 5 ]); } else if ("object" === memberType && null != value) { cstrName = getConstructorName(value); - "Object" !== cstrName && self[cstrName] && interfaceMembers.push([ memberName, value.nodeType || cstrName ]); + "Object" !== cstrName && "Function" !== cstrName && self[cstrName] && interfaceMembers.push([ memberName, value.nodeType || cstrName ]); } else { "symbol" !== memberType && (memberName.toUpperCase() === memberName ? interfaceMembers.push([ memberName, 6, value ]) : interfaceMembers.push([ memberName, 6 ])); } @@ -557,14 +556,14 @@ }; })(((accessReq, responseCallback) => mainAccessHandler(worker, accessReq).then(responseCallback))).then((onMessageHandler => { if (onMessageHandler) { - worker = new Worker(libPath + "partytown-ww-atomics.js?v=0.8.0", { + worker = new Worker(libPath + "partytown-ww-atomics.js?v=0.8.2", { name: "Partytown 🎉" }); worker.onmessage = ev => { const msg = ev.data; 12 === msg[0] ? mainAccessHandler(worker, msg[1]) : onMessageHandler(worker, msg); }; - logMain("Created Partytown web worker (0.8.0)"); + logMain("Created Partytown web worker (0.8.2)"); worker.onerror = ev => console.error("Web Worker Error", ev); mainWindow.addEventListener("pt1", (ev => registerWindow(worker, getAndSetInstanceId(ev.detail.frameElement), ev.detail))); } diff --git a/public/~partytown/debug/partytown-media.js b/public/~partytown/debug/partytown-media.js index f71fadb..7e360d6 100644 --- a/public/~partytown/debug/partytown-media.js +++ b/public/~partytown/debug/partytown-media.js @@ -1,4 +1,4 @@ -/* Partytown 0.8.0 - MIT builder.io */ +/* Partytown 0.8.2 - MIT builder.io */ (self => { const [getter, setter, callMethod, constructGlobal, definePrototypePropertyDescriptor, randomId, WinIdKey, InstanceIdKey, ApplyPathKey] = self.$bridgeToMedia$; delete self.$bridgeToMedia$; diff --git a/public/~partytown/debug/partytown-sandbox-sw.js b/public/~partytown/debug/partytown-sandbox-sw.js index 44b9657..d6e5b6b 100644 --- a/public/~partytown/debug/partytown-sandbox-sw.js +++ b/public/~partytown/debug/partytown-sandbox-sw.js @@ -1,4 +1,4 @@ -/* Partytown 0.8.0 - MIT builder.io */ +/* Partytown 0.8.2 - MIT builder.io */ (window => { const isPromise = v => "object" == typeof v && v && v.then; const noop = () => {}; @@ -282,11 +282,12 @@ let win = winCtx.$window$; let doc = win.document; let scriptSelector = 'script[type="text/partytown"]:not([data-ptid]):not([data-pterror])'; + let blockingScriptSelector = scriptSelector + ":not([async]):not([defer])"; let scriptElm; let $instanceId$; let scriptData; if (doc && doc.body) { - scriptElm = doc.querySelector('script[type="text/partytown"]:not([data-ptid]):not([data-pterror]):not([async]):not([defer])'); + scriptElm = doc.querySelector(blockingScriptSelector); scriptElm || (scriptElm = doc.querySelector(scriptSelector)); if (scriptElm) { scriptElm.dataset.ptid = $instanceId$ = getAndSetInstanceId(scriptElm, $winId$); @@ -367,16 +368,14 @@ const pushState = history.pushState.bind(history); const replaceState = history.replaceState.bind(history); const onLocationChange = (type, state, newUrl, oldUrl) => () => { - setTimeout((() => { - worker.postMessage([ 13, { - $winId$: $winId$, - type: type, - state: state, - url: doc.baseURI, - newUrl: newUrl, - oldUrl: oldUrl - } ]); - })); + worker.postMessage([ 13, { + $winId$: $winId$, + type: type, + state: state, + url: doc.baseURI, + newUrl: newUrl, + oldUrl: oldUrl + } ]); }; history.pushState = (state, _, newUrl) => { pushState(state, _, newUrl); @@ -466,8 +465,8 @@ })(docImpl, interfaceName))).filter((elm => elm)).map((elm => [ elm ])); return readImplementations(elms, []); }; - const cstrs = new Set([ "Object" ]); const readImplementations = (impls, interfaces) => { + const cstrs = new Set([ "Object" ]); const cstrImpls = impls.filter((implData => implData[0])).map((implData => { const impl = implData[0]; const interfaceType = implData[1]; @@ -509,7 +508,7 @@ (String(value).includes("[native") || Object.getPrototypeOf(implementation)[memberName]) && interfaceMembers.push([ memberName, 5 ]); } else if ("object" === memberType && null != value) { cstrName = getConstructorName(value); - "Object" !== cstrName && self[cstrName] && interfaceMembers.push([ memberName, value.nodeType || cstrName ]); + "Object" !== cstrName && "Function" !== cstrName && self[cstrName] && interfaceMembers.push([ memberName, value.nodeType || cstrName ]); } else { "symbol" !== memberType && (memberName.toUpperCase() === memberName ? interfaceMembers.push([ memberName, 6, value ]) : interfaceMembers.push([ memberName, 6 ])); } @@ -544,14 +543,14 @@ })); })(((accessReq, responseCallback) => mainAccessHandler(worker, accessReq).then(responseCallback))).then((onMessageHandler => { if (onMessageHandler) { - worker = new Worker(libPath + "partytown-ww-sw.js?v=0.8.0", { + worker = new Worker(libPath + "partytown-ww-sw.js?v=0.8.2", { name: "Partytown 🎉" }); worker.onmessage = ev => { const msg = ev.data; 12 === msg[0] ? mainAccessHandler(worker, msg[1]) : onMessageHandler(worker, msg); }; - logMain("Created Partytown web worker (0.8.0)"); + logMain("Created Partytown web worker (0.8.2)"); worker.onerror = ev => console.error("Web Worker Error", ev); mainWindow.addEventListener("pt1", (ev => registerWindow(worker, getAndSetInstanceId(ev.detail.frameElement), ev.detail))); } diff --git a/public/~partytown/debug/partytown-sw.js b/public/~partytown/debug/partytown-sw.js index 38101ad..059afe6 100644 --- a/public/~partytown/debug/partytown-sw.js +++ b/public/~partytown/debug/partytown-sw.js @@ -1,4 +1,4 @@ -/* Partytown 0.8.0 - MIT builder.io */ +/* Partytown 0.8.2 - MIT builder.io */ const resolves = new Map; const swMessageError = (accessReq, $error$) => ({ @@ -52,7 +52,7 @@ self.onfetch = ev => { const url = new URL(req.url); const pathname = url.pathname; if (pathname.endsWith("sw.html")) { - ev.respondWith(response('