Skip to content

Commit 450aa37

Browse files
feat(nextjs-mf): support next 15 peer dep (#3111)
1 parent 1478f50 commit 450aa37

File tree

12 files changed

+563
-389
lines changed

12 files changed

+563
-389
lines changed

.changeset/mighty-seas-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/nextjs-mf': patch
3+
---
4+
5+
add next 15 to peer deps

apps/3000-home/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"antd": "5.19.1",
76
"@ant-design/cssinjs": "^1.21.0",
7+
"antd": "5.19.1",
88
"lodash": "4.17.21",
9-
"next": "14.2.15",
9+
"next": "14.2.0",
1010
"react": "18.3.1"
1111
},
1212
"devDependencies": {
1313
"@module-federation/nextjs-mf": "workspace:*",
14-
"@module-federation/utilities": "workspace:*",
15-
"@module-federation/runtime": "workspace:*"
14+
"@module-federation/runtime": "workspace:*",
15+
"@module-federation/utilities": "workspace:*"
1616
},
1717
"scripts": {
1818
"start": "next start",

apps/3001-shop/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"antd": "5.19.1",
76
"@ant-design/cssinjs": "^1.21.0",
7+
"antd": "5.19.1",
88
"lodash": "4.17.21",
9-
"next": "14.2.15",
9+
"next": "14.2.0",
1010
"react": "18.3.1"
1111
},
1212
"devDependencies": {
1313
"@module-federation/nextjs-mf": "workspace:*",
14-
"@module-federation/sdk": "workspace:*",
1514
"@module-federation/runtime": "workspace:*",
15+
"@module-federation/sdk": "workspace:*",
1616
"@module-federation/utilities": "workspace:*"
1717
},
1818
"scripts": {

apps/3002-checkout/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"antd": "5.19.1",
76
"@ant-design/cssinjs": "^1.21.0",
7+
"antd": "5.19.1",
88
"lodash": "4.17.21",
9-
"next": "14.2.15",
9+
"next": "14.2.0",
1010
"react": "18.3.1"
1111
},
1212
"devDependencies": {

apps/website-new/docs/en/guide/framework/nextjs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This plugin enables Module Federation on Next.js
88

99
## Supports
1010

11-
- next ^14 || ^13 || ^12
11+
- next ^15 || ^14 || ^13 || ^12
1212
- Server-Side Rendering
1313
- Pages router
1414

@@ -21,7 +21,7 @@ I set `process.env.NEXT_PRIVATE_LOCAL_WEBPACK = 'true'` inside this plugin, but
2121

2222
"Local Webpack" means you must have webpack installed as a dependency, and next will not use its bundled copy of webpack which cannot be used as i need access to all of webpack internals
2323

24-
- `NEXT_PRIVATE_LOCAL_WEBPACK=true next dev` or `next build`
24+
- `cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev` or `next build`
2525
- `npm install webpack`
2626

2727
## Usage

apps/website-new/docs/en/practice/frameworks/next/index.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import {Steps, Tabs, Tab, Badge, SourceCode} from '@theme';
1111
<Badge text="Next 12" type="info" />
1212
<Badge text="Next 13" type="info" />
1313
<Badge text="Next 14" type="info" />
14+
<Badge text="Next 15" type="info" />
1415
<Badge text="SSR (Pages Router)" type="info" />
1516
</span>
1617
<Badge text="App Router" type="danger" />
18+
<Badge text="Not Reccomended" type="warning" />
1719
#
1820

1921
:::tip Demo Reference
@@ -157,9 +159,9 @@ export default nextConfig;
157159
"Local Webpack" means you must have webpack installed as a dependency, and next will not use its bundled copy of webpack which cannot be used as it does not export all of Webpacks internals
158160

159161
```bash title="shell"
160-
NEXT_PRIVATE_LOCAL_WEBPACK=true next dev
162+
cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev
161163
# or
162-
NEXT_PRIVATE_LOCAL_WEBPACK=true next build
164+
cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build
163165
```
164166

165167
`.env` can be set as well, but can be unreliable in setting `NEXT_PRIVATE_LOCAL_WEBPACK` in time.

apps/website-new/docs/zh/guide/framework/nextjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const DEFAULT_SHARE_SCOPE: SharedObject = {
109109

110110
"本地 Webpack" 意味着你必须将 webpack 安装为依赖项,并且 next 不会使用其捆绑的 webpack 副本,因为需要访问所有 webpack 内部
111111

112-
- 使用 `NEXT_PRIVATE_LOCAL_WEBPACK=true next dev``next build`
112+
- 使用 `cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev``next build`
113113
- `npm install webpack`
114114

115115
## 使用方法

apps/website-new/docs/zh/practice/frameworks/next/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ export default nextConfig;
157157
“本地 Webpack”意味着你必须将 webpack 作为依赖项安装,接下来将不会使用其捆绑的 webpack 副本,该副本无法使用,因为它不会导出所有 Webpack 内部结构
158158

159159
```bash title="shell"
160-
NEXT_PRIVATE_LOCAL_WEBPACK=true next dev
160+
cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev
161161
# or
162-
NEXT_PRIVATE_LOCAL_WEBPACK=true next build
162+
cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next build
163163
```
164164

165165
`.env` 也可以设置,但及时设置 `NEXT_PRIVATE_LOCAL_WEBPACK` 可能不可靠。

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"glob": "^11.0.0",
6767
"kill-port": "^2.0.1",
6868
"lodash.get": "4.4.2",
69-
"next": "14.2.15",
69+
"next": "14.2.0",
7070
"openai": "^4.63.0",
7171
"rambda": "7.5.0",
7272
"react": "18.3.1",
@@ -101,11 +101,11 @@
101101
"@nx/cypress": "20.0.0",
102102
"@nx/devkit": "20.0.0",
103103
"@nx/esbuild": "20.0.0",
104+
"@nx/eslint": "20.0.0",
104105
"@nx/eslint-plugin": "20.0.0",
105106
"@nx/express": "20.0.0",
106107
"@nx/jest": "20.0.0",
107108
"@nx/js": "20.0.3",
108-
"@nx/eslint": "20.0.0",
109109
"@nx/next": "20.0.0",
110110
"@nx/node": "20.0.0",
111111
"@nx/react": "20.0.0",

packages/nextjs-mf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ I set `process.env.NEXT_PRIVATE_LOCAL_WEBPACK = 'true'` inside this plugin, but
133133

134134
"Local Webpack" means you must have webpack installed as a dependency, and next will not use its bundled copy of webpack which cannot be used as i need access to all of webpack internals
135135

136-
- `NEXT_PRIVATE_LOCAL_WEBPACK=true next dev` or `next build`
136+
- `cross-env NEXT_PRIVATE_LOCAL_WEBPACK=true next dev` or `next build`
137137
- `npm install webpack`
138138

139139
## Usage

0 commit comments

Comments
 (0)