mixpanel-browser 2.62.0 → 2.63.0
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 +4 -0
- package/build.sh +4 -21
- package/dist/mixpanel-core.cjs.js +10 -3
- package/dist/mixpanel-js-wrapper.min.js +5 -5
- package/dist/mixpanel-jslib-snippet.min.js +3 -3
- package/dist/mixpanel-jslib-snippet.min.test.js +3 -3
- package/dist/mixpanel-recorder.js +13552 -4502
- package/dist/mixpanel-recorder.min.js +1 -38
- package/dist/mixpanel-recorder.min.js.map +1 -1
- package/dist/mixpanel-with-async-recorder.cjs.js +9 -3
- package/dist/mixpanel-with-recorder.js +22218 -0
- package/dist/mixpanel-with-recorder.min.js +1 -0
- package/dist/mixpanel.amd.js +13558 -4501
- package/dist/mixpanel.cjs.js +13558 -4501
- package/dist/mixpanel.globals.js +9 -3
- package/dist/mixpanel.min.js +144 -144
- package/dist/mixpanel.module.js +13558 -4501
- package/dist/mixpanel.umd.js +13558 -4501
- package/dist/rrweb-compiled.js +18693 -0
- package/package.json +8 -4
- package/rollup.config.mjs +223 -0
- package/src/config.js +1 -1
- package/src/loaders/loader-globals-with-recorder.js +7 -0
- package/src/recorder/session-recording.js +1 -1
- package/src/storage/local-storage.js +2 -1
- package/rollup.config.js +0 -11
- package/src/recorder/rollup.config.js +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
**2.63.0** (1 Apr 2025)
|
|
2
|
+
- Update rrweb to latest alpha version
|
|
3
|
+
- Refactor SDK build process to rely mainly on Rollup
|
|
4
|
+
|
|
1
5
|
**2.62.0** (26 Mar 2025)
|
|
2
6
|
- Replace UUID generator with UUIDv4 (using native API when available)
|
|
3
7
|
- Consistently use native JSON serialization when available
|
package/build.sh
CHANGED
|
@@ -5,33 +5,16 @@ set -e
|
|
|
5
5
|
# building with $DIST=1 also implies $FULL=1
|
|
6
6
|
if [ ! -z "$DIST" ]; then
|
|
7
7
|
export FULL=1
|
|
8
|
+
rm -r -f build
|
|
9
|
+
npm install
|
|
8
10
|
fi
|
|
9
11
|
|
|
10
12
|
echo 'Building main bundles'
|
|
11
|
-
npx rollup -
|
|
12
|
-
|
|
13
|
+
npx rollup -c rollup.config.mjs
|
|
14
|
+
|
|
13
15
|
ln -sf mixpanel.globals.js build/mixpanel.js
|
|
14
16
|
|
|
15
17
|
if [ ! -z "$FULL" ]; then
|
|
16
|
-
echo 'Minifying main build and snippets'
|
|
17
|
-
java -jar vendor/closure-compiler/compiler.jar --js build/mixpanel.js --language_in ECMASCRIPT5 --externs src/externs.js --js_output_file build/mixpanel.min.js --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper "(function() {
|
|
18
|
-
%output%
|
|
19
|
-
})();"
|
|
20
|
-
java -jar vendor/closure-compiler/compiler.jar --js src/loaders/mixpanel-jslib-snippet.js --language_in ECMASCRIPT5 --js_output_file build/mixpanel-jslib-snippet.min.js --compilation_level ADVANCED_OPTIMIZATIONS
|
|
21
|
-
java -jar vendor/closure-compiler/compiler.jar --js src/loaders/mixpanel-jslib-snippet.js --language_in ECMASCRIPT5 --js_output_file build/mixpanel-jslib-snippet.min.test.js --compilation_level ADVANCED_OPTIMIZATIONS --define='MIXPANEL_LIB_URL="../build/mixpanel.min.js"'
|
|
22
|
-
|
|
23
|
-
echo 'Building mixpanel-js-wrapper'
|
|
24
|
-
npx rollup src/loaders/mixpanel-js-wrapper.js -o build/mixpanel-js-wrapper.js -c rollup.config.js
|
|
25
|
-
java -jar vendor/closure-compiler/compiler.jar --js build/mixpanel-js-wrapper.js --js_output_file build/mixpanel-js-wrapper.min.js --compilation_level ADVANCED_OPTIMIZATIONS
|
|
26
|
-
|
|
27
|
-
echo 'Building module bundles'
|
|
28
|
-
npx rollup -i src/loaders/loader-module.js -f amd -o build/mixpanel.amd.js -c rollup.config.js
|
|
29
|
-
npx rollup -i src/loaders/loader-module.js -f cjs -o build/mixpanel.cjs.js -c rollup.config.js
|
|
30
|
-
npx rollup -i src/loaders/loader-module.js -f es -o build/mixpanel.module.js -c rollup.config.js
|
|
31
|
-
npx rollup -i src/loaders/loader-module-core.js -f cjs -o build/mixpanel-core.cjs.js -c rollup.config.js
|
|
32
|
-
npx rollup -i src/loaders/loader-module-with-async-recorder.js -f cjs -o build/mixpanel-with-async-recorder.cjs.js -c rollup.config.js
|
|
33
|
-
npx rollup -i src/loaders/loader-module.js -f umd -o build/mixpanel.umd.js -n mixpanel -c rollup.config.js
|
|
34
|
-
|
|
35
18
|
echo 'Bundling module-loader test runners'
|
|
36
19
|
npx webpack tests/module-cjs.js tests/module-cjs.bundle.js
|
|
37
20
|
npx browserify tests/module-es2015.js -t [ babelify --compact false ] --outfile tests/module-es2015.bundle.js
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var Config = {
|
|
4
4
|
DEBUG: false,
|
|
5
|
-
LIB_VERSION: '2.
|
|
5
|
+
LIB_VERSION: '2.63.0'
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file
|
|
@@ -1238,7 +1238,7 @@ _.UUID = function() {
|
|
|
1238
1238
|
uuid[i] = Math.floor(Math.random() * 16);
|
|
1239
1239
|
}
|
|
1240
1240
|
uuid[14] = 4; // set bits 12-15 of time-high-and-version to 0100
|
|
1241
|
-
uuid[19] = uuid[19] &=
|
|
1241
|
+
uuid[19] = uuid[19] &= -5; // set bit 6 of clock-seq-and-reserved to zero
|
|
1242
1242
|
uuid[19] = uuid[19] |= (1 << 3); // set bit 7 of clock-seq-and-reserved to one
|
|
1243
1243
|
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
|
|
1244
1244
|
|
|
@@ -2131,6 +2131,8 @@ var isRecordingExpired = function(serializedRecording) {
|
|
|
2131
2131
|
};
|
|
2132
2132
|
|
|
2133
2133
|
// stateless utils
|
|
2134
|
+
// mostly from https://github.com/mixpanel/mixpanel-js/blob/989ada50f518edab47b9c4fd9535f9fbd5ec5fc0/src/autotrack-utils.js
|
|
2135
|
+
|
|
2134
2136
|
|
|
2135
2137
|
var EV_CHANGE = 'change';
|
|
2136
2138
|
var EV_CLICK = 'click';
|
|
@@ -2977,6 +2979,7 @@ safewrapClass(Autocapture);
|
|
|
2977
2979
|
|
|
2978
2980
|
/* eslint camelcase: "off" */
|
|
2979
2981
|
|
|
2982
|
+
|
|
2980
2983
|
/**
|
|
2981
2984
|
* DomTracker Object
|
|
2982
2985
|
* @constructor
|
|
@@ -3280,7 +3283,7 @@ SharedLock.prototype.withLock = function(lockedCB, pid) {
|
|
|
3280
3283
|
* @type {import('./wrapper').StorageWrapper}
|
|
3281
3284
|
*/
|
|
3282
3285
|
var LocalStorageWrapper = function (storageOverride) {
|
|
3283
|
-
this.storage = storageOverride || localStorage;
|
|
3286
|
+
this.storage = storageOverride || win.localStorage;
|
|
3284
3287
|
};
|
|
3285
3288
|
|
|
3286
3289
|
LocalStorageWrapper.prototype.init = function () {
|
|
@@ -4027,6 +4030,7 @@ RequestBatcher.prototype.reportError = function(msg, err) {
|
|
|
4027
4030
|
* These functions are used internally by the SDK and are not intended to be publicly exposed.
|
|
4028
4031
|
*/
|
|
4029
4032
|
|
|
4033
|
+
|
|
4030
4034
|
/**
|
|
4031
4035
|
* A function used to track a Mixpanel event (e.g. MixpanelLib.track)
|
|
4032
4036
|
* @callback trackFunction
|
|
@@ -4315,6 +4319,7 @@ function _addOptOutCheck(method, getConfigValue) {
|
|
|
4315
4319
|
|
|
4316
4320
|
/* eslint camelcase: "off" */
|
|
4317
4321
|
|
|
4322
|
+
|
|
4318
4323
|
/** @const */ var SET_ACTION = '$set';
|
|
4319
4324
|
/** @const */ var SET_ONCE_ACTION = '$set_once';
|
|
4320
4325
|
/** @const */ var UNSET_ACTION = '$unset';
|
|
@@ -5074,6 +5079,7 @@ MixpanelPeople.prototype['toString'] = MixpanelPeople.prototype.toString;
|
|
|
5074
5079
|
|
|
5075
5080
|
/* eslint camelcase: "off" */
|
|
5076
5081
|
|
|
5082
|
+
|
|
5077
5083
|
/*
|
|
5078
5084
|
* Constants
|
|
5079
5085
|
*/
|
|
@@ -7936,6 +7942,7 @@ function init_as_module(bundle_loader) {
|
|
|
7936
7942
|
}
|
|
7937
7943
|
|
|
7938
7944
|
// For loading separate bundles asynchronously via script tag
|
|
7945
|
+
// so that we don't load them until they are needed at runtime.
|
|
7939
7946
|
|
|
7940
7947
|
// For builds that do NOT want any extra bundles (e.g. session recorder)
|
|
7941
7948
|
// and just the main SDK, throw an error when trying to load a separate bundle.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(d,
|
|
2
|
-
for(
|
|
3
|
-
|
|
4
|
-
(function(d,
|
|
5
|
-
d[
|
|
1
|
+
(function(d,e){if(!e.__SV){var m,c;window.mixpanel=e;e._i=[];e.init=function(b,f,l){function t(k,g){var n=g.split(".");2==n.length&&(k=k[n[0]],g=n[1]);k[g]=function(){k.push([g].concat(Array.prototype.slice.call(arguments,0)))}}var h=e;"undefined"!==typeof l?h=e[l]=[]:l="mixpanel";h.people=h.people||[];h.toString=function(k){var g="mixpanel";"mixpanel"!==l&&(g+="."+l);k||(g+=" (stub)");return g};h.people.toString=function(){return h.toString(1)+".people (stub)"};m="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders start_session_recording stop_session_recording people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
|
|
2
|
+
for(c=0;c<m.length;c++)t(h,m[c]);var q="set set_once union unset remove delete".split(" ");h.get_group=function(){function k(r){g[r]=function(){h.push([n,[r].concat(Array.prototype.slice.call(arguments,0))])}}for(var g={},n=["get_group"].concat(Array.prototype.slice.call(arguments,0)),p=0;p<q.length;p++)k(q[p]);return g};e._i.push([b,f,l])};e.__SV=1.2;var a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===
|
|
3
|
+
d.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";d=d.getElementsByTagName("script")[0];d.parentNode.insertBefore(a,d)}})(document,window.mixpanel||[]);
|
|
4
|
+
(function(d,e){if(d.mixpanel&&"function"===typeof d.mixpanel.init){var m="add_group alias clear_opt_in_out_tracking disable identify opt_in_tracking opt_out_tracking register register_once remove_group reset set_config set_group start_session_recording stop_session_recording time_event track track_forms track_links track_pageview track_with_groups unregister people.append people.clear_charges people.delete_user people.increment people.remove people.set people.set_once people.track_charge people.union people.unset group.remove group.set group.set_once group.union group.unset".split(" ");d[e]=
|
|
5
|
+
d[e]||function(){var c=[].slice.call(arguments,0),a=c.shift(),b=null,f=a.match(/^([^.]+)\.(.+)$/);f&&3===f.length&&!/people|group/.test(f[1])&&(b=f[1],a=f[2]);if((b=b?window.mixpanel[b]:window.mixpanel)&&-1!==m.indexOf(a))return/^people\./.test(a)?(a=a.split(".").pop(),b.people[a].apply(b.people,c),c=void 0):/^group\./.test(a)?(a=a.split(".").pop(),f=c.shift(),Array.isArray(f)&&2===f.length&&(b=b.get_group.apply(b,f),b[a].apply(b,c)),c=void 0):c=b.push.apply(b,[[a].concat(c)]),c}}})(window,"_mixpanel")
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
for(h=0;h<
|
|
3
|
-
|
|
1
|
+
(function(e,c){if(!c.__SV){var l,h;window.mixpanel=c;c._i=[];c.init=function(q,r,f){function t(d,a){var g=a.split(".");2==g.length&&(d=d[g[0]],a=g[1]);d[a]=function(){d.push([a].concat(Array.prototype.slice.call(arguments,0)))}}var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";b.people=b.people||[];b.toString=function(d){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);d||(a+=" (stub)");return a};b.people.toString=function(){return b.toString(1)+".people (stub)"};l="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders start_session_recording stop_session_recording people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
|
|
2
|
+
for(h=0;h<l.length;h++)t(b,l[h]);var n="set set_once union unset remove delete".split(" ");b.get_group=function(){function d(p){a[p]=function(){b.push([g,[p].concat(Array.prototype.slice.call(arguments,0))])}}for(var a={},g=["get_group"].concat(Array.prototype.slice.call(arguments,0)),m=0;m<n.length;m++)d(n[m]);return a};c._i.push([q,r,f])};c.__SV=1.2;var k=e.createElement("script");k.type="text/javascript";k.async=!0;k.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===
|
|
3
|
+
e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=e.getElementsByTagName("script")[0];e.parentNode.insertBefore(k,e)}})(document,window.mixpanel||[])
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
for(h=0;h<
|
|
3
|
-
|
|
1
|
+
(function(e,c){if(!c.__SV){var l,h;window.mixpanel=c;c._i=[];c.init=function(q,r,f){function t(d,a){var g=a.split(".");2==g.length&&(d=d[g[0]],a=g[1]);d[a]=function(){d.push([a].concat(Array.prototype.slice.call(arguments,0)))}}var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";b.people=b.people||[];b.toString=function(d){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);d||(a+=" (stub)");return a};b.people.toString=function(){return b.toString(1)+".people (stub)"};l="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders start_session_recording stop_session_recording people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
|
|
2
|
+
for(h=0;h<l.length;h++)t(b,l[h]);var n="set set_once union unset remove delete".split(" ");b.get_group=function(){function d(p){a[p]=function(){b.push([g,[p].concat(Array.prototype.slice.call(arguments,0))])}}for(var a={},g=["get_group"].concat(Array.prototype.slice.call(arguments,0)),m=0;m<n.length;m++)d(n[m]);return a};c._i.push([q,r,f])};c.__SV=1.2;var k=e.createElement("script");k.type="text/javascript";k.async=!0;k.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===
|
|
3
|
+
e.location.protocol&&"../build/mixpanel.min.js".match(/^\/\//)?"https:../build/mixpanel.min.js":"../build/mixpanel.min.js";e=e.getElementsByTagName("script")[0];e.parentNode.insertBefore(k,e)}})(document,window.mixpanel||[])
|