From ccac3099a9ba70f6c711980b9f5e2ac2ab572713 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:41:01 -0500 Subject: [PATCH 1/8] Update deferred script loader version --- packages/marko-web-deferred-script-loader/components/load.marko | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/marko-web-deferred-script-loader/components/load.marko b/packages/marko-web-deferred-script-loader/components/load.marko index 1ebd4146e..9f82ec36e 100644 --- a/packages/marko-web-deferred-script-loader/components/load.marko +++ b/packages/marko-web-deferred-script-loader/components/load.marko @@ -1,3 +1,3 @@ -$ const src = input.src || "https://cdn.parameter1.com/deferred-script-loader/60731937.js"; +$ const src = input.src || "https://cdn.parameter1.com/deferred-script-loader/6210e032.js"; From 9d75657e39ac31a338849c39f89a294d0ef5fc99 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:41:16 -0500 Subject: [PATCH 2/8] Add `init-only` prop and set to false be default --- .../marko-web-deferred-script-loader/components/marko.json | 1 + .../marko-web-deferred-script-loader/components/register.marko | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-deferred-script-loader/components/marko.json b/packages/marko-web-deferred-script-loader/components/marko.json index 443976e69..924dd191b 100644 --- a/packages/marko-web-deferred-script-loader/components/marko.json +++ b/packages/marko-web-deferred-script-loader/components/marko.json @@ -31,6 +31,7 @@ "@target-tag": "string", "@request-frame": "boolean", "@init": "string", + "@init-only": "boolean", "@on-script-build": "string", "@on-script-load": "string", "@attrs": "object" diff --git a/packages/marko-web-deferred-script-loader/components/register.marko b/packages/marko-web-deferred-script-loader/components/register.marko index 90c99abbe..c1baa17ab 100644 --- a/packages/marko-web-deferred-script-loader/components/register.marko +++ b/packages/marko-web-deferred-script-loader/components/register.marko @@ -17,8 +17,9 @@ $ const { }); $ const init = `function() { ${input.init || ''} }`; +$ const initOnly = defaultValue(input.initOnly, false); $ const onScriptBuild = `function(script) { ${input.onScriptBuild || ''} }`; $ const onScriptLoad = `function() { ${input.onScriptLoad || ''} }`; $ const attrs = JSON.stringify(getAsObject(input, "attrs")); - + From 6db228cb8c37d60a6a82be2072dcb205b2b49883 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:49:40 -0500 Subject: [PATCH 3/8] Create `load-script` marko component --- .../components/load-script.marko | 1 + .../marko-web-deferred-script-loader/components/marko.json | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 packages/marko-web-deferred-script-loader/components/load-script.marko diff --git a/packages/marko-web-deferred-script-loader/components/load-script.marko b/packages/marko-web-deferred-script-loader/components/load-script.marko new file mode 100644 index 000000000..9f448acda --- /dev/null +++ b/packages/marko-web-deferred-script-loader/components/load-script.marko @@ -0,0 +1 @@ + diff --git a/packages/marko-web-deferred-script-loader/components/marko.json b/packages/marko-web-deferred-script-loader/components/marko.json index 924dd191b..c4959a7f7 100644 --- a/packages/marko-web-deferred-script-loader/components/marko.json +++ b/packages/marko-web-deferred-script-loader/components/marko.json @@ -17,6 +17,13 @@ "required": true } }, + "": { + "template": "./load-script.marko", + "@name": { + "type": "string", + "required": true + } + }, "": { "template": "./register.marko", "@name": { From c96e20ec532b138ee1a464cd3a412facb4eb2a3b Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:52:47 -0500 Subject: [PATCH 4/8] Add `init-only` support to p1-events --- packages/marko-web-p1-events/components/init.marko | 1 + packages/marko-web-p1-events/components/marko.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-p1-events/components/init.marko b/packages/marko-web-p1-events/components/init.marko index 3784d5569..c801cfa39 100644 --- a/packages/marko-web-p1-events/components/init.marko +++ b/packages/marko-web-p1-events/components/init.marko @@ -19,6 +19,7 @@ $ const identityQueryBuilder = `identityQueryBuilder: function(query, cookies) { request-frame=input.requestFrame target-tag=input.targetTag init="var i = window, r = 'p1events'; i['__p1e'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments); };" + init-only=input.initOnly /> diff --git a/packages/marko-web-p1-events/components/marko.json b/packages/marko-web-p1-events/components/marko.json index 2c32d5981..e43370ce5 100644 --- a/packages/marko-web-p1-events/components/marko.json +++ b/packages/marko-web-p1-events/components/marko.json @@ -6,7 +6,8 @@ "@identity-query-builder": "string", "@on": "string", "@target-tag": "string", - "@request-frame": "boolean" + "@request-frame": "boolean", + "@init-only": "boolean" }, "": { "template": "./track-content.marko", From 1a5407a0f566a78f28596693ee7a7dfef16a7bd3 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:52:55 -0500 Subject: [PATCH 5/8] Add `init-only` support to olytics --- packages/marko-web-omeda/components/olytics/init.marko | 1 + packages/marko-web-omeda/components/olytics/marko.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-omeda/components/olytics/init.marko b/packages/marko-web-omeda/components/olytics/init.marko index b09b76738..86b788d85 100644 --- a/packages/marko-web-omeda/components/olytics/init.marko +++ b/packages/marko-web-omeda/components/olytics/init.marko @@ -6,6 +6,7 @@ $ const clean = (js) => js.split('\n').map((line) => line.trim()).join(' '); on=input.on request-frame=input.requestFrame target-tag=input.targetTag + init-only=input.initOnly init=clean(` window.olytics || (window.olytics = []), window.olytics.methods = ['fire', 'confirm'], window.olytics.factory = function(i) { return function() { diff --git a/packages/marko-web-omeda/components/olytics/marko.json b/packages/marko-web-omeda/components/olytics/marko.json index 76383a8fe..113f60039 100644 --- a/packages/marko-web-omeda/components/olytics/marko.json +++ b/packages/marko-web-omeda/components/olytics/marko.json @@ -7,6 +7,7 @@ }, "@on": "string", "@target-tag": "string", - "@request-frame": "boolean" + "@request-frame": "boolean", + "@init-only": "boolean" } } From 474f449595c61d94b2735e4b3610b62ea39f91f8 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:53:03 -0500 Subject: [PATCH 6/8] Add `init-only` support to native-x --- packages/marko-web-native-x/components/init.marko | 1 + packages/marko-web-native-x/components/marko.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-native-x/components/init.marko b/packages/marko-web-native-x/components/init.marko index b47b1205e..eb186af27 100644 --- a/packages/marko-web-native-x/components/init.marko +++ b/packages/marko-web-native-x/components/init.marko @@ -13,6 +13,7 @@ $ const src = "https://cdn.parameter1.com/native-x/1.0.0-rc.4.3.js"; request-frame=input.requestFrame target-tag=input.targetTag init="var i = window, r = 'fortnight'; i['FortnightObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments); };" + init-only=input.initOnly /> diff --git a/packages/marko-web-native-x/components/marko.json b/packages/marko-web-native-x/components/marko.json index 28dc8a238..fa680bd8a 100644 --- a/packages/marko-web-native-x/components/marko.json +++ b/packages/marko-web-native-x/components/marko.json @@ -5,7 +5,8 @@ "@enabled": "boolean", "@on": "string", "@target-tag": "string", - "@request-frame": "boolean" + "@request-frame": "boolean", + "@init-only": "boolean" }, "": { "template": "./retrieve.marko", From 4a4f9dc516907c0b631c92453fed5a05cbff4412 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:53:12 -0500 Subject: [PATCH 7/8] Add `init-only` support to gtm --- packages/marko-web-gtm/components/init.marko | 1 + packages/marko-web-gtm/components/marko.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-gtm/components/init.marko b/packages/marko-web-gtm/components/init.marko index 71e951c73..8bc3d3f15 100644 --- a/packages/marko-web-gtm/components/init.marko +++ b/packages/marko-web-gtm/components/init.marko @@ -26,6 +26,7 @@ $ const start = input.start == null ? false : input.start; request-frame=input.requestFrame target-tag=input.targetTag init=`var w = window, l = '${name}'; w[l] = w[l] || [];` + init-only=input.initOnly /> diff --git a/packages/marko-web-gtm/components/marko.json b/packages/marko-web-gtm/components/marko.json index 19910dfb2..a9d547100 100644 --- a/packages/marko-web-gtm/components/marko.json +++ b/packages/marko-web-gtm/components/marko.json @@ -16,7 +16,8 @@ }, "@on": "string", "@target-tag": "string", - "@request-frame": "boolean" + "@request-frame": "boolean", + "@init-only": "boolean" }, "": { "template": "./start.marko", From 2eec1e8833acfa2fc5a3a215670f045fb409352e Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Thu, 22 Sep 2022 09:53:18 -0500 Subject: [PATCH 8/8] Add `init-only` support to gam --- packages/marko-web-gam/components/init.marko | 1 + packages/marko-web-gam/components/marko.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-gam/components/init.marko b/packages/marko-web-gam/components/init.marko index 40e5b6645..29ec16b1d 100644 --- a/packages/marko-web-gam/components/init.marko +++ b/packages/marko-web-gam/components/init.marko @@ -9,6 +9,7 @@ $ const { on } = input; request-frame=input.requestFrame target-tag=input.targetTag init="window.googletag = window.googletag || {}; window.googletag.cmd = window.googletag.cmd || [];" + init-only=input.initOnly /> diff --git a/packages/marko-web-gam/components/marko.json b/packages/marko-web-gam/components/marko.json index 9c80cbaf8..93b00098c 100644 --- a/packages/marko-web-gam/components/marko.json +++ b/packages/marko-web-gam/components/marko.json @@ -4,7 +4,8 @@ "@src": "string", "@on": "string", "@target-tag": "string", - "@request-frame": "boolean" + "@request-frame": "boolean", + "@init-only": "boolean" }, "": { "template": "./head.marko",