Skip to content

Update docs on usage #216

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

Merged
merged 2 commits into from
Aug 11, 2025
Merged

Update docs on usage #216

merged 2 commits into from
Aug 11, 2025

Conversation

kraenhansen
Copy link
Collaborator

@kraenhansen kraenhansen commented Aug 6, 2025

Merging this PR will fix #210 by:

  • Clarifying the steps needed to build React Native (and Hermes) from source on Android.
  • Delete the section on path-hashing that we're no longer doing.
  • Clarifying that require calls are no longer resolved but instead transformed through our Babel plugin.
  • Adding a CMakeList.txt in the usage guide to workaround the missing "shorthand" that we thought we would have.

@kraenhansen kraenhansen self-assigned this Aug 6, 2025
@kraenhansen kraenhansen added the documentation Improvements or additions to documentation label Aug 6, 2025
@kraenhansen kraenhansen requested a review from Copilot August 11, 2025 05:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the documentation to clarify usage instructions and fix issue #210. The changes primarily shift from a Metro-based require resolution approach to a Babel plugin transformation approach, while also providing clearer build instructions for Android development.

  • Replaced Metro config with Babel plugin configuration for resolving Node-API dynamic libraries
  • Added comprehensive Android build instructions including React Native and Hermes source building
  • Updated the native module build process to use cmake-rn instead of the previous shorthand command

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
docs/USAGE.md Updates configuration from Metro to Babel plugin, adds CMakeLists.txt example, and updates build commands
docs/HOW-IT-WORKS.md Removes outdated path-hashing documentation that is no longer used
docs/ANDROID.md Adds detailed instructions for building React Native from source with custom Hermes version

<!-- TODO: Add a listing of the files produced when running command: Some temp (cached) CMakeList.txt, the CMake project dir, 2x platform specific prebuild directories -->
```
npx cmake-rn
```

### Load and export the native module

Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path './build/Release/addon.node' should be documented to explain that this is the output path from the cmake-rn build process, as it may not be immediately clear to developers where this path comes from.

Suggested change
<!--
The path './build/Release/addon.node' refers to the output file generated by the `cmake-rn` build process.
After running `npx cmake-rn`, the compiled native module will be placed at this location.
-->

Copilot uses AI. Check for mistakes.

```

This will print a path which needs to be stored in `REACT_NATIVE_OVERRIDE_HERMES_DIR` to instruct the React Native Gradle scripts to use it.

Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding an example of what the printed path looks like to help developers understand the expected output format.

Suggested change
Example output:

/path/to/your/project/node_modules/.cache/react-native-node-api/hermes-android-0.73.3

Copilot uses AI. Check for mistakes.

Co-authored-by: Copilot <[email protected]>
@kraenhansen kraenhansen merged commit 3f63ccf into main Aug 11, 2025
4 of 6 checks passed
@kraenhansen kraenhansen deleted the kh/update-docs branch August 11, 2025 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update documentation on usage
1 participant