-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update docs on usage #216
Conversation
There was a problem hiding this 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 | ||
|
There was a problem hiding this comment.
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.
<!-- | |
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. | ||
|
There was a problem hiding this comment.
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.
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]>
Merging this PR will fix #210 by: