Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ apps/*/.rnef

# TypeScript build cache
*.tsbuildinfo

/apps/.DS_Store
6 changes: 3 additions & 3 deletions apps/example-host/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2422,11 +2422,11 @@ SPEC CHECKSUMS:
React-timing: a275a1c2e6112dba17f8f7dd496d439213bbea0d
React-utils: 449a6e1fd53886510e284e80bdbb1b1c6db29452
ReactAppDependencyProvider: 3267432b637c9b38e86961b287f784ee1b08dde0
ReactCodegen: 329074759314ce897f564daaccf8800077479699
ReactCodegen: a1a6d7288d6a5fc86f109e46149c35d707932702
ReactCommon: b028d09a66e60ebd83ca59d8cc9a1216360db147
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 0c4b7d2aacc910a1f702694fa86be830386f4ceb

PODFILE CHECKSUM: d7ddd7fd39d49e0dd5d1205cb5dc83483092e5fb
PODFILE CHECKSUM: a8134080201cda3c42e54a89f48d0930861e3c58

COCOAPODS: 1.15.2
COCOAPODS: 1.15.2
2 changes: 1 addition & 1 deletion apps/example-host/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const config = {
module.exports = withModuleFederation(
mergeConfig(getDefaultConfig(__dirname), config),
{
name: 'MFExampleHost',
name: 'example-host',
remotes: {
mini: 'mini@http://localhost:8082/mf-manifest.json',
nestedMini: 'nestedMini@http://localhost:8083/mf-manifest.json',
Expand Down
2 changes: 1 addition & 1 deletion apps/example-mini/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = {
module.exports = withModuleFederation(
mergeConfig(getDefaultConfig(__dirname), config),
{
name: 'mini',
name: 'example-mini',
filename: 'mini.bundle',
exposes: {
'./info': './src/info.tsx',
Expand Down
3 changes: 3 additions & 0 deletions apps/example-mini/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"pods": "(cd ios && bundle install && (bundle exec pod install || bundle exec pod update))",
"build:ios": "rnef bundle-mf-remote --platform ios --dev false",
"build:android": "rnef bundle-mf-remote --platform android --dev false",
"build:rnc:ios": "react-native bundle-mf-remote --platform ios --dev false",
"build:rnc:android": "react-native bundle-mf-remote --platform android --dev false",
"serve:ios": "serve dist/ios -p 8082",
"serve:android": "serve dist/android -p 8082",
"adbreverse": "adb reverse tcp:8082 tcp:8082"
Expand All @@ -28,6 +30,7 @@
"@module-federation/metro": "workspace:*",
"@module-federation/metro-plugin-rnef": "workspace:*",
"@module-federation/runtime": "^0.15.0",
"@react-native-community/cli": "^19.1.0",
"@react-native/babel-preset": "0.80.0",
"@react-native/eslint-config": "0.80.0",
"@react-native/metro-config": "0.80.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/example-nested-mini/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = {
module.exports = withModuleFederation(
mergeConfig(getDefaultConfig(__dirname), config),
{
name: 'nestedMini',
name: 'example-nested-mini',
filename: 'nestedMini.bundle',
exposes: {
'./nestedMiniInfo': './src/nested-mini-info.tsx',
Expand Down
2 changes: 2 additions & 0 deletions apps/example-nested-mini/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"pods": "(cd ios && bundle install && (bundle exec pod install || bundle exec pod update))",
"build:ios": "rnef bundle-mf-remote --platform ios --dev false",
"build:android": "rnef bundle-mf-remote --platform android --dev false",
"build:rnc:ios": "react-native bundle-mf-remote --platform ios --dev false",
"build:rnc:android": "react-native bundle-mf-remote --platform android --dev false",
"serve:ios": "serve dist/ios -p 8083",
"serve:android": "serve dist/android -p 8083",
"adbreverse": "adb reverse tcp:8083 tcp:8083"
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ import bundleFederatedHost, { bundleFederatedHostOptions } from './bundle-host';
import bundleFederatedRemote, {
bundleFederatedRemoteOptions,
} from './bundle-remote';
import loadMetroConfig from './utils/load-metro-config';

export {
bundleFederatedHost,
bundleFederatedHostOptions,
bundleFederatedRemote,
bundleFederatedRemoteOptions,
loadMetroConfig,
};

export default {
bundleFederatedHost,
bundleFederatedHostOptions,
bundleFederatedRemote,
bundleFederatedRemoteOptions,
loadMetroConfig,
};

export type { BundleFederatedHostArgs } from './bundle-host/types';
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { withModuleFederation } from './plugin';
export { updateManifest } from './plugin/manifest';
9 changes: 9 additions & 0 deletions packages/core/src/plugin/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ export function createManifest(
return manifestPath;
}

export const updateManifest = (
manifestPath: string,
options: ModuleFederationConfigNormalized
): string => {
const manifest = generateManifest(options);
fs.writeFileSync(manifestPath, JSON.stringify(manifest, undefined, 2));
return manifestPath;
};
Comment thread
Thegrep01 marked this conversation as resolved.

function generateManifest(config: ModuleFederationConfigNormalized): Manifest {
return {
id: config.name,
Expand Down
7 changes: 6 additions & 1 deletion packages/plugin-rnc-cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {
bundleFederatedHostOptions,
bundleFederatedRemote,
bundleFederatedRemoteOptions,
loadMetroConfig,
} = commands;

const bundleMFHostCommand = {
Expand All @@ -22,4 +23,8 @@ const bundleMFRemoteCommand = {
options: bundleFederatedRemoteOptions,
};

module.exports = { bundleMFHostCommand, bundleMFRemoteCommand };
module.exports = {
bundleMFHostCommand,
bundleMFRemoteCommand,
loadMetroConfig,
};
Loading
Loading