Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/metro-083-compat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@module-federation/metro": patch
---

Add Metro 0.83 compatibility layer. Metro 0.83 introduced a restrictive `exports` field that only allows `metro/private/*` paths instead of direct `metro/src/*` imports. This adds a `metro-compat` utility that dynamically resolves the correct import path, ensuring compatibility with both Metro 0.82 and 0.83+.
49 changes: 23 additions & 26 deletions apps/metro-example-host/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.2.2.1)
CFPropertyList (3.0.9)
activesupport (7.1.6)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
tzinfo (~> 2.0)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (4.0.1)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
Expand Down Expand Up @@ -66,34 +64,33 @@ GEM
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.3)
connection_pool (2.5.3)
drb (2.2.1)
connection_pool (2.5.5)
drb (2.2.3)
escape (0.0.4)
ethon (0.16.0)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.17.2)
ffi (1.17.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.9.0)
mutex_m
i18n (1.14.7)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.11.3)
json (2.18.1)
logger (1.7.0)
minitest (5.25.5)
minitest (5.26.1)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.4.1)
rexml (3.4.4)
ruby-macho (2.5.1)
securerandom (0.4.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
securerandom (0.3.2)
typhoeus (1.5.0)
ethon (>= 0.9.0, < 0.16.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.1)
Expand All @@ -118,7 +115,7 @@ DEPENDENCIES
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 3.1.0p0
ruby 2.7.6p219

BUNDLED WITH
2.6.1
2.1.4
8 changes: 4 additions & 4 deletions apps/metro-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: a1a6d7288d6a5fc86f109e46149c35d707932702
ReactCodegen: d308d08c58717331dcf82d0129efa8b73e28a64c
ReactCommon: b028d09a66e60ebd83ca59d8cc9a1216360db147
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 0c4b7d2aacc910a1f702694fa86be830386f4ceb
Yoga: 395b5d614cd7cbbfd76b05d01bd67230a6ad004e

PODFILE CHECKSUM: a8134080201cda3c42e54a89f48d0930861e3c58
PODFILE CHECKSUM: d7ddd7fd39d49e0dd5d1205cb5dc83483092e5fb

COCOAPODS: 1.15.2
COCOAPODS: 1.15.2
9 changes: 7 additions & 2 deletions apps/metro-example-host/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ const {withModuleFederation} = require('@module-federation/metro');
*/

const config = {
resolver: {useWatchman: false},
resolver: {
extraNodeModules: {
'@babel/runtime': path.resolve(__dirname, 'node_modules/@babel/runtime'),
},
useWatchman: false,
},
watchFolders: [
path.resolve(__dirname, '../../node_modules'),
path.resolve(__dirname, '../../packages/core'),
path.resolve(__dirname, '../../packages'),
],
};

Expand Down
45 changes: 21 additions & 24 deletions apps/metro-example-mini/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.2.2.1)
CFPropertyList (3.0.9)
activesupport (7.1.6)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
tzinfo (~> 2.0)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
benchmark (0.5.0)
bigdecimal (4.0.1)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
Expand Down Expand Up @@ -66,34 +64,33 @@ GEM
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.3)
connection_pool (2.5.3)
connection_pool (2.5.5)
drb (2.2.3)
escape (0.0.4)
ethon (0.16.0)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.17.2)
ffi (1.17.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.9.0)
mutex_m
i18n (1.14.7)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.12.2)
json (2.18.1)
logger (1.7.0)
minitest (5.25.5)
minitest (5.26.1)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.4.2)
rexml (3.4.4)
ruby-macho (2.5.1)
securerandom (0.4.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
securerandom (0.3.2)
typhoeus (1.5.0)
ethon (>= 0.9.0, < 0.16.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.1)
Expand All @@ -118,7 +115,7 @@ DEPENDENCIES
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 3.1.0p0
ruby 2.7.6p219

BUNDLED WITH
2.6.1
2.1.4
4 changes: 2 additions & 2 deletions apps/metro-example-mini/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2422,10 +2422,10 @@ SPEC CHECKSUMS:
React-timing: a275a1c2e6112dba17f8f7dd496d439213bbea0d
React-utils: 449a6e1fd53886510e284e80bdbb1b1c6db29452
ReactAppDependencyProvider: 3267432b637c9b38e86961b287f784ee1b08dde0
ReactCodegen: a1a6d7288d6a5fc86f109e46149c35d707932702
ReactCodegen: d308d08c58717331dcf82d0129efa8b73e28a64c
ReactCommon: b028d09a66e60ebd83ca59d8cc9a1216360db147
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 0c4b7d2aacc910a1f702694fa86be830386f4ceb
Yoga: 395b5d614cd7cbbfd76b05d01bd67230a6ad004e

PODFILE CHECKSUM: a8134080201cda3c42e54a89f48d0930861e3c58

Expand Down
9 changes: 7 additions & 2 deletions apps/metro-example-mini/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ const {withModuleFederation} = require('@module-federation/metro');
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {
resolver: {useWatchman: false},
resolver: {
extraNodeModules: {
'@babel/runtime': path.resolve(__dirname, 'node_modules/@babel/runtime'),
},
useWatchman: false,
},
watchFolders: [
path.resolve(__dirname, '../../node_modules'),
path.resolve(__dirname, '../../packages/core'),
path.resolve(__dirname, '../../packages'),
],
};

Expand Down
45 changes: 21 additions & 24 deletions apps/metro-example-nested-mini/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.2.2.1)
CFPropertyList (3.0.9)
activesupport (7.1.6)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
tzinfo (~> 2.0)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
benchmark (0.5.0)
bigdecimal (4.0.1)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
Expand Down Expand Up @@ -66,34 +64,33 @@ GEM
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.3)
connection_pool (2.5.3)
connection_pool (2.5.5)
drb (2.2.3)
escape (0.0.4)
ethon (0.16.0)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.17.2)
ffi (1.17.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.9.0)
mutex_m
i18n (1.14.7)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.12.2)
json (2.18.1)
logger (1.7.0)
minitest (5.25.5)
minitest (5.26.1)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.4.1)
rexml (3.4.4)
ruby-macho (2.5.1)
securerandom (0.4.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
securerandom (0.3.2)
typhoeus (1.5.0)
ethon (>= 0.9.0, < 0.16.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.1)
Expand All @@ -118,7 +115,7 @@ DEPENDENCIES
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 3.1.0p0
ruby 2.7.6p219

BUNDLED WITH
2.6.1
2.1.4
4 changes: 2 additions & 2 deletions apps/metro-example-nested-mini/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2422,10 +2422,10 @@ SPEC CHECKSUMS:
React-timing: a275a1c2e6112dba17f8f7dd496d439213bbea0d
React-utils: 449a6e1fd53886510e284e80bdbb1b1c6db29452
ReactAppDependencyProvider: 3267432b637c9b38e86961b287f784ee1b08dde0
ReactCodegen: a1a6d7288d6a5fc86f109e46149c35d707932702
ReactCodegen: d308d08c58717331dcf82d0129efa8b73e28a64c
ReactCommon: b028d09a66e60ebd83ca59d8cc9a1216360db147
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 0c4b7d2aacc910a1f702694fa86be830386f4ceb
Yoga: 395b5d614cd7cbbfd76b05d01bd67230a6ad004e

PODFILE CHECKSUM: a8134080201cda3c42e54a89f48d0930861e3c58

Expand Down
9 changes: 7 additions & 2 deletions apps/metro-example-nested-mini/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ const {withModuleFederation} = require('@module-federation/metro');
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {
resolver: {useWatchman: false},
resolver: {
extraNodeModules: {
'@babel/runtime': path.resolve(__dirname, 'node_modules/@babel/runtime'),
},
useWatchman: false,
},
watchFolders: [
path.resolve(__dirname, '../../node_modules'),
path.resolve(__dirname, '../../packages/core'),
path.resolve(__dirname, '../../packages'),
],
};

Expand Down
Loading
Loading