mixpanel-browser 2.78.0 → 2.80.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/.eslintrc.json +12 -0
- package/.github/workflows/integration-tests.yml +1 -0
- package/.github/workflows/openfeature-provider-tests.yml +31 -0
- package/CHANGELOG.md +14 -1
- package/build.sh +2 -2
- package/dist/async-modules/{mixpanel-recorder-BjSlYaNJ.min.js → mixpanel-recorder-B61POiHc.min.js} +2 -2
- package/dist/async-modules/mixpanel-recorder-B61POiHc.min.js.map +1 -0
- package/dist/async-modules/{mixpanel-recorder-zMBXIyeG.js → mixpanel-recorder-C3AW7mPl.js} +63 -35
- package/dist/async-modules/{mixpanel-targeting-UHf4eBfC.js → mixpanel-targeting-CBwOQJZw.js} +24 -13
- package/dist/async-modules/mixpanel-targeting-kdl-eE-1.min.js +2 -0
- package/dist/async-modules/mixpanel-targeting-kdl-eE-1.min.js.map +1 -0
- package/dist/mixpanel-core.cjs.d.ts +45 -1
- package/dist/mixpanel-core.cjs.js +577 -209
- package/dist/mixpanel-recorder.js +63 -35
- package/dist/mixpanel-recorder.min.js +1 -1
- package/dist/mixpanel-recorder.min.js.map +1 -1
- package/dist/mixpanel-targeting.js +24 -13
- package/dist/mixpanel-targeting.min.js +1 -1
- package/dist/mixpanel-targeting.min.js.map +1 -1
- package/dist/mixpanel-with-async-modules.cjs.d.ts +45 -1
- package/dist/mixpanel-with-async-modules.cjs.js +579 -211
- package/dist/mixpanel-with-async-recorder.cjs.d.ts +45 -1
- package/dist/mixpanel-with-async-recorder.cjs.js +579 -211
- package/dist/mixpanel-with-recorder.d.ts +45 -1
- package/dist/mixpanel-with-recorder.js +508 -136
- package/dist/mixpanel-with-recorder.min.d.ts +45 -1
- package/dist/mixpanel-with-recorder.min.js +1 -1
- package/dist/mixpanel.amd.d.ts +45 -1
- package/dist/mixpanel.amd.js +508 -136
- package/dist/mixpanel.cjs.d.ts +45 -1
- package/dist/mixpanel.cjs.js +508 -136
- package/dist/mixpanel.globals.js +579 -211
- package/dist/mixpanel.min.js +200 -190
- package/dist/mixpanel.module.d.ts +45 -1
- package/dist/mixpanel.module.js +508 -136
- package/dist/mixpanel.umd.d.ts +45 -1
- package/dist/mixpanel.umd.js +508 -136
- package/package.json +1 -1
- package/packages/openfeature-web-provider/README.md +357 -0
- package/packages/openfeature-web-provider/package-lock.json +1636 -0
- package/packages/openfeature-web-provider/package.json +51 -0
- package/packages/openfeature-web-provider/rollup.config.browser.mjs +26 -0
- package/packages/openfeature-web-provider/src/MixpanelProvider.ts +302 -0
- package/packages/openfeature-web-provider/src/index.ts +1 -0
- package/packages/openfeature-web-provider/src/types.ts +72 -0
- package/packages/openfeature-web-provider/test/MixpanelProvider.spec.ts +484 -0
- package/packages/openfeature-web-provider/tsconfig.json +15 -0
- package/src/autocapture/index.js +17 -12
- package/src/config.js +1 -1
- package/src/flags/flags-persistence.js +176 -0
- package/src/flags/index.js +176 -25
- package/src/index.d.ts +45 -1
- package/src/mixpanel-core.js +24 -7
- package/src/recorder/idb-config.js +16 -0
- package/src/recorder/recording-registry.js +7 -2
- package/src/recorder/session-recording.js +15 -6
- package/src/recorder-manager.js +7 -2
- package/src/request-queue.js +1 -2
- package/src/shared-lock.js +2 -3
- package/src/storage/indexed-db.js +16 -15
- package/src/storage/local-storage.js +5 -3
- package/src/utils.js +25 -12
- package/tsconfig.base.json +9 -0
- package/.claude/settings.local.json +0 -16
- package/dist/async-modules/mixpanel-recorder-BjSlYaNJ.min.js.map +0 -1
- package/dist/async-modules/mixpanel-targeting-BSHal4N9.min.js +0 -2
- package/dist/async-modules/mixpanel-targeting-BSHal4N9.min.js.map +0 -1
package/.eslintrc.json
CHANGED
|
@@ -28,6 +28,18 @@
|
|
|
28
28
|
"semi": [
|
|
29
29
|
"error",
|
|
30
30
|
"always"
|
|
31
|
+
],
|
|
32
|
+
"no-restricted-properties": ["error",
|
|
33
|
+
{
|
|
34
|
+
"object": "window",
|
|
35
|
+
"property": "localStorage",
|
|
36
|
+
"message": "Use getLocalStorage() from utils.js instead to handle browsers that block storage access."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"object": "window",
|
|
40
|
+
"property": "sessionStorage",
|
|
41
|
+
"message": "Use getSessionStorage() from utils.js instead to handle browsers that block storage access."
|
|
42
|
+
}
|
|
31
43
|
]
|
|
32
44
|
},
|
|
33
45
|
"overrides": [{
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: OpenFeature Web Provider Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
node-version: [20.x, 22.x]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
22
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
23
|
+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node-version }}
|
|
26
|
+
- name: Install OpenFeature Web Provider dependencies
|
|
27
|
+
working-directory: packages/openfeature-web-provider
|
|
28
|
+
run: npm ci
|
|
29
|
+
- name: Run OpenFeature Web Provider tests
|
|
30
|
+
working-directory: packages/openfeature-web-provider
|
|
31
|
+
run: npm test
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
**2.
|
|
1
|
+
**2.80.0** (28 May 2026)
|
|
2
|
+
|
|
3
|
+
- Fixes a session recording bug where `record_min_ms` could be bypassed after a page navigation or an idle period, causing short recordings to be uploaded. Elapsed time is now measured from the first rrweb event timestamp rather than wall-clock time, so the minimum-duration check stays accurate across navigations.
|
|
4
|
+
- Fixes a malformed first-time-events request URL that contained a double slash (`//`) before the flag ID. The URL is now built cleanly regardless of whether the base ends in `/`.
|
|
5
|
+
- Registers autocapture click/change/submit listeners in the capture phase, so events are reliably observed even when downstream handlers call `stopPropagation()`.
|
|
6
|
+
|
|
7
|
+
**2.79.0** (14 May 2026)
|
|
8
|
+
|
|
9
|
+
- Adds support for feature flag variant persistence: variants can now be cached in IndexedDB with a configurable TTL so flag values stay stable across page loads and remain available before the next fetch completes.
|
|
10
|
+
- Enables pageview events for free during session recording when record_heatmap_data is enabled, so heatmaps get accompanying pageview context without separately enabling pageview autocapture.
|
|
11
|
+
- Event-triggered session recordings now wait for remote settings to finish loading (or fail) before deciding whether to start, preventing missed recordings when a triggering event fires during init.
|
|
12
|
+
- Hardens all window.localStorage and window.sessionStorage access with exhaustive try/catch guards, so SDK initialization no longer throws in environments where storage access raises (e.g., strict privacy modes, sandboxed iframes).
|
|
13
|
+
|
|
14
|
+
**2.78.0** (8 Apr 2026)
|
|
2
15
|
- Adds `loadFlags` method to the `mixpanel.flags` to manually refresh feature flags.
|
|
3
16
|
- Adds `whenReady` method to the `mixpanel.flags`, which returns a Promise that resolves when feature flags are done fetching.
|
|
4
17
|
|
package/build.sh
CHANGED
|
@@ -6,7 +6,7 @@ set -e
|
|
|
6
6
|
if [ ! -z "$DIST" ]; then
|
|
7
7
|
export FULL=1
|
|
8
8
|
rm -r -f build
|
|
9
|
-
npm
|
|
9
|
+
npm ci
|
|
10
10
|
fi
|
|
11
11
|
|
|
12
12
|
echo 'Building main bundles'
|
|
@@ -21,7 +21,7 @@ if [ ! -z "$DIST" ]; then
|
|
|
21
21
|
|
|
22
22
|
# typescript examples require dist files
|
|
23
23
|
echo 'Building TypeScript examples'
|
|
24
|
-
pushd examples/typescript; npm
|
|
24
|
+
pushd examples/typescript; npm ci && npm run build; popd
|
|
25
25
|
fi
|
|
26
26
|
|
|
27
27
|
if [ ! -z "$FULL" ]; then
|