Skip to content

Conversation

@Esemesek
Copy link
Collaborator

Add basic documentation to README.

@Esemesek Esemesek requested a review from jbroma July 14, 2025 10:17
@github-actions
Copy link

github-actions bot commented Jul 14, 2025

Android Release APK for all devices

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2025-07-14T11:51:38.325Z UTC

@github-actions
Copy link

github-actions bot commented Jul 14, 2025

iOS Release APP for simulators

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2025-07-14T11:52:08.473Z UTC

Copy link
Member

@jbroma jbroma left a 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 👍

@Esemesek Esemesek requested a review from jbroma July 14, 2025 11:09
Comment on lines 5 to 12
### 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
```
Copy link
Member

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

Comment on lines 14 to 61
### 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,
},
}
);
```
Copy link
Member

Choose a reason for hiding this comment

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

lets split this into:

  1. Adding the plugin in metro (in here add just name + flags) - flags need proper paragraph on their own
  2. 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
  3. 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

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@Esemesek Esemesek merged commit 4909c8c into main Jul 14, 2025
4 checks passed
@Esemesek Esemesek deleted the esemesek/docs branch July 14, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants