Skip to content

Commit d31a326

Browse files
refactor: sink React packages from root to individual packages (#3907)
1 parent a7cf276 commit d31a326

File tree

39 files changed

+821
-417
lines changed

39 files changed

+821
-417
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@module-federation/bridge-shared": patch
3+
"@module-federation/bridge-react": patch
4+
"@module-federation/nextjs-mf": patch
5+
"@module-federation/modern-js": patch
6+
"@module-federation/vue3-bridge": patch
7+
"@module-federation/third-party-dts-extractor": patch
8+
"@module-federation/rsbuild-plugin": patch
9+
---
10+
11+
refactor: sink React packages from root to individual packages
12+
13+
- Removed React dependencies from root package.json and moved them to packages that actually need them
14+
- Fixed rsbuild-plugin configuration to match workspace patterns
15+
- Updated tests to handle platform-specific files
16+
- This change improves dependency management by ensuring packages only have the dependencies they actually use

apps/3000-home/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"devDependencies": {
1414
"@module-federation/nextjs-mf": "workspace:*",
1515
"@module-federation/runtime": "workspace:*",
16-
"@module-federation/utilities": "workspace:*",
16+
"@types/react": "18.3.11",
17+
"@types/react-dom": "18.3.0",
1718
"webpack": "5.98.0"
1819
},
1920
"scripts": {

apps/3001-shop/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"@module-federation/nextjs-mf": "workspace:*",
1515
"@module-federation/runtime": "workspace:*",
1616
"@module-federation/sdk": "workspace:*",
17-
"@module-federation/utilities": "workspace:*",
17+
"@types/react": "18.3.11",
18+
"@types/react-dom": "18.3.0",
1819
"webpack": "5.98.0"
1920
},
2021
"scripts": {

apps/3002-checkout/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"@module-federation/nextjs-mf": "workspace:*",
1515
"@module-federation/runtime": "workspace:*",
1616
"@module-federation/sdk": "workspace:*",
17-
"@module-federation/utilities": "workspace:*",
17+
"@types/react": "18.3.11",
18+
"@types/react-dom": "18.3.0",
1819
"webpack": "5.98.0"
1920
},
2021
"scripts": {

apps/bundle-size/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
"@module-federation/enhanced": "workspace:*",
1010
"@module-federation/dts-plugin": "workspace:*",
1111
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
12-
"react-refresh": "0.14.2"
12+
"react-refresh": "0.14.2",
13+
"@types/react": "18.3.11",
14+
"@types/react-dom": "18.3.0"
1315
},
1416
"dependencies": {
15-
"antd": "4.24.15"
17+
"antd": "4.24.15",
18+
"react": "18.3.1",
19+
"react-dom": "18.3.1"
1620
}
1721
}

apps/manifest-demo/3009-webpack-provider/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
"@module-federation/enhanced": "workspace:*",
88
"@module-federation/typescript": "workspace:*",
99
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
10-
"react-refresh": "0.14.2"
10+
"react-refresh": "0.14.2",
11+
"@types/react": "18.3.11",
12+
"@types/react-dom": "18.3.0"
1113
},
1214
"dependencies": {
13-
"antd": "4.24.14"
15+
"antd": "4.24.14",
16+
"react": "18.3.1",
17+
"react-dom": "18.3.1"
1418
}
1519
}

apps/manifest-demo/3010-rspack-provider/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
88
"react-refresh": "0.14.2",
99
"@rspack/plugin-react-refresh": "^0.7.5",
10-
"@rspack/core": "^1.0.2"
10+
"@rspack/core": "^1.0.2",
11+
"@types/react": "18.3.11",
12+
"@types/react-dom": "18.3.0"
1113
},
1214
"dependencies": {
1315
"antd": "4.24.15",
16+
"react": "18.3.1",
17+
"react-dom": "18.3.1",
1418
"react-router-dom": "^6.23.1"
1519
}
1620
}

apps/manifest-demo/3011-rspack-manifest-provider/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
"@module-federation/enhanced": "workspace:*",
77
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
88
"react-refresh": "0.14.2",
9-
"@rspack/plugin-react-refresh": "^0.7.5"
9+
"@rspack/plugin-react-refresh": "^0.7.5",
10+
"@types/react": "18.3.11",
11+
"@types/react-dom": "18.3.0"
1012
},
1113
"dependencies": {
1214
"lodash": "4.17.21",
13-
"antd": "4.24.15"
15+
"antd": "4.24.15",
16+
"react": "18.3.1",
17+
"react-dom": "18.3.1"
1418
}
1519
}

apps/manifest-demo/3012-rspack-js-entry-provider/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
"@module-federation/enhanced": "workspace:*",
77
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
88
"react-refresh": "0.14.2",
9-
"@rspack/plugin-react-refresh": "^0.7.5"
9+
"@rspack/plugin-react-refresh": "^0.7.5",
10+
"@types/react": "18.3.11",
11+
"@types/react-dom": "18.3.0"
1012
},
1113
"dependencies": {
1214
"lodash": "4.17.21",
13-
"antd": "4.24.15"
15+
"antd": "4.24.15",
16+
"react": "18.3.1",
17+
"react-dom": "18.3.1"
1418
}
1519
}

apps/manifest-demo/webpack-host/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
"@module-federation/typescript": "workspace:*",
88
"@module-federation/enhanced": "workspace:*",
99
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
10-
"react-refresh": "0.14.2"
10+
"react-refresh": "0.14.2",
11+
"@types/react": "18.3.11",
12+
"@types/react-dom": "18.3.0"
1113
},
1214
"dependencies": {
13-
"antd": "4.24.15"
15+
"antd": "4.24.15",
16+
"react": "18.3.1",
17+
"react-dom": "18.3.1",
18+
"react-router-dom": "^6.23.1"
1419
}
1520
}

0 commit comments

Comments
 (0)