Use a react-native-get-random-values polyfill instead of expo-crypto - #294
Merged
Conversation
…dd new sample app
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new React Native sample project demonstrating Mixpanel integration, replacing the previous expo-crypto setup with a standalone example.
- Adds Android project configuration and resources
- Implements a simple Mixpanel-powered UI in
App.tsx - Includes testing, linting, formatting, and README documentation
Reviewed Changes
Copilot reviewed 59 out of 59 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Samples/MixpanelExample/android/gradle.properties | Configures Gradle JVM args and AndroidX settings |
| Samples/MixpanelExample/android/build.gradle | Defines buildscript repositories and plugin dependencies |
| Samples/MixpanelExample/android/app/src/main/res/values/styles.xml | Adds the app theme style |
| Samples/MixpanelExample/android/app/src/main/res/values/strings.xml | Defines app_name resource |
| Samples/MixpanelExample/android/app/src/main/res/drawable/rn_edit_text_material.xml | Supplies safe EditText drawable variant |
| Samples/MixpanelExample/android/app/src/main/java/com/mixpanelexample/MainApplication.kt | Initializes React Native host and SoLoader |
| Samples/MixpanelExample/android/app/src/main/java/com/mixpanelexample/MainActivity.kt | Sets up React activity delegate |
| Samples/MixpanelExample/android/app/src/main/AndroidManifest.xml | Declares application and activity settings |
| Samples/MixpanelExample/android/app/src/debug/AndroidManifest.xml | Enables cleartext traffic for debug builds |
| Samples/MixpanelExample/android/app/proguard-rules.pro | Placeholder for ProGuard rules |
| Samples/MixpanelExample/android/app/build.gradle | Configures app module, dependencies, and build types |
| Samples/MixpanelExample/tests/App.test.tsx | Adds a basic render test for the App component |
| Samples/MixpanelExample/README.md | Provides setup and usage instructions |
| Samples/MixpanelExample/Gemfile | Specifies Ruby gems for iOS CocoaPods environment |
| Samples/MixpanelExample/App.tsx | Implements Mixpanel example UI and event handlers |
| Samples/MixpanelExample/.watchmanconfig | Adds an empty Watchman configuration |
| Samples/MixpanelExample/.prettierrc.js | Defines Prettier formatting rules |
| Samples/MixpanelExample/.gitignore | Lists files and directories to ignore in version control |
| Samples/MixpanelExample/.eslintrc.js | Sets up ESLint base configuration |
| Samples/MixpanelExample/.bundle/config | Configures Bundler installation path |
Comments suppressed due to low confidence (1)
Samples/MixpanelExample/App.tsx:15
- Calling
mixpanel.init()without awaiting its promise may lead to tracking calls occurring before initialization completes. Consider moving initialization into auseEffectand awaiting the result before rendering or tracking events.
mixpanel.init();
…lExample - Add version 8.7.2 to Android Gradle plugin coordinate in build.gradle - Move mixpanel.init() to useEffect with proper async/await handling - Add initialization state management to prevent tracking before init completes - Add UI status indicators and disable buttons during initialization - Add error handling for initialization failures
|
Please ship this asap @jaredmixpanel And please make sure that an expo module is not being added again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove all references to
expo-cryptoand instead polyfillcrypto.getRandomValueswithreact-native-get-random-valuesto avoiduuid.v4()crashing in Expo apps... without breaking non-Expo React Native apps.Also adds a new sample/demo app,
MixpanelExamplein theSamples/folder.