@posthog/browser 0.4.1 → 0.4.2

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.
@@ -34,6 +34,8 @@ __webpack_require__.d(__webpack_exports__, {
34
34
  });
35
35
  const id_js_namespaceObject = require("../../primitives/id.js");
36
36
  const external_key_value_store_js_namespaceObject = require("./key-value-store.js");
37
+ const FEATURE_FLAGS_EXTENSION = 'featureFlags';
38
+ const STORED_GROUP_PROPERTIES_KEY = '$stored_group_properties';
37
39
  const emptyRecord = ()=>Object.create(null);
38
40
  const isRecord = (value)=>'object' == typeof value && null !== value && !Array.isArray(value);
39
41
  const readGroups = (value)=>{
@@ -294,6 +296,8 @@ class BrowserState {
294
296
  }
295
297
  resetGroups() {
296
298
  this._state.groups = emptyRecord();
299
+ const flagsData = this._state.extensionData[FEATURE_FLAGS_EXTENSION];
300
+ if (flagsData && STORED_GROUP_PROPERTIES_KEY in flagsData) delete flagsData[STORED_GROUP_PROPERTIES_KEY];
297
301
  this._save();
298
302
  }
299
303
  prepareSessionForEvent(now = Date.now()) {
@@ -1,5 +1,7 @@
1
1
  import { createId } from "../../primitives/id.mjs";
2
2
  import { TabValues, createKeyValueStore } from "./key-value-store.mjs";
3
+ const FEATURE_FLAGS_EXTENSION = 'featureFlags';
4
+ const STORED_GROUP_PROPERTIES_KEY = '$stored_group_properties';
3
5
  const emptyRecord = ()=>Object.create(null);
4
6
  const isRecord = (value)=>'object' == typeof value && null !== value && !Array.isArray(value);
5
7
  const readGroups = (value)=>{
@@ -260,6 +262,8 @@ class BrowserState {
260
262
  }
261
263
  resetGroups() {
262
264
  this._state.groups = emptyRecord();
265
+ const flagsData = this._state.extensionData[FEATURE_FLAGS_EXTENSION];
266
+ if (flagsData && STORED_GROUP_PROPERTIES_KEY in flagsData) delete flagsData[STORED_GROUP_PROPERTIES_KEY];
263
267
  this._save();
264
268
  }
265
269
  prepareSessionForEvent(now = Date.now()) {
@@ -27,7 +27,7 @@ var __webpack_require__ = {};
27
27
  })();
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
- const version = "0.4.1";
30
+ const version = "0.4.2";
31
31
  __webpack_require__.d(__webpack_exports__, {}, {
32
32
  version: version
33
33
  });
@@ -1,2 +1,2 @@
1
- const version = "0.4.1";
1
+ const version = "0.4.2";
2
2
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/browser",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "A small, extension-based PostHog client for modern browsers",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -55,8 +55,8 @@
55
55
  }
56
56
  },
57
57
  "dependencies": {
58
- "@posthog/browser-common": "^0.12.0",
59
- "@posthog/types": "^1.425.1"
58
+ "@posthog/browser-common": "^0.13.0",
59
+ "@posthog/types": "^1.427.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@playwright/test": "1.52.0",
@@ -66,8 +66,8 @@
66
66
  "typescript": "7.0.2",
67
67
  "typescript-legacy": "npm:typescript@5.8.2",
68
68
  "vitest": "^1.6.1",
69
- "@posthog-tooling/sdk-mock-server": "0.0.0",
70
- "@posthog-tooling/tsconfig-base": "1.1.1"
69
+ "@posthog-tooling/tsconfig-base": "1.1.1",
70
+ "@posthog-tooling/sdk-mock-server": "0.0.0"
71
71
  },
72
72
  "scripts": {
73
73
  "clean": "rimraf dist dist-cdn",