Skip to content

Commit

Permalink
fix: replace polyfillio with fastly (#1664)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs authored Mar 21, 2024
1 parent 1f114a1 commit 24d3a0b
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/analytics-js/public/index-legacy-only.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement('script');
rudderAnalyticsPromisesScript.src =
'https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount';
'https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount';
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-js/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement('script');
rudderAnalyticsPromisesScript.src =
'https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount';
'https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount';
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
3 changes: 1 addition & 2 deletions packages/analytics-js/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ const modName = 'rudderanalytics';
const remotePluginsExportsFilename = `rsa-plugins`;
const remotePluginsHostPromise = 'Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/' + `${remotePluginsExportsFilename}.js` + '" : ' + `"${remotePluginsBasePath}/${remotePluginsExportsFilename}.js` + '")';
const moduleType = process.env.MODULE_TYPE || 'cdn';
const isNpmPackageBuild = moduleType === 'npm';
const isCDNPackageBuild = moduleType === 'cdn';
let bugsnagSDKUrl = 'https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js';
let polyfillIoUrl = 'https://polyfill.io/v3/polyfill.min.js';
let polyfillIoUrl = 'https://polyfill-fastly.io/v3/polyfill.min.js';

// For Chrome extension as content script any references in code to third party URLs
// throw violations at approval phase even if relevant code is not used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dotenv.config();

const isContentScriptBuild = process.env.NO_EXTERNAL_HOST;
let bugsnagSDKUrl = 'https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js';
let polyfillIoUrl = 'https://polyfill.io/v3/polyfill.min.js';
let polyfillIoUrl = 'https://polyfill-fastly.io/v3/polyfill.min.js';
let googleAdsSDKUrl = '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';

// For Chrome extension as content script any references in code to third party URLs
Expand Down
4 changes: 2 additions & 2 deletions packages/loading-scripts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ try {

window.rudderAnalyticsMount = () => {
/* eslint-disable */
// globalThis polyfill as polyfill.io one does not work in legacy safari
// globalThis polyfill as polyfill-fastly.io one does not work in legacy safari
if (typeof globalThis === 'undefined') {
Object.defineProperty(Object.prototype, '__globalThis_magic__', {
get: function get() {
Expand Down Expand Up @@ -83,7 +83,7 @@ window.rudderAnalyticsMount = () => {
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
const rudderAnalyticsPromisesScript = document.createElement('script');
rudderAnalyticsPromisesScript.src =
'https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount';
'https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount';
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity-suite/public/v1.1/index-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity-suite/public/v1.1/index-local.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity-suite/public/v1.1/index-npm.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=MutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<style>
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity-suite/public/v3/index-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
};
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement("script");
rudderAnalyticsPromisesScript.src = "https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.src = "https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity-suite/public/v3/index-local.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
};
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement("script");
rudderAnalyticsPromisesScript.src = "https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.src = "https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity-suite/public/v3/index-npm.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
crossorigin="anonymous"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CglobalThis%2CCMutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"></script>
<script src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CglobalThis%2CCMutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"></script>
<script>
if (typeof globalThis === 'undefined') {
Object.defineProperty(Object.prototype, '__globalThis_magic__', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
};
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement("script");
rudderAnalyticsPromisesScript.src = "https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.src = "https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
};
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement("script");
rudderAnalyticsPromisesScript.src = "https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.src = "https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CglobalThis%2CMutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CglobalThis%2CMutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script>
if (typeof globalThis === 'undefined') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
};
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement("script");
rudderAnalyticsPromisesScript.src = "https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.src = "https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
};
if (typeof Promise === 'undefined' || typeof globalThis === 'undefined') {
var rudderAnalyticsPromisesScript = document.createElement("script");
rudderAnalyticsPromisesScript.src = "https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.src = "https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount";
rudderAnalyticsPromisesScript.async = asyncScript;
if (document.head) {
document.head.appendChild(rudderAnalyticsPromisesScript);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
crossorigin="anonymous"
></script>
<script
src="https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CglobalThis%2CMutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
src="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CglobalThis%2CMutationObserver%2CArray.from%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll"
></script>
<script>
if (typeof globalThis === 'undefined') {
Expand Down

0 comments on commit 24d3a0b

Please sign in to comment.