Skip to content

added react-native-get-random-values package #391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ashar-aala
Copy link
Contributor

@ashar-aala ashar-aala commented Apr 9, 2025

Description (required)

I have added react-native-get-random-values package for linking in react-native and expo sdks. This PR depends on the kinde-react-native-sdk-0-7x PR. In other words, once the PR is merged, this PR should also be merged.

Related issues & labels (optional)

  • Closes #
  • Suggested label:

Summary by CodeRabbit

  • Documentation
    • Updated the Expo React Native SDK and React Native SDK guides to include integration instructions for a new dependency.
    • Enhanced installation steps and code examples for both Android and iOS, ensuring a smoother setup process.

Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

Walkthrough

The changes integrate the react-native-get-random-values package into the Expo React Native SDK documentation and native project configurations. Adjustments include updating Android build files (settings.gradle, build.gradle, MainApplication in Java and Kotlin) and the iOS Podfile. Both the Expo React Native and React Native SDK documentation now include updated installation instructions reflecting these native dependency changes.

Changes

File(s) Change Summary
android/settings.gradle, android/app/build.gradle, MainApplication.java,
MainApplication.kt
Added integration of react-native-get-random-values: new dependency and package registration in Android native configuration files.
Podfile Updated to include the react-native-get-random-values pod, ensuring proper iOS dependency integration.
src/.../expo-react-native.mdx, src/.../react-native-sdk.mdx Documentation updated to reflect the new dependency installation steps and manual linking instructions for both Android and iOS.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Doc as Documentation
    participant Android as Android Build System
    participant MainApp as Main Application
    participant iOS as iOS Build System

    Dev->>Doc: Read integration documentation
    Doc->>Dev: Outline steps for including react-native-get-random-values
    Dev->>Android: Update settings.gradle & build.gradle
    Android->>MainApp: Register RNGetRandomValuesPackage (Java/Kotlin)
    Dev->>iOS: Update Podfile for dependency
    iOS-->>Dev: Confirm iOS integration complete
Loading

Poem

I'm a small rabbit with coding glee,
Hopping through files in Android and iOS with glee.
New dependencies dance in the build and docs,
Bringing random values to open our blocks.
Cheers to clean code and integration so fine,
A joyful leap forward—this update is divine!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8cdf9ac and d3ac1c0.

📒 Files selected for processing (2)
  • src/content/docs/developer-tools/sdks/native/expo-react-native.mdx (7 hunks)
  • src/content/docs/developer-tools/sdks/native/react-native-sdk.mdx (9 hunks)
🔇 Additional comments (15)
src/content/docs/developer-tools/sdks/native/react-native-sdk.mdx (8)

65-65: Document Updated Dependency List
The introduction now clearly lists react-native-get-random-values alongside the other required packages. This clarity helps users be aware of all dependencies and the need for manual linking if auto-linking fails.


75-77: Include react-native-get-random-values in Android settings.gradle
The added lines correctly include the new package and specify its project directory. Please verify that the relative path ('../node_modules/react-native-get-random-values/android') is correct for all target setups.


93-95: Add Dependency in Android Build Configuration
The diff adding

implementation project(':react-native-get-random-values')

in the android/app/build.gradle ensures this dependency is compiled with the app. Confirm that the build system picks up the module without conflicts.


105-107: Import RNGetRandomValuesPackage in MainApplication.java
Including

import org.linusu.RNGetRandomValuesPackage;

ensures the native module is available. Make sure its order among other imports is consistent with coding conventions.


117-119: Register RNGetRandomValuesPackage in Packages List
The addition of

packages.add(new RNGetRandomValuesPackage());

in the React Native package list confirms that the package will be properly instantiated at runtime.


132-134: Synchronize Kotlin Imports
In the MainApplication.kt snippet, the new line

import org.linusu.RNGetRandomValuesPackage;

mirrors the Java configuration. This consistency is beneficial for projects using the Kotlin template.


152-154: Include RNGetRandomValuesPackage in Kotlin Packages List
Adding

add(RNGetRandomValuesPackage());

into the Kotlin package list ensures parity with the Java version for React Native 0.73+ projects.


175-176: Add Podfile Entry for iOS Integration
The new Podfile line

pod 'react-native-get-random-values', :path => '../node_modules/react-native-get-random-values'

correctly instructs CocoaPods to include this dependency. Verify the path relative to the iOS folder.

src/content/docs/developer-tools/sdks/native/expo-react-native.mdx (7)

76-78: Include Dependency in Android settings.gradle (Expo)
The addition of

include ':react-native-get-random-values'
project(':react-native-get-random-values').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-get-random-values/android')

ensures that Expo projects using the bare workflow have the new package properly linked.


95-98: Add Dependency in Android App Build (Expo)
By adding

implementation project(':react-native-get-random-values')

in the android/app/build.gradle section, the documentation now shows how to integrate the package into the Expo build. Confirm that there are no conflicts with auto-linking for Expo managed projects.


109-111: Import RNGetRandomValuesPackage in MainApplication.java (Expo)
The insertion of

import org.linusu.RNGetRandomValuesPackage;

in the Java snippet makes the new package available in Expo projects that use the bare workflow.


122-124: Register RNGetRandomValuesPackage in Java Packages List (Expo)
Adding

packages.add(new RNGetRandomValuesPackage());

to the packages list aligns the Expo configuration with the main SDK instructions.


140-142: Include RNGetRandomValuesPackage in MainApplication.kt (Expo)
The Kotlin snippet now includes

import org.linusu.RNGetRandomValuesPackage;

which is essential for Expo projects using Kotlin-based configuration.


152-154: Register RNGetRandomValuesPackage in Kotlin Packages List (Expo)
The addition of

add(RNGetRandomValuesPackage());

in the Kotlin configuration ensures proper linking of the dependency.


188-190: Add Podfile Entry for react-native-get-random-values (Expo iOS)
The updated Podfile snippet now includes

pod 'react-native-get-random-values', :path => '../node_modules/react-native-get-random-values'

which is necessary for proper iOS integration under Expo.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants