gatsby-plugin-rudderstack 4.0.0 → 4.0.1

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/CHANGELOG.md CHANGED
@@ -2,25 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [4.0.0](https://github.com/rudderlabs/gatsby-plugin-rudderstack/compare/v3.0.0...v4.0.0) (2024-03-28)
6
-
7
-
8
- ### Features
5
+ ## [4.0.1](https://github.com/rudderlabs/gatsby-plugin-rudderstack/compare/v4.0.0...v4.0.1) (2024-03-29)
9
6
 
10
- * use js sdk v3 ([#30](https://github.com/rudderlabs/gatsby-plugin-rudderstack/issues/30)) ([3c81fd7](https://github.com/rudderlabs/gatsby-plugin-rudderstack/commit/3c81fd7eefefdf3afe1f8a28fd5a5eff7b6009c6))
11
- * use JS SDK v3 loading snippet with new useLegacySDK option for v2.x usage ([#26](https://github.com/rudderlabs/gatsby-plugin-rudderstack/issues/26)) ([c05cdbb](https://github.com/rudderlabs/gatsby-plugin-rudderstack/commit/c05cdbb15ef5fb6862d7d9804e980219d7ab6fe3))
7
+ ### Bug Fixes
12
8
 
13
- ## [2.0.0](https://github.com/rudderlabs/gatsby-plugin-rudderstack/compare/a2ed4a794130f7a0dd783f42c1107aa44089a45c...v2.0.0) (2022-12-14)
9
+ * fix: loading snippet ([766f805]https://github.com/rudderlabs/gatsby-plugin-rudderstack/commit/766f8056cf1cc064207bf6caa2108928999d90b9)
14
10
 
15
11
 
16
- ### BREAKING CHANGES
12
+ ## [4.0.0](https://github.com/rudderlabs/gatsby-plugin-rudderstack/compare/v3.0.0...v4.0.0) (2024-03-28)
17
13
 
18
- * modify delayLoad functionality (#17)
19
14
 
20
15
  ### Features
21
16
 
22
- * Added option to use new JS SDK ([#10](https://github.com/rudderlabs/gatsby-plugin-rudderstack/issues/10)) ([a2ed4a7](https://github.com/rudderlabs/gatsby-plugin-rudderstack/commit/a2ed4a794130f7a0dd783f42c1107aa44089a45c))
23
- * modify delayLoad functionality ([#17](https://github.com/rudderlabs/gatsby-plugin-rudderstack/issues/17)) ([65f176d](https://github.com/rudderlabs/gatsby-plugin-rudderstack/commit/65f176dd8e7fff4749b7142ba16d63519651fe45))
17
+ * use js sdk v3 ([#30](https://github.com/rudderlabs/gatsby-plugin-rudderstack/issues/30)) ([3c81fd7](https://github.com/rudderlabs/gatsby-plugin-rudderstack/commit/3c81fd7eefefdf3afe1f8a28fd5a5eff7b6009c6))
18
+ * use JS SDK v3 loading snippet with new useLegacySDK option for v2.x usage ([#26](https://github.com/rudderlabs/gatsby-plugin-rudderstack/issues/26)) ([c05cdbb](https://github.com/rudderlabs/gatsby-plugin-rudderstack/commit/c05cdbb15ef5fb6862d7d9804e980219d7ab6fe3))
24
19
 
25
20
  ## [3.0.0](https://github.com/rudderlabs/gatsby-plugin-rudderstack/compare/v2.0.0...v3.0.0) (2023-12-05)
26
21
 
package/gatsby-ssr.js CHANGED
@@ -29,7 +29,7 @@ exports.onRenderBody = function (_ref, pluginOptions) {
29
29
  configUrl: controlPlaneUrl || loadOptions.configUrl
30
30
  });
31
31
  var loadConfig = "'".concat(writeKey, "', '").concat(dataPlaneUrl, "', ").concat(JSON.stringify(finalLoadOptions));
32
- var snippet = "!function(){\"use strict\";window.RudderSnippetVersion=\"3.0.3\";var sdkBaseUrl=".concat(sdkURL, ";var sdkName=\"rsa.min.js\";var asyncScript=").concat(loadType === 'async', ";var deferScript=").concat(loadType === 'defer', ";window.rudderAnalyticsBuildType=\"legacy\",window.rudderanalytics=[]\n ;var e=[\"setDefaultInstanceKey\",\"load\",\"ready\",\"page\",\"track\",\"identify\",\"alias\",\"group\",\"reset\",\"setAnonymousId\",\"startSession\",\"endSession\",\"consent\"]\n ;for(var n=0;n<e.length;n++){var t=e[n];window.rudderanalytics[t]=function(e){return function(){\n window.rudderanalytics.push([e].concat(Array.prototype.slice.call(arguments)))}}(t)}try{\n new Function('return import(\"\")'),window.rudderAnalyticsBuildType=\"modern\"}catch(a){}\n if(window.rudderAnalyticsMount=function(){\n \"undefined\"==typeof globalThis&&(Object.defineProperty(Object.prototype,\"__globalThis_magic__\",{get:function get(){\n return this},configurable:true}),__globalThis_magic__.globalThis=__globalThis_magic__,\n delete Object.prototype.__globalThis_magic__);var e=document.createElement(\"script\")\n ;e.src=\"\".concat(sdkBaseUrl,\"/\").concat(window.rudderAnalyticsBuildType,\"/\").concat(sdkName);if(asyncScript){e.async=true};if(deferScript){e.defer=true};document.head?document.head.appendChild(e):document.body.appendChild(e)\n },\"undefined\"==typeof Promise||\"undefined\"==typeof globalThis){var d=document.createElement(\"script\")\n ;d.src=\"https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount\",\n d.async=asyncScript,document.head?document.head.appendChild(d):document.body.appendChild(d)}else{\n window.rudderAnalyticsMount()}}();");
32
+ var snippet = "!function(){\"use strict\";window.RudderSnippetVersion=\"3.0.3\";var sdkBaseUrl=\"".concat(sdkURL, "\";var sdkName=\"rsa.min.js\";var asyncScript=").concat(loadType === 'async', ";var deferScript=").concat(loadType === 'defer', ";window.rudderAnalyticsBuildType=\"legacy\",window.rudderanalytics=[]\n ;var e=[\"setDefaultInstanceKey\",\"load\",\"ready\",\"page\",\"track\",\"identify\",\"alias\",\"group\",\"reset\",\"setAnonymousId\",\"startSession\",\"endSession\",\"consent\"]\n ;for(var n=0;n<e.length;n++){var t=e[n];window.rudderanalytics[t]=function(e){return function(){\n window.rudderanalytics.push([e].concat(Array.prototype.slice.call(arguments)))}}(t)}try{\n new Function('return import(\"\")'),window.rudderAnalyticsBuildType=\"modern\"}catch(a){}\n if(window.rudderAnalyticsMount=function(){\n \"undefined\"==typeof globalThis&&(Object.defineProperty(Object.prototype,\"__globalThis_magic__\",{get:function get(){\n return this},configurable:true}),__globalThis_magic__.globalThis=__globalThis_magic__,\n delete Object.prototype.__globalThis_magic__);var e=document.createElement(\"script\")\n ;e.src=\"\".concat(sdkBaseUrl,\"/\").concat(window.rudderAnalyticsBuildType,\"/\").concat(sdkName),asyncScript&&(e.async=true),deferScript&&(e.defer=true),document.head?document.head.appendChild(e):document.body.appendChild(e)\n },\"undefined\"==typeof Promise||\"undefined\"==typeof globalThis){var d=document.createElement(\"script\")\n ;d.src=\"https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount\",\n d.async=asyncScript,document.head?document.head.appendChild(d):document.body.appendChild(d)}else{\n window.rudderAnalyticsMount()}}();");
33
33
  var instantLoader = "".concat(snippet).concat(manualLoad ? "" : "window.rudderanalytics.load(".concat(loadConfig, ")"), ";");
34
34
  var delayedLoader = "\n window.rudderSnippetLoaded = false;\n window.rudderSnippetLoading = false;\n window.rudderSnippetLoadedCallback = undefined;\n window.rudderSnippetLoader = function (callback) {\n if (!window.rudderSnippetLoaded && !window.rudderSnippetLoading) {\n window.rudderSnippetLoading = true;\n function loader() {\n ".concat(snippet, "\n window.rudderanalytics.load(").concat(loadConfig, ");\n window.rudderSnippetLoading = false;\n window.rudderSnippetLoaded = true;\n if (callback) { callback(); }\n if (window.rudderSnippetLoadedCallback) {\n window.rudderSnippetLoadedCallback();\n window.rudderSnippetLoadedCallback = undefined;\n }\n };\n\n \"requestIdleCallback\" in window\n ? requestIdleCallback(function () { loader(); })\n : loader();\n }\n }\n window.addEventListener('scroll',function () {window.rudderSnippetLoader()}, { once: true });\n setTimeout(\n function () {\n \"requestIdleCallback\" in window\n ? requestIdleCallback(function () { window.rudderSnippetLoader(); })\n : window.rudderSnippetLoader();\n },\n ").concat(delayLoadTime, " || 1000\n );\n ");
35
35
  var snippetToUse = "".concat(delayLoad && !manualLoad ? delayedLoader : instantLoader);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-plugin-rudderstack",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Event tracking with RudderStack in your Gatsby frontend.",
5
5
  "main": "gatsby-ssr.js",
6
6
  "scripts": {