mixpanel-react-native 3.1.0 → 3.1.1

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.
@@ -1,3 +1,9 @@
1
1
  {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(find:*)",
5
+ "Bash(ls:*)"
6
+ ]
7
+ },
2
8
  "enableAllProjectMcpServers": false
3
9
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  #
2
2
 
3
+ ## [v3.1.1](https://github.com/mixpanel/mixpanel-react-native/tree/v3.1.1) (2025-06-02)
4
+
5
+ ### Enhancements
6
+
7
+ - Add support for using Gzip compression [\#286](https://github.com/mixpanel/mixpanel-react-native/issues/286)
8
+
9
+ ### Fixes
10
+
11
+ - Make expo-crypto an optional dependency [\#292](https://github.com/mixpanel/mixpanel-react-native/pull/292)
12
+ - Add useGzipCompression parameter to types declaration file [\#290](https://github.com/mixpanel/mixpanel-react-native/pull/290)
13
+
14
+ #
15
+
3
16
  ## [v3.1.0](https://github.com/mixpanel/mixpanel-react-native/tree/v3.1.0) (2025-05-30)
4
17
 
5
18
  ### Enhancements
@@ -503,6 +516,8 @@ This major release removes all remaining calls to Mixpanel's `/decide` API endpo
503
516
 
504
517
 
505
518
 
519
+
520
+
506
521
 
507
522
 
508
523
 
package/CLAUDE.md CHANGED
@@ -79,7 +79,7 @@ const debugImplementationMode = () => {
79
79
  ### Most-Used File Locations
80
80
  - **Main API**: `index.js` (public interface with validation)
81
81
  - **JS Implementation**: `javascript/mixpanel-main.js`
82
- - **Core Logic**: `javascript/mixpanel-core.js`
82
+ - **Core Logic**: `javascript/mixpanel-core.js`
83
83
  - **Queue Management**: `javascript/mixpanel-queue.js`
84
84
  - **Network Layer**: `javascript/mixpanel-network.js`
85
85
  - **Storage Layer**: `javascript/mixpanel-storage.js`
@@ -116,7 +116,7 @@ mixpanel.mixpanelImpl.mixpanelPersistent.isIdentified(token)
116
116
 
117
117
  // Queue types:
118
118
  MixpanelType.EVENTS // "/track/"
119
- MixpanelType.USER // "/engage/"
119
+ MixpanelType.USER // "/engage/"
120
120
  MixpanelType.GROUPS // "/groups/"
121
121
 
122
122
  // Error handling pattern:
@@ -139,6 +139,30 @@ For deeper architecture understanding, consult:
139
139
  - `claude/discovered-patterns.md` - Comprehensive coding patterns
140
140
  - `claude/codebase-map.md` - File organization and responsibilities
141
141
 
142
+ ## AI Assistant Ecosystem
143
+
144
+ This project maintains a three-layer AI configuration system:
145
+
146
+ 1. **Knowledge Layer** (Claude Code Context)
147
+ - CLAUDE.md: Primary project reference
148
+ - `claude/`: Discovered patterns, architecture, workflows
149
+
150
+ 2. **Behavioral Layer** (Cursor Rules)
151
+ - `.cursor/rules/`: MDC rules for active code generation guidance
152
+ - Available to Claude Code via file reading when deeper context needed
153
+
154
+ 3. **Persistent Layer** (Copilot Instructions)
155
+ - `.github/copilot-instructions.md`: Core universal patterns (<500 lines)
156
+ - `.github/instructions/`: Specialized task-specific instructions
157
+ - `.github/prompts/`: Reusable prompt templates for complex operations
158
+
159
+ Claude Code can access all layers for comprehensive understanding.
160
+
161
+ Last ecosystem update: 2025-05-30
162
+ Next maintenance due: 2025-08-28
163
+
164
+ For maintenance: Run `/user:ai-ecosystem-maintenance`
165
+
142
166
  ## Generated Context (Original)
143
167
 
144
168
  ### Dual Implementation Strategy
package/index.d.ts CHANGED
@@ -24,7 +24,8 @@ export class Mixpanel {
24
24
  init(
25
25
  optOutTrackingDefault?: boolean,
26
26
  superProperties?: MixpanelProperties,
27
- serverURL?: String
27
+ serverURL?: string,
28
+ useGzipCompression?: boolean
28
29
  ): Promise<void>;
29
30
  setServerURL(serverURL: string): void;
30
31
  setLoggingEnabled(loggingEnabled: boolean): void;
@@ -5,7 +5,7 @@
5
5
 
6
6
  // MARK: - Mixpanel Instance
7
7
 
8
- RCT_EXTERN_METHOD(initialize:(NSString *)token trackAutomaticEvents:(BOOL)trackAutomaticEvents optOutTrackingByDefault:(BOOL)optOutTrackingByDefault properties:(NSDictionary *)properties serverURL:(NSString *)serverURL resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
8
+ RCT_EXTERN_METHOD(initialize:(NSString *)token trackAutomaticEvents:(BOOL)trackAutomaticEvents optOutTrackingByDefault:(BOOL)optOutTrackingByDefault properties:(NSDictionary *)properties serverURL:(NSString *)serverURL useGzipCompression:(BOOL)useGzipCompression resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
9
9
 
10
10
  // Mark: - Settings
11
11
  RCT_EXTERN_METHOD(setServerURL:(NSString *)token serverURL:(NSString *)serverURL resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
@@ -12,7 +12,6 @@ import {
12
12
  import { AsyncStorageAdapter } from "./mixpanel-storage";
13
13
  import uuid from "uuid";
14
14
  import { MixpanelLogger } from "mixpanel-react-native/javascript/mixpanel-logger";
15
- import { randomUUID } from "expo-crypto";
16
15
 
17
16
  export class MixpanelPersistent {
18
17
  static instance;
@@ -67,11 +66,16 @@ export class MixpanelPersistent {
67
66
  this._identity[token].deviceId = storageToken;
68
67
 
69
68
  if (!this._identity[token].deviceId) {
69
+ let newDeviceId;
70
70
  try {
71
- this._identity[token].deviceId = randomUUID();
71
+ // Try to use expo-crypto if available
72
+ const expoCrypto = require("expo-crypto");
73
+ newDeviceId = expoCrypto.randomUUID();
72
74
  } catch (e) {
73
- this._identity[token].deviceId = uuid.v4();
75
+ // Fallback to uuid.v4() if expo-crypto is not available
76
+ newDeviceId = uuid.v4();
74
77
  }
78
+ this._identity[token].deviceId = newDeviceId;
75
79
  await this.storageAdapter.setItem(
76
80
  getDeviceIdKey(token),
77
81
  this._identity[token].deviceId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-react-native",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Official React Native Tracking Library for Mixpanel Analytics",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -60,7 +60,9 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@react-native-async-storage/async-storage": "^1.21.0",
63
- "uuid": "3.3.2",
63
+ "uuid": "3.3.2"
64
+ },
65
+ "optionalDependencies": {
64
66
  "expo-crypto": "~14.1.4"
65
67
  }
66
68
  }
@@ -1,5 +0,0 @@
1
- {
2
- "java.compile.nullAnalysis.mode": "automatic",
3
- "files.trimTrailingWhitespace": true,
4
- "java.configuration.updateBuildConfiguration": "interactive"
5
- }