@rudderstack/analytics-js 3.0.0-beta.16 → 3.0.0-beta.18
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 +14 -0
- package/dist/npm/legacy/cjs/index.js +19 -18
- package/dist/npm/legacy/esm/index.js +19 -18
- package/dist/npm/legacy/umd/index.js +19 -18
- package/dist/npm/modern/bundled/cjs/index.js +19 -18
- package/dist/npm/modern/bundled/esm/index.js +19 -18
- package/dist/npm/modern/bundled/umd/index.js +19 -18
- package/dist/npm/modern/cjs/index.js +3 -3
- package/dist/npm/modern/content-script/cjs/index.js +3227 -0
- package/dist/npm/modern/content-script/esm/index.js +3223 -0
- package/dist/npm/modern/content-script/umd/index.js +3233 -0
- package/dist/npm/modern/esm/index.js +3 -3
- package/dist/npm/modern/umd/index.js +3 -3
- package/package.json +8 -2
@@ -404,7 +404,7 @@ if(isDefined(payload.groupId)){payload.groupId=tryStringify(payload.groupId);}el
|
|
404
404
|
|
405
405
|
const CAPABILITIES_MANAGER='CapabilitiesManager';const CONFIG_MANAGER='ConfigManager';const EVENT_MANAGER='EventManager';const PLUGINS_MANAGER='PluginsManager';const USER_SESSION_MANAGER='UserSessionManager';const ERROR_HANDLER='ErrorHandler';const PLUGIN_ENGINE='PluginEngine';const STORE_MANAGER='StoreManager';const READY_API='readyApi';const EVENT_REPOSITORY='EventRepository';const EXTERNAL_SRC_LOADER='ExternalSrcLoader';const HTTP_CLIENT='HttpClient';const RS_APP='RudderStackApplication';const ANALYTICS_CORE='AnalyticsCore';
|
406
406
|
|
407
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.
|
407
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.18';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
408
408
|
|
409
409
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
410
410
|
|
@@ -638,7 +638,7 @@ destination.config.useNativeSDK===true);const isHybridModeDestination=destinatio
|
|
638
638
|
*/const pluginNamesList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
639
639
|
|
640
640
|
const remotesMap = {
|
641
|
-
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.
|
641
|
+
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.18/modern/plugins/rsa-plugins.js"),format:'esm',from:'vite'}
|
642
642
|
};
|
643
643
|
const loadJS = async (url, fn) => {
|
644
644
|
const resolvedUrl = typeof url === 'function' ? await url() : url;
|
@@ -1600,7 +1600,7 @@ ready(callback,isBufferedInvocation=false){const type='ready';if(!state.lifecycl
|
|
1600
1600
|
* If destinations are loaded or no integration is available for loading
|
1601
1601
|
* execute the callback immediately else push the callbacks to a queue that
|
1602
1602
|
* will be executed after loading completes
|
1603
|
-
*/if(state.lifecycle.status.value==='
|
1603
|
+
*/if(state.lifecycle.status.value==='readyExecuted'){try{callback();}catch(err){this.errorHandler.onError(err,ANALYTICS_CORE,READY_CALLBACK_INVOKE_ERROR);}}else {state.eventBuffer.readyCallbacksArray.value=[...state.eventBuffer.readyCallbacksArray.value,callback];}}page(payload,isBufferedInvocation=false){const type='page';if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[...state.eventBuffer.toBeProcessedArray.value,[type,payload]];return;}this.errorHandler.leaveBreadcrumb(`New ${type} event`);state.metrics.triggered.value+=1;this.eventManager?.addEvent({type:'page',category:payload.category,name:payload.name,properties:payload.properties,options:payload.options,callback:payload.callback});// TODO: Maybe we should alter the behavior to send the ad-block page event even if the SDK is still loaded. It'll be pushed into the to be processed queue.
|
1604
1604
|
// Send automatic ad blocked page event if ad-blockers are detected on the page
|
1605
1605
|
// Check page category to avoid infinite loop
|
1606
1606
|
if(state.capabilities.isAdBlocked.value===true&&payload.category!==ADBLOCK_PAGE_CATEGORY){this.page(pageArgumentsToCallOptions(ADBLOCK_PAGE_CATEGORY,ADBLOCK_PAGE_NAME,{// 'title' is intentionally omitted as it does not make sense
|
@@ -410,7 +410,7 @@
|
|
410
410
|
|
411
411
|
const CAPABILITIES_MANAGER='CapabilitiesManager';const CONFIG_MANAGER='ConfigManager';const EVENT_MANAGER='EventManager';const PLUGINS_MANAGER='PluginsManager';const USER_SESSION_MANAGER='UserSessionManager';const ERROR_HANDLER='ErrorHandler';const PLUGIN_ENGINE='PluginEngine';const STORE_MANAGER='StoreManager';const READY_API='readyApi';const EVENT_REPOSITORY='EventRepository';const EXTERNAL_SRC_LOADER='ExternalSrcLoader';const HTTP_CLIENT='HttpClient';const RS_APP='RudderStackApplication';const ANALYTICS_CORE='AnalyticsCore';
|
412
412
|
|
413
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.
|
413
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.18';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
414
414
|
|
415
415
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
416
416
|
|
@@ -644,7 +644,7 @@
|
|
644
644
|
*/const pluginNamesList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
645
645
|
|
646
646
|
const remotesMap = {
|
647
|
-
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.
|
647
|
+
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.18/modern/plugins/rsa-plugins.js"),format:'esm',from:'vite'}
|
648
648
|
};
|
649
649
|
const loadJS = async (url, fn) => {
|
650
650
|
const resolvedUrl = typeof url === 'function' ? await url() : url;
|
@@ -1606,7 +1606,7 @@
|
|
1606
1606
|
* If destinations are loaded or no integration is available for loading
|
1607
1607
|
* execute the callback immediately else push the callbacks to a queue that
|
1608
1608
|
* will be executed after loading completes
|
1609
|
-
*/if(state.lifecycle.status.value==='
|
1609
|
+
*/if(state.lifecycle.status.value==='readyExecuted'){try{callback();}catch(err){this.errorHandler.onError(err,ANALYTICS_CORE,READY_CALLBACK_INVOKE_ERROR);}}else {state.eventBuffer.readyCallbacksArray.value=[...state.eventBuffer.readyCallbacksArray.value,callback];}}page(payload,isBufferedInvocation=false){const type='page';if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[...state.eventBuffer.toBeProcessedArray.value,[type,payload]];return;}this.errorHandler.leaveBreadcrumb(`New ${type} event`);state.metrics.triggered.value+=1;this.eventManager?.addEvent({type:'page',category:payload.category,name:payload.name,properties:payload.properties,options:payload.options,callback:payload.callback});// TODO: Maybe we should alter the behavior to send the ad-block page event even if the SDK is still loaded. It'll be pushed into the to be processed queue.
|
1610
1610
|
// Send automatic ad blocked page event if ad-blockers are detected on the page
|
1611
1611
|
// Check page category to avoid infinite loop
|
1612
1612
|
if(state.capabilities.isAdBlocked.value===true&&payload.category!==ADBLOCK_PAGE_CATEGORY){this.page(pageArgumentsToCallOptions(ADBLOCK_PAGE_CATEGORY,ADBLOCK_PAGE_NAME,{// 'title' is intentionally omitted as it does not make sense
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rudderstack/analytics-js",
|
3
|
-
"version": "3.0.0-beta.
|
3
|
+
"version": "3.0.0-beta.18",
|
4
4
|
"description": "RudderStack Javascript SDK",
|
5
5
|
"main": "dist/npm/modern/cjs/index.js",
|
6
6
|
"module": "dist/npm/modern/esm/index.js",
|
@@ -19,6 +19,11 @@
|
|
19
19
|
"types": "./dist/npm/index.d.ts",
|
20
20
|
"require": "./dist/npm/modern/bundled/cjs/index.js",
|
21
21
|
"import": "./dist/npm/modern/bundled/esm/index.js"
|
22
|
+
},
|
23
|
+
"./content-script": {
|
24
|
+
"types": "./dist/npm/index.d.ts",
|
25
|
+
"require": "./dist/npm/modern/content-script/cjs/index.js",
|
26
|
+
"import": "./dist/npm/modern/content-script/esm/index.js"
|
22
27
|
}
|
23
28
|
},
|
24
29
|
"types": "./dist/npm/index.d.ts",
|
@@ -55,8 +60,9 @@
|
|
55
60
|
"build:browser": "rollup -c --environment VERSION:$npm_package_version,UGLIFY,PROD_DEBUG,ENV:prod",
|
56
61
|
"build:npm": "rollup -c --environment VERSION:$npm_package_version,ENV:prod,MODULE_TYPE:npm",
|
57
62
|
"build:npm:bundled": "BUNDLED_PLUGINS=all npm run build:npm:modern",
|
63
|
+
"build:npm:content-script": "BUNDLED_PLUGINS=all NO_EXTERNAL_HOST=true npm run build:npm:modern",
|
58
64
|
"build:npm:modern": "BROWSERSLIST_ENV=modern npm run build:npm",
|
59
|
-
"build:package": "npm run build:npm:modern && npm run build:npm && npm run build:npm:bundled",
|
65
|
+
"build:package": "npm run build:npm:modern && npm run build:npm && npm run build:npm:bundled && npm run build:npm:content-script",
|
60
66
|
"build:browser:test": "ONLY_IIFE=true npm run build:browser && sed 's/var rudderanalytics/rudderanalytics/g' dist/cdn/legacy/iife/rsa.min.js > __mocks__/cdnSDKv3.js",
|
61
67
|
"test": "npm run build:browser:test && nx test --maxWorkers=50%",
|
62
68
|
"test:ci": "npm run build:browser:test && nx test --parallel=false --configuration=ci --runInBand --maxWorkers=1 --forceExit",
|