@posthog/react-native-plugin 2.5.0 → 2.5.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.
@@ -8,7 +8,13 @@ def isNewArchitectureEnabled() {
8
8
  }
9
9
 
10
10
  apply plugin: "com.android.library"
11
- apply plugin: "kotlin-android"
11
+ // AGP 9 ships built-in Kotlin support and registers the `kotlin` extension
12
+ // itself. Applying the Kotlin plugin on top of it fails configuration with
13
+ // "Cannot add extension with name 'kotlin'". Only apply it when nothing has
14
+ // registered that extension yet.
15
+ if (project.extensions.findByName('kotlin') == null) {
16
+ apply plugin: "kotlin-android"
17
+ }
12
18
 
13
19
  if (isNewArchitectureEnabled()) {
14
20
  apply plugin: "com.facebook.react"
@@ -85,7 +91,7 @@ dependencies {
85
91
  //noinspection GradleDynamicVersion
86
92
  implementation "com.facebook.react:react-native:+"
87
93
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
88
- implementation "com.posthog:posthog-android:3.60.7"
94
+ implementation "com.posthog:posthog-android:3.61.0"
89
95
 
90
96
  testImplementation "junit:junit:4.13.2"
91
97
  }
package/ios/Package.swift CHANGED
@@ -31,7 +31,7 @@ let package = Package(
31
31
  dependencies: reactNativeDependencies + [
32
32
  .package(
33
33
  url: "https://github.com/PostHog/posthog-ios.git",
34
- .upToNextMinor(from: "3.69.10")
34
+ .upToNextMinor(from: "3.70.1")
35
35
  ),
36
36
  ],
37
37
  targets: [
@@ -111,13 +111,13 @@ function setPushIdentityProvider(provider) {
111
111
  const minted = await provider(request.distinctId, request.appId);
112
112
  token = typeof minted === 'string' ? minted : null;
113
113
  } catch (e) {
114
- // eslint-disable-next-line no-console
114
+ // oxlint-disable-next-line no-console
115
115
  console.warn(`[PostHog] pushIdentityProvider threw: ${e}. Push subscription will be sent unauthenticated.`);
116
116
  }
117
117
  try {
118
118
  await PosthogReactNativePlugin.providePushIdentityToken(request.requestId, token);
119
119
  } catch (e) {
120
- // eslint-disable-next-line no-console
120
+ // oxlint-disable-next-line no-console
121
121
  console.warn(`[PostHog] Failed to deliver push identity token to native: ${e}`);
122
122
  }
123
123
  });
@@ -92,13 +92,13 @@ export function setPushIdentityProvider(provider) {
92
92
  const minted = await provider(request.distinctId, request.appId);
93
93
  token = typeof minted === 'string' ? minted : null;
94
94
  } catch (e) {
95
- // eslint-disable-next-line no-console
95
+ // oxlint-disable-next-line no-console
96
96
  console.warn(`[PostHog] pushIdentityProvider threw: ${e}. Push subscription will be sent unauthenticated.`);
97
97
  }
98
98
  try {
99
99
  await PosthogReactNativePlugin.providePushIdentityToken(request.requestId, token);
100
100
  } catch (e) {
101
- // eslint-disable-next-line no-console
101
+ // oxlint-disable-next-line no-console
102
102
  console.warn(`[PostHog] Failed to deliver push identity token to native: ${e}`);
103
103
  }
104
104
  });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
3
+ //# sourceMappingURL=vitest.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../../../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAME"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
3
+ //# sourceMappingURL=vitest.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../../../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAME"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/react-native-plugin",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "PostHog React Native plugin for iOS and Android integrations",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -57,28 +57,18 @@
57
57
  "homepage": "https://github.com/PostHog/posthog-js/tree/main/packages/react-native-plugin#readme",
58
58
  "devDependencies": {
59
59
  "@react-native-community/cli": "20.0.0",
60
- "@types/jest": "^29.5.14",
61
60
  "@types/react": "^18.2.44",
62
61
  "del-cli": "^5.1.0",
63
- "jest": "29.7.0",
64
62
  "react": "18.3.1",
65
63
  "react-native": "0.75.3",
66
64
  "react-native-builder-bob": "^0.30.2",
67
- "typescript": "5.8.2"
65
+ "typescript": "5.8.2",
66
+ "vitest": "^1.6.1"
68
67
  },
69
68
  "peerDependencies": {
70
69
  "react": "*",
71
70
  "react-native": "*"
72
71
  },
73
- "jest": {
74
- "modulePathIgnorePatterns": [
75
- "<rootDir>/lib/"
76
- ],
77
- "testPathIgnorePatterns": [
78
- "/node_modules/",
79
- "<rootDir>/lib/"
80
- ]
81
- },
82
72
  "react-native-builder-bob": {
83
73
  "source": "src",
84
74
  "output": "lib",
@@ -106,10 +96,10 @@
106
96
  },
107
97
  "scripts": {
108
98
  "clean": "del-cli android/build lib",
109
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
110
- "lint:fix": "eslint \"**/*.{js,ts,tsx}\" --fix",
99
+ "lint": "oxlint --report-unused-disable-directives-severity error .",
100
+ "lint:fix": "oxlint --report-unused-disable-directives-severity error . --fix",
111
101
  "typecheck": "tsc",
112
- "test:unit": "jest --passWithNoTests && node scripts/check-spm-manifest.mjs",
102
+ "test:unit": "vitest run --passWithNoTests && node scripts/check-spm-manifest.mjs",
113
103
  "test": "pnpm test:unit",
114
104
  "build": "bob build",
115
105
  "package": "pnpm pack --out $PACKAGE_DEST/%s.tgz"
@@ -6,7 +6,7 @@ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1
6
6
  # Single source of truth for the posthog-ios native dependency version.
7
7
  # Used by both the SPM and CocoaPods resolution paths below; bump this
8
8
  # line when picking up a new posthog-ios release.
9
- posthog_ios_version = '3.69.10'
9
+ posthog_ios_version = '3.70.1'
10
10
 
11
11
  Pod::Spec.new do |s|
12
12
  s.name = "posthog-react-native-plugin"
package/src/index.tsx CHANGED
@@ -160,13 +160,13 @@ export function setPushIdentityProvider(provider: PostHogPushIdentityProvider):
160
160
  const minted = await provider(request.distinctId, request.appId)
161
161
  token = typeof minted === 'string' ? minted : null
162
162
  } catch (e) {
163
- // eslint-disable-next-line no-console
163
+ // oxlint-disable-next-line no-console
164
164
  console.warn(`[PostHog] pushIdentityProvider threw: ${e}. Push subscription will be sent unauthenticated.`)
165
165
  }
166
166
  try {
167
167
  await PosthogReactNativePlugin.providePushIdentityToken(request.requestId, token)
168
168
  } catch (e) {
169
- // eslint-disable-next-line no-console
169
+ // oxlint-disable-next-line no-console
170
170
  console.warn(`[PostHog] Failed to deliver push identity token to native: ${e}`)
171
171
  }
172
172
  }