Skip to content

Commit

Permalink
Merge branch 'master' into fix/axios-cloudflare-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Dec 4, 2023
2 parents 18e5aef + 53400c7 commit 07f71c4
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
9 changes: 9 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Releasing
=========

1. Update the `CHANGELOG.md` with the version and date (each package has its own `CHANGELOG.md`).
2. Update the `version` in the `package.json` file (each package has its own `package.json`).
3. Open a PR with the changes.
4. After merging the PR, The GH Action (release.yml) is doing everything else automatically.
1. For React Native, the `scripts.prebuild` (`package.json`) is generating a `version.ts` file with the version which is used at runtime.
5. Done.
22 changes: 20 additions & 2 deletions posthog-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ export abstract class PostHogCore extends PostHogCoreStateless {
/***
* PROPERTIES
***/
personProperties(properties: { [type: string]: string }): this {
setPersonPropertiesForFlags(properties: { [type: string]: string }): this {
// Get persisted person properties
const existingProperties =
this.getPersistedProperty<Record<string, string>>(PostHogPersistedProperty.PersonProperties) || {}
Expand All @@ -880,7 +880,16 @@ export abstract class PostHogCore extends PostHogCoreStateless {
return this
}

groupProperties(properties: { [type: string]: Record<string, string> }): this {
resetPersonPropertiesForFlags(): void {
this.setPersistedProperty<PostHogEventProperties>(PostHogPersistedProperty.PersonProperties, {})
}

/** @deprecated - Renamed to setPersonPropertiesForFlags */
personProperties(properties: { [type: string]: string }): this {
return this.setPersonPropertiesForFlags(properties)
}

setGroupPropertiesForFlags(properties: { [type: string]: Record<string, string> }): this {
// Get persisted group properties
const existingProperties =
this.getPersistedProperty<Record<string, Record<string, string>>>(PostHogPersistedProperty.GroupProperties) || {}
Expand All @@ -902,6 +911,15 @@ export abstract class PostHogCore extends PostHogCoreStateless {
return this
}

resetGroupPropertiesForFlags(): void {
this.setPersistedProperty<PostHogEventProperties>(PostHogPersistedProperty.GroupProperties, {})
}

/** @deprecated - Renamed to setGroupPropertiesForFlags */
groupProperties(properties: { [type: string]: Record<string, string> }): this {
return this.setGroupPropertiesForFlags(properties)
}

/***
*** FEATURE FLAGS
***/
Expand Down
5 changes: 5 additions & 0 deletions posthog-react-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.9.0 - 2023-12-04

1. Renamed `personProperties` to `setPersonPropertiesForFlags` to match `posthog-js` and more clearly indicated what it does
2. Renamed `groupProperties` to `setGroupPropertiesForFlags` to match `posthog-js` and more clearly indicated what it does

# 2.8.1 - 2023-10-09

1. Fixes a type generation issue
Expand Down
2 changes: 1 addition & 1 deletion posthog-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "posthog-react-native",
"version": "2.8.1",
"version": "2.9.0",
"main": "lib/posthog-react-native/index.js",
"files": [
"lib/"
Expand Down
5 changes: 5 additions & 0 deletions posthog-web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.5.0 - 2023-12-04

1. Renamed `personProperties` to `setPersonPropertiesForFlags` to match `posthog-js` and more clearly indicated what it does
2. Renamed `groupProperties` to `setGroupPropertiesForFlags` to match `posthog-js` and more clearly indicated what it does

# 2.4.0 - 2023-04-20

1. Fixes a race condition that could occur when initialising PostHog
Expand Down
2 changes: 1 addition & 1 deletion posthog-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "posthog-js-lite",
"version": "2.4.0",
"version": "2.5.0",
"main": "lib/index.cjs.js",
"module": "lib/index.esm.js",
"types": "lib/index.d.ts",
Expand Down

0 comments on commit 07f71c4

Please sign in to comment.