Skip to content

Commit c376ee6

Browse files
authored
chore(release): pull hotfix-release/3.36.0-SDK-2394 into main (#1854)
2 parents 12b31d0 + d21718f commit c376ee6

File tree

51 files changed

+295
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+295
-198
lines changed

examples/angular/sample-app/src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<script>
1010
(function() {
1111
"use strict";
12-
window.RudderSnippetVersion = "3.0.10";
12+
window.RudderSnippetVersion = "3.0.30";
1313
var identifier = "rudderanalytics";
1414
if (!window[identifier]) {
1515
window[identifier] = [];

examples/integrations/Ninetailed/sample-apps/app-using-v3-cdn/public/index.html

+19-17
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,26 @@
2626
-->
2727
<title>React App</title>
2828
<script type="text/javascript">
29-
!function(){"use strict";window.RudderSnippetVersion="3.0.10";var e="rudderanalytics";window[e]||(window[e]=[])
30-
;var t=window[e];if(Array.isArray(t)){if(true===t.snippetExecuted&&window.console&&console.error){
31-
console.error("RudderStack JavaScript SDK snippet included more than once.")}else{t.snippetExecuted=true,
29+
!function(){"use strict";window.RudderSnippetVersion="3.0.30";var e="rudderanalytics";window[e]||(window[e]=[])
30+
;var rudderanalytics=window[e];if(Array.isArray(rudderanalytics)){
31+
if(true===rudderanalytics.snippetExecuted&&window.console&&console.error){
32+
console.error("RudderStack JavaScript SDK snippet included more than once.")}else{rudderanalytics.snippetExecuted=true,
3233
window.rudderAnalyticsBuildType="legacy";var sdkBaseUrl="https://cdn.rudderlabs.com/v3";var sdkName="rsa.min.js"
33-
;var r="async"
34-
;var n=["setDefaultInstanceKey","load","ready","page","track","identify","alias","group","reset","setAnonymousId","startSession","endSession","consent"]
35-
;for(var i=0;i<n.length;i++){var d=n[i];t[d]=function(r){return function(){var n
36-
;Array.isArray(window[e])?t.push([r].concat(Array.prototype.slice.call(arguments))):null===(n=window[e][r])||void 0===n||n.apply(window[e],arguments)
37-
}}(d)}try{new Function('return import("")'),window.rudderAnalyticsBuildType="modern"}catch(c){}
38-
var o=document.head||document.getElementsByTagName("head")[0]
39-
;var a=document.body||document.getElementsByTagName("body")[0];window.rudderAnalyticsAddScript=function(e,t,n){
40-
var i=document.createElement("script");i.src=e,i.setAttribute("data-loader","RS_JS_SDK"),t&&n&&i.setAttribute(t,n),
41-
"async"===r?i.async=true:"defer"===r&&(i.defer=true),o?o.insertBefore(i,o.firstChild):a.insertBefore(i,a.firstChild)},
42-
window.rudderAnalyticsMount=function(){
43-
"undefined"==typeof globalThis&&(Object.defineProperty(Object.prototype,"__globalThis_magic__",{get:function get(){
44-
return this},configurable:true}),__globalThis_magic__.globalThis=__globalThis_magic__,
45-
delete Object.prototype.__globalThis_magic__),
46-
window.rudderAnalyticsAddScript("".concat(sdkBaseUrl,"/").concat(window.rudderAnalyticsBuildType,"/").concat(sdkName),"data-rsa-write-key","dummyWriteKey")
34+
;var scriptLoadingMode="async"
35+
;var r=["setDefaultInstanceKey","load","ready","page","track","identify","alias","group","reset","setAnonymousId","startSession","endSession","consent"]
36+
;for(var n=0;n<r.length;n++){var t=r[n];rudderanalytics[t]=function(r){return function(){var n
37+
;Array.isArray(window[e])?rudderanalytics.push([r].concat(Array.prototype.slice.call(arguments))):null===(n=window[e][r])||void 0===n||n.apply(window[e],arguments)
38+
}}(t)}try{
39+
new Function('class Test{field=()=>{};test({prop=[]}={}){return prop?(prop?.property??[...prop]):import("");}}'),
40+
window.rudderAnalyticsBuildType="modern"}catch(o){}var d=document.head||document.getElementsByTagName("head")[0]
41+
;var i=document.body||document.getElementsByTagName("body")[0];window.rudderAnalyticsAddScript=function(e,r,n){
42+
var t=document.createElement("script");t.src=e,t.setAttribute("data-loader","RS_JS_SDK"),r&&n&&t.setAttribute(r,n),
43+
"async"===scriptLoadingMode?t.async=true:"defer"===scriptLoadingMode&&(t.defer=true),
44+
d?d.insertBefore(t,d.firstChild):i.insertBefore(t,i.firstChild)},window.rudderAnalyticsMount=function(){!function(){
45+
if("undefined"==typeof globalThis){var e;var r=function getGlobal(){
46+
return"undefined"!=typeof self?self:"undefined"!=typeof window?window:null}();r&&Object.defineProperty(r,"globalThis",{
47+
value:r,configurable:true})}
48+
}(),window.rudderAnalyticsAddScript("".concat(sdkBaseUrl,"/").concat(window.rudderAnalyticsBuildType,"/").concat(sdkName),"data-rsa-write-key","dummyWriteKey")
4749
},
4850
"undefined"==typeof Promise||"undefined"==typeof globalThis?window.rudderAnalyticsAddScript("https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount"):window.rudderAnalyticsMount()
4951
;}}}();

examples/nextjs/hooks/sample-app/src/app/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
1818
{`
1919
(function() {
2020
"use strict";
21-
window.RudderSnippetVersion = "3.0.10";
21+
window.RudderSnippetVersion = "3.0.30";
2222
var identifier = "rudderanalytics";
2323
if (!window[identifier]) {
2424
window[identifier] = [];

examples/nextjs/js/sample-app/src/app/layout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function RootLayout({ children }) {
1717
{`
1818
(function() {
1919
"use strict";
20-
window.RudderSnippetVersion = "3.0.10";
20+
window.RudderSnippetVersion = "3.0.30";
2121
var identifier = "rudderanalytics";
2222
if (!window[identifier]) {
2323
window[identifier] = [];

examples/nextjs/page-router/sample-app/src/pages/_document.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function Document() {
99
{`
1010
(function() {
1111
"use strict";
12-
window.RudderSnippetVersion = "3.0.10";
12+
window.RudderSnippetVersion = "3.0.30";
1313
var identifier = "rudderanalytics";
1414
if (!window[identifier]) {
1515
window[identifier] = [];

examples/nextjs/ts/sample-app/src/app/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
1818
{`
1919
(function() {
2020
"use strict";
21-
window.RudderSnippetVersion = "3.0.10";
21+
window.RudderSnippetVersion = "3.0.30";
2222
var identifier = "rudderanalytics";
2323
if (!window[identifier]) {
2424
window[identifier] = [];

examples/reactjs/hooks/sample-app/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<script>
2929
(function() {
3030
"use strict";
31-
window.RudderSnippetVersion = "3.0.10";
31+
window.RudderSnippetVersion = "3.0.30";
3232
var identifier = "rudderanalytics";
3333
if (!window[identifier]) {
3434
window[identifier] = [];

examples/reactjs/js/sample-app/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<script>
2929
(function() {
3030
"use strict";
31-
window.RudderSnippetVersion = "3.0.10";
31+
window.RudderSnippetVersion = "3.0.30";
3232
var identifier = "rudderanalytics";
3333
if (!window[identifier]) {
3434
window[identifier] = [];

examples/reactjs/ts/sample-app/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<script>
2929
(function() {
3030
"use strict";
31-
window.RudderSnippetVersion = "3.0.10";
31+
window.RudderSnippetVersion = "3.0.30";
3232
var identifier = "rudderanalytics";
3333
if (!window[identifier]) {
3434
window[identifier] = [];

examples/reactjs/vite/sample-app/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script>
99
(function() {
1010
"use strict";
11-
window.RudderSnippetVersion = "3.0.10";
11+
window.RudderSnippetVersion = "3.0.30";
1212
var identifier = "rudderanalytics";
1313
if (!window[identifier]) {
1414
window[identifier] = [];

examples/v3-beacon/index.html

+25-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script>
99
(function() {
1010
"use strict";
11-
window.RudderSnippetVersion = "3.0.10";
11+
window.RudderSnippetVersion = "3.0.30";
1212
var identifier = "rudderanalytics";
1313
if (!window[identifier]) {
1414
window[identifier] = [];
@@ -22,8 +22,7 @@
2222
window.rudderAnalyticsBuildType = "legacy";
2323
var sdkBaseUrl = "https://cdn.rudderlabs.com/v3";
2424
var sdkName = "rsa.min.js";
25-
var asyncScript = true;
26-
var deferScript = false;
25+
var scriptLoadingMode = "async";
2726
var methods = [ "setDefaultInstanceKey", "load", "ready", "page", "track", "identify", "alias", "group", "reset", "setAnonymousId", "startSession", "endSession", "consent" ];
2827
for (var i = 0; i < methods.length; i++) {
2928
var method = methods[i];
@@ -39,7 +38,7 @@
3938
}(method);
4039
}
4140
try {
42-
new Function('return import("")');
41+
new Function('class Test{field=()=>{};test({prop=[]}={}){return prop?(prop?.property??[...prop]):import("");}}');
4342
window.rudderAnalyticsBuildType = "modern";
4443
} catch (e) {}
4544
var head = document.head || document.getElementsByTagName("head")[0];
@@ -51,9 +50,9 @@
5150
if (extraAttributeKey && extraAttributeVal) {
5251
scriptTag.setAttribute(extraAttributeKey, extraAttributeVal);
5352
}
54-
if (asyncScript) {
53+
if (scriptLoadingMode === "async") {
5554
scriptTag.async = true;
56-
} else if (deferScript) {
55+
} else if (scriptLoadingMode === "defer") {
5756
scriptTag.defer = true;
5857
}
5958
if (head) {
@@ -63,16 +62,26 @@
6362
}
6463
};
6564
window.rudderAnalyticsMount = function() {
66-
if (typeof globalThis === "undefined") {
67-
Object.defineProperty(Object.prototype, "__globalThis_magic__", {
68-
get: function get() {
69-
return this;
70-
},
71-
configurable: true
72-
});
73-
__globalThis_magic__.globalThis = __globalThis_magic__;
74-
delete Object.prototype.__globalThis_magic__;
75-
}
65+
(function() {
66+
if (typeof globalThis === "undefined") {
67+
var getGlobal = function getGlobal() {
68+
if (typeof self !== "undefined") {
69+
return self;
70+
}
71+
if (typeof window !== "undefined") {
72+
return window;
73+
}
74+
return null;
75+
};
76+
var global = getGlobal();
77+
if (global) {
78+
Object.defineProperty(global, "globalThis", {
79+
value: global,
80+
configurable: true
81+
});
82+
}
83+
}
84+
})();
7685
window.rudderAnalyticsAddScript("".concat(sdkBaseUrl, "/").concat(window.rudderAnalyticsBuildType, "/").concat(sdkName), "data-rsa-write-key", "__WRITE_KEY__");
7786
};
7887
if (typeof Promise === "undefined" || typeof globalThis === "undefined") {

examples/v3-legacy-minimum-plugins/index.html

+25-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script>
99
(function() {
1010
"use strict";
11-
window.RudderSnippetVersion = "3.0.10";
11+
window.RudderSnippetVersion = "3.0.30";
1212
var identifier = "rudderanalytics";
1313
if (!window[identifier]) {
1414
window[identifier] = [];
@@ -22,8 +22,7 @@
2222
window.rudderAnalyticsBuildType = "legacy";
2323
var sdkBaseUrl = "https://cdn.rudderlabs.com/v3";
2424
var sdkName = "rsa.min.js";
25-
var asyncScript = true;
26-
var deferScript = false;
25+
var scriptLoadingMode = "async";
2726
var methods = [ "setDefaultInstanceKey", "load", "ready", "page", "track", "identify", "alias", "group", "reset", "setAnonymousId", "startSession", "endSession", "consent" ];
2827
for (var i = 0; i < methods.length; i++) {
2928
var method = methods[i];
@@ -39,7 +38,7 @@
3938
}(method);
4039
}
4140
// try {
42-
// new Function('return import("")');
41+
// new Function('class Test{field=()=>{};test({prop=[]}={}){return prop?(prop?.property??[...prop]):import("");}}');
4342
// window.rudderAnalyticsBuildType = "modern";
4443
// } catch (e) {}
4544
var head = document.head || document.getElementsByTagName("head")[0];
@@ -51,9 +50,9 @@
5150
if (extraAttributeKey && extraAttributeVal) {
5251
scriptTag.setAttribute(extraAttributeKey, extraAttributeVal);
5352
}
54-
if (asyncScript) {
53+
if (scriptLoadingMode === "async") {
5554
scriptTag.async = true;
56-
} else if (deferScript) {
55+
} else if (scriptLoadingMode === "defer") {
5756
scriptTag.defer = true;
5857
}
5958
if (head) {
@@ -63,16 +62,26 @@
6362
}
6463
};
6564
window.rudderAnalyticsMount = function() {
66-
if (typeof globalThis === "undefined") {
67-
Object.defineProperty(Object.prototype, "__globalThis_magic__", {
68-
get: function get() {
69-
return this;
70-
},
71-
configurable: true
72-
});
73-
__globalThis_magic__.globalThis = __globalThis_magic__;
74-
delete Object.prototype.__globalThis_magic__;
75-
}
65+
(function() {
66+
if (typeof globalThis === "undefined") {
67+
var getGlobal = function getGlobal() {
68+
if (typeof self !== "undefined") {
69+
return self;
70+
}
71+
if (typeof window !== "undefined") {
72+
return window;
73+
}
74+
return null;
75+
};
76+
var global = getGlobal();
77+
if (global) {
78+
Object.defineProperty(global, "globalThis", {
79+
value: global,
80+
configurable: true
81+
});
82+
}
83+
}
84+
})();
7685
window.rudderAnalyticsAddScript("".concat(sdkBaseUrl, "/").concat(window.rudderAnalyticsBuildType, "/").concat(sdkName), "data-rsa-write-key", "__WRITE_KEY__");
7786
};
7887
if (typeof Promise === "undefined" || typeof globalThis === "undefined") {

examples/v3-legacy/index.html

+25-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script>
99
(function() {
1010
"use strict";
11-
window.RudderSnippetVersion = "3.0.10";
11+
window.RudderSnippetVersion = "3.0.30";
1212
var identifier = "rudderanalytics";
1313
if (!window[identifier]) {
1414
window[identifier] = [];
@@ -22,8 +22,7 @@
2222
window.rudderAnalyticsBuildType = "legacy";
2323
var sdkBaseUrl = "https://cdn.rudderlabs.com/v3";
2424
var sdkName = "rsa.min.js";
25-
var asyncScript = true;
26-
var deferScript = false;
25+
var scriptLoadingMode = "async";
2726
var methods = [ "setDefaultInstanceKey", "load", "ready", "page", "track", "identify", "alias", "group", "reset", "setAnonymousId", "startSession", "endSession", "consent" ];
2827
for (var i = 0; i < methods.length; i++) {
2928
var method = methods[i];
@@ -39,7 +38,7 @@
3938
}(method);
4039
}
4140
// try {
42-
// new Function('return import("")');
41+
// new Function('class Test{field=()=>{};test({prop=[]}={}){return prop?(prop?.property??[...prop]):import("");}}');
4342
// window.rudderAnalyticsBuildType = "modern";
4443
// } catch (e) {}
4544
var head = document.head || document.getElementsByTagName("head")[0];
@@ -51,9 +50,9 @@
5150
if (extraAttributeKey && extraAttributeVal) {
5251
scriptTag.setAttribute(extraAttributeKey, extraAttributeVal);
5352
}
54-
if (asyncScript) {
53+
if (scriptLoadingMode === "async") {
5554
scriptTag.async = true;
56-
} else if (deferScript) {
55+
} else if (scriptLoadingMode === "defer") {
5756
scriptTag.defer = true;
5857
}
5958
if (head) {
@@ -63,16 +62,26 @@
6362
}
6463
};
6564
window.rudderAnalyticsMount = function() {
66-
if (typeof globalThis === "undefined") {
67-
Object.defineProperty(Object.prototype, "__globalThis_magic__", {
68-
get: function get() {
69-
return this;
70-
},
71-
configurable: true
72-
});
73-
__globalThis_magic__.globalThis = __globalThis_magic__;
74-
delete Object.prototype.__globalThis_magic__;
75-
}
65+
(function() {
66+
if (typeof globalThis === "undefined") {
67+
var getGlobal = function getGlobal() {
68+
if (typeof self !== "undefined") {
69+
return self;
70+
}
71+
if (typeof window !== "undefined") {
72+
return window;
73+
}
74+
return null;
75+
};
76+
var global = getGlobal();
77+
if (global) {
78+
Object.defineProperty(global, "globalThis", {
79+
value: global,
80+
configurable: true
81+
});
82+
}
83+
}
84+
})();
7685
window.rudderAnalyticsAddScript("".concat(sdkBaseUrl, "/").concat(window.rudderAnalyticsBuildType, "/").concat(sdkName), "data-rsa-write-key", "__WRITE_KEY__");
7786
};
7887
if (typeof Promise === "undefined" || typeof globalThis === "undefined") {

0 commit comments

Comments
 (0)