-
Notifications
You must be signed in to change notification settings - Fork 4
chore: update documentation #89
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
Conversation
Android Release APK for all devicesNote: if the download link expires, please re-run the workflow to generate a new build. Generated at 2025-07-14T11:51:38.325Z UTC |
iOS Release APP for simulatorsNote: if the download link expires, please re-run the workflow to generate a new build. Generated at 2025-07-14T11:52:08.473Z UTC |
jbroma
left a comment
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.
most looks good, lets just split it - remember that the README in core will be published on npm 👍
| ### Installation | ||
|
|
||
| Use your favorite package manager to install these required packages to your React Native project. | ||
|
|
||
| ```shell | ||
| # Using pnpm | ||
| pnpm add @module-federation/metro @module-federation/metro-plugin-rnc-cli | ||
| ``` |
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.
we need to differentiate between RNEF and RNC CLI and maybe note that Expo is not supported yet
| ### Configuration | ||
|
|
||
| Wrap Metro configuration with `withModuleFederation` function that enables module federation in your project. | ||
|
|
||
| ```javascript | ||
| const { withModuleFederation } = require('@module-federation/metro'); | ||
| const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); | ||
|
|
||
| const config = {}; | ||
|
|
||
| module.exports = withModuleFederation( | ||
| mergeConfig(getDefaultConfig(__dirname), config), | ||
| { | ||
| name: 'YourAppName', | ||
| remotes: { | ||
| // Define remote applications (for host apps) | ||
| // remoteName: 'remoteName@http://localhost:8082/mf-manifest.json', | ||
| }, | ||
| exposes: { | ||
| // Expose modules (for remote apps) | ||
| // './Component': './src/Component.tsx', | ||
| }, | ||
| shared: { | ||
| react: { | ||
| singleton: true, | ||
| eager: true, | ||
| requiredVersion: '19.1.0', | ||
| version: '19.1.0', | ||
| }, | ||
| 'react-native': { | ||
| singleton: true, | ||
| eager: true, | ||
| requiredVersion: '0.80.0', | ||
| version: '0.80.0', | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| // These experimental flags have to be enabled in order to patch older packages | ||
| // Can be omitted if your project is using supported React Native and Metro versions | ||
| flags: { | ||
| unstable_patchHMRClient: true, | ||
| unstable_patchInitializeCore: true, | ||
| unstable_patchRuntimeRequire: true, | ||
| }, | ||
| } | ||
| ); | ||
| ``` |
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.
lets split this into:
- Adding the plugin in metro (in here add just name + flags) - flags need proper paragraph on their own
- Configuring MF - lets mention that the configuration is the same as https://module-federation.io/configure/index.html but is not fully implemented and might differ from the target one slightly - you should always refer the official documentation for that
- We're missing a section on wrapping the RN entrypoint in HostApp with
withAsyncStartup- and we need to describe what it does
maybe its also worth to differentiate between MiniApp and HostApp - we assume that HostApp is a one without any exposes
jbroma
left a comment
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.
LGTM 🎉
Add basic documentation to README.