@bleedingdev/modern-js-main-doc 3.5.0-ultramodern.99 → 3.8.1-ultramodern.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/en/components/prerequisites.mdx +1 -1
- package/docs/en/configure/app/bff/effect.mdx +13 -15
- package/docs/en/configure/app/server/rsc.mdx +8 -12
- package/docs/en/guides/basic-features/render/rsc.mdx +5 -14
- package/docs/en/guides/get-started/ai-coding-agents.mdx +1 -1
- package/docs/en/guides/get-started/ultramodern.mdx +19 -7
- package/docs/en/guides/get-started/upgrade.mdx +7 -12
- package/docs/zh/components/prerequisites.mdx +1 -1
- package/docs/zh/configure/app/bff/effect.mdx +12 -14
- package/docs/zh/configure/app/server/rsc.mdx +8 -12
- package/docs/zh/guides/basic-features/render/rsc.mdx +5 -14
- package/docs/zh/guides/get-started/ai-coding-agents.mdx +1 -1
- package/docs/zh/guides/get-started/ultramodern.mdx +18 -6
- package/docs/zh/guides/get-started/upgrade.mdx +7 -12
- package/package.json +20 -5
|
@@ -54,7 +54,7 @@ would give your app a second Effect identity. Before setting
|
|
|
54
54
|
`/effect-server`, `/effect-edge` or `/effect-client`, install the exact cohort:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
pnpm add effect@4.0.0-beta.
|
|
57
|
+
pnpm add effect@4.0.0-beta.107 @effect/opentelemetry@4.0.0-beta.107
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
The pin is exact because UltraModern ships Effect as one lockstep cohort. Apps
|
|
@@ -218,27 +218,25 @@ through `pnpm-workspace.yaml` overrides. For the current UltraModern cohort,
|
|
|
218
218
|
generated apps use:
|
|
219
219
|
|
|
220
220
|
```yaml
|
|
221
|
-
minimumReleaseAgeExclude:
|
|
222
|
-
- 'effect@4.0.0-beta.102'
|
|
223
|
-
- '@effect/opentelemetry@4.0.0-beta.102'
|
|
224
|
-
|
|
225
221
|
trustPolicyExclude:
|
|
226
|
-
- 'effect@4.0.0-beta.
|
|
227
|
-
- '@effect/opentelemetry@4.0.0-beta.
|
|
222
|
+
- 'effect@4.0.0-beta.107'
|
|
223
|
+
- '@effect/opentelemetry@4.0.0-beta.107'
|
|
228
224
|
|
|
229
225
|
overrides:
|
|
230
|
-
'@effect/opentelemetry': 4.0.0-beta.
|
|
231
|
-
'@effect/vitest': 4.0.0-beta.
|
|
232
|
-
effect: 4.0.0-beta.
|
|
226
|
+
'@effect/opentelemetry': 4.0.0-beta.107
|
|
227
|
+
'@effect/vitest': 4.0.0-beta.107
|
|
228
|
+
effect: 4.0.0-beta.107
|
|
233
229
|
```
|
|
234
230
|
|
|
235
231
|
Do not add a different direct `effect` version in an app package. A mismatched
|
|
236
232
|
Effect beta can fail while building layers or HTTP middleware because runtime
|
|
237
|
-
services come from different package instances.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
233
|
+
services come from different package instances. The strict 24-hour release-age
|
|
234
|
+
gate applies to installed packages; the current cohort has no Effect age
|
|
235
|
+
exemption, and override-only `@effect/vitest` is not an installed approval
|
|
236
|
+
target. `trustPolicyExclude` is a separate policy:
|
|
237
|
+
its exact `effect` and `@effect/opentelemetry` exceptions cover their
|
|
238
|
+
trusted-publisher to provenance metadata transition and are not release-age
|
|
239
|
+
approvals.
|
|
242
240
|
|
|
243
241
|
## Contract tests
|
|
244
242
|
|
|
@@ -7,24 +7,20 @@ title: rsc
|
|
|
7
7
|
- **Type:** `boolean`
|
|
8
8
|
- **Default:** `false`
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Configure React Server Components (RSC).
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
:::warning UltraModern availability
|
|
13
|
+
RSC is not shipped or supported in the current UltraModern company distribution. Keep this option `false`. The Rspack Flight runtime remains under upstream review, and enabling RSC intentionally fails unless an application supplies the complete optional toolchain.
|
|
14
|
+
|
|
15
|
+
Do not install `react-server-dom-rspack` or add an application-level pnpm patch to bypass this boundary.
|
|
16
|
+
:::
|
|
13
17
|
|
|
14
18
|
```ts title="modern.config.ts"
|
|
15
19
|
export default defineConfig({
|
|
16
20
|
server: {
|
|
17
|
-
rsc:
|
|
21
|
+
rsc: false,
|
|
18
22
|
},
|
|
19
23
|
});
|
|
20
24
|
```
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
Before enabling RSC, ensure:
|
|
24
|
-
1. React and React DOM are upgraded to version 19 (recommended 19.2.4 or above)
|
|
25
|
-
2. Install the `react-server-dom-rspack@0.0.2` dependency
|
|
26
|
-
|
|
27
|
-
:::
|
|
28
|
-
|
|
29
|
-
For more information about using RSC, see the [React Server Components guide](/guides/basic-features/render/rsc).
|
|
30
|
-
|
|
26
|
+
The [React Server Components guide](/guides/basic-features/render/rsc) is retained as reference material for future upstream adoption.
|
|
@@ -21,29 +21,20 @@ Before starting, we recommend reading React's official [Server Components docume
|
|
|
21
21
|
|
|
22
22
|
## Quick Start
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
2. **Install the `react-server-dom-rspack@0.0.2` dependency**
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npm install react-server-dom-rspack@0.0.2
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
:::warning Notes
|
|
33
|
-
|
|
34
|
-
1. Currently, [Server Functions](https://react.dev/reference/rsc/server-functions) are not supported in SPA projects
|
|
35
|
-
2. Currently, when building with Rspack, the output chunks and bundle size are not yet optimal. We will further optimize this in the near future
|
|
24
|
+
:::warning UltraModern availability
|
|
25
|
+
RSC is not shipped or supported in the current UltraModern company distribution. The framework keeps [`server.rsc`](/configure/app/server/rsc) disabled while the Rspack Flight runtime is completed upstream. Do not install `react-server-dom-rspack` or carry an application-level pnpm patch to enable it early.
|
|
36
26
|
|
|
27
|
+
The remainder of this page is retained as reference material for future upstream adoption.
|
|
37
28
|
:::
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
Keep [`server.rsc`](/configure/app/server/rsc) set to `false`:
|
|
40
31
|
|
|
41
32
|
```ts title="modern.config.ts"
|
|
42
33
|
import { defineConfig } from '@modern-js/app-tools';
|
|
43
34
|
|
|
44
35
|
export default defineConfig({
|
|
45
36
|
server: {
|
|
46
|
-
rsc:
|
|
37
|
+
rsc: false,
|
|
47
38
|
},
|
|
48
39
|
});
|
|
49
40
|
```
|
|
@@ -18,7 +18,7 @@ AI agents use them to get APIs, config, and conventions that exactly match your
|
|
|
18
18
|
`AGENTS.md` gives AI coding agents project-level guidance — telling them to read the bundled docs before making changes and to follow Modern.js conventions. A `CLAUDE.md` is generated alongside it, reusing the same guidance for Claude Code via the `@AGENTS.md` import.
|
|
19
19
|
|
|
20
20
|
- **New projects**: `npx @modern-js/create` generates both files by default; pass `--no-agents-md` to skip them.
|
|
21
|
-
- **Existing projects**: run `npx @modern-js/create agents-md` at the project root to create or update them. Re-run it any time; your own additions are preserved.
|
|
21
|
+
- **Existing projects**: run `npx @modern-js/create --agents-md-only` at the project root to create or update them. Re-run it any time; your own additions are preserved.
|
|
22
22
|
|
|
23
23
|
Modern.js only maintains the content inside the `<!-- BEGIN:modernjs-agent-rules -->` markers in `AGENTS.md`; anything you write outside them is left untouched.
|
|
24
24
|
|
|
@@ -143,13 +143,25 @@ migration work: move code to `shared/api.ts`, `api/index.ts`, and
|
|
|
143
143
|
and `src/effect`.
|
|
144
144
|
|
|
145
145
|
Generated strict Effect workspaces pin the compatible Effect cohort with pnpm
|
|
146
|
-
overrides: `effect@4.0.0-beta.
|
|
147
|
-
and `@effect/vitest@4.0.0-beta.
|
|
148
|
-
versions that disagree with those overrides.
|
|
149
|
-
|
|
150
|
-
`@effect/
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
overrides: `effect@4.0.0-beta.107`, `@effect/opentelemetry@4.0.0-beta.107`,
|
|
147
|
+
and `@effect/vitest@4.0.0-beta.107`. Do not add app-local direct Effect
|
|
148
|
+
versions that disagree with those overrides. The strict 24-hour release-age
|
|
149
|
+
gate applies to installed packages; this cohort carries no Effect age
|
|
150
|
+
exemption, and override-only `@effect/vitest` is not an installed approval
|
|
151
|
+
target. Independently, exact `trustPolicyExclude` entries for `effect`
|
|
152
|
+
and `@effect/opentelemetry` cover their trusted-publisher to provenance
|
|
153
|
+
metadata transition; they are not release-age approvals.
|
|
154
|
+
|
|
155
|
+
### Current generated dependency baseline
|
|
156
|
+
|
|
157
|
+
| Surface | Pin |
|
|
158
|
+
| --- | --- |
|
|
159
|
+
| Effect runtime and test cohort | `effect`, `@effect/opentelemetry`, and `@effect/vitest`: `4.0.0-beta.107` |
|
|
160
|
+
| Effect compiler | `@effect/tsgo@0.36.2` |
|
|
161
|
+
| TanStack Router | `@tanstack/react-router@1.170.25`, `@tanstack/router-core@1.171.21`, `@tanstack/history@1.162.1` |
|
|
162
|
+
| Module Federation | `bridge-react`, `manifest`, `modern-js-v3`, and `rspack`: `2.8.2`; `@module-federation/node@2.7.49` |
|
|
163
|
+
| React Router | `react-router@7.18.2` |
|
|
164
|
+
| Node and package tooling | Node `26.7.0`, `@types/node@^26.2.0`, pnpm `11.21.0` |
|
|
153
165
|
|
|
154
166
|
Gradual migration means old, unmigrated Modern.js apps can keep their existing
|
|
155
167
|
runtime until they are converted. Once a surface is generated or migrated as
|
|
@@ -24,7 +24,7 @@ All Modern.js official packages are released with a **uniform version number**,
|
|
|
24
24
|
- Visit [npm](https://www.npmjs.com/package/@modern-js/app-tools) to check the latest version of `@modern-js/app-tools`
|
|
25
25
|
- Check [GitHub Releases](https://github.com/web-infra-dev/modern.js/releases)
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
<ReleaseNote />
|
|
28
28
|
|
|
29
29
|
2. **Update package.json**
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ All Modern.js official packages are released with a **uniform version number**,
|
|
|
46
46
|
|
|
47
47
|
After updating `package.json`, reinstall dependencies:
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
<PackageManagerTabs command="install" />
|
|
50
50
|
|
|
51
51
|
:::tip
|
|
52
52
|
When upgrading, you need to upgrade all packages provided by Modern.js uniformly, rather than upgrading individual dependencies. Ensure that all `@modern-js/**` packages have the same version number.
|
|
@@ -72,16 +72,11 @@ When a nested dependency of the project has a problem and Modern.js cannot be up
|
|
|
72
72
|
|
|
73
73
|
### pnpm
|
|
74
74
|
|
|
75
|
-
For projects using pnpm, add the following configuration to
|
|
75
|
+
For projects using pnpm, add the following configuration to `pnpm-workspace.yaml` in the **root directory** of the project, and then run `pnpm install` again:
|
|
76
76
|
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"overrides": {
|
|
81
|
-
"package-name": "^1.0.0"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
77
|
+
```yaml title="pnpm-workspace.yaml"
|
|
78
|
+
overrides:
|
|
79
|
+
package-name: ^1.0.0
|
|
85
80
|
```
|
|
86
81
|
|
|
87
82
|
### Yarn
|
|
@@ -109,6 +104,6 @@ For projects using Npm, add the following configuration to the `package.json` in
|
|
|
109
104
|
```
|
|
110
105
|
|
|
111
106
|
:::info
|
|
112
|
-
For Monorepo repositories,
|
|
107
|
+
For Monorepo repositories, lock dependency versions in the package-manager configuration at the project root. The override affects every package in the Monorepo.
|
|
113
108
|
|
|
114
109
|
:::
|
|
@@ -53,7 +53,7 @@ import EnableBFFCaution from "@site-docs/components/enable-bff-caution";
|
|
|
53
53
|
`/effect-client` 之前,请安装精确版本的依赖组:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
pnpm add effect@4.0.0-beta.
|
|
56
|
+
pnpm add effect@4.0.0-beta.107 @effect/opentelemetry@4.0.0-beta.107
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
采用精确版本是因为 UltraModern 以锁步依赖组的方式发布 Effect。只使用
|
|
@@ -213,25 +213,23 @@ UltraModern 生成的 workspace 会通过 `pnpm-workspace.yaml` overrides 锁定
|
|
|
213
213
|
Effect 版本组。当前 UltraModern 版本组使用:
|
|
214
214
|
|
|
215
215
|
```yaml
|
|
216
|
-
minimumReleaseAgeExclude:
|
|
217
|
-
- 'effect@4.0.0-beta.102'
|
|
218
|
-
- '@effect/opentelemetry@4.0.0-beta.102'
|
|
219
|
-
|
|
220
216
|
trustPolicyExclude:
|
|
221
|
-
- 'effect@4.0.0-beta.
|
|
222
|
-
- '@effect/opentelemetry@4.0.0-beta.
|
|
217
|
+
- 'effect@4.0.0-beta.107'
|
|
218
|
+
- '@effect/opentelemetry@4.0.0-beta.107'
|
|
223
219
|
|
|
224
220
|
overrides:
|
|
225
|
-
'@effect/opentelemetry': 4.0.0-beta.
|
|
226
|
-
'@effect/vitest': 4.0.0-beta.
|
|
227
|
-
effect: 4.0.0-beta.
|
|
221
|
+
'@effect/opentelemetry': 4.0.0-beta.107
|
|
222
|
+
'@effect/vitest': 4.0.0-beta.107
|
|
223
|
+
effect: 4.0.0-beta.107
|
|
228
224
|
```
|
|
229
225
|
|
|
230
226
|
不要在应用包里添加不同版本的直接 `effect` 依赖。Effect beta 不一致时,Layer 或 HTTP
|
|
231
|
-
middleware 构建可能因为运行时 service
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
227
|
+
middleware 构建可能因为运行时 service 来自不同包实例而失败。严格的 24 小时发布年龄
|
|
228
|
+
门禁适用于实际安装的包;当前版本组没有 Effect 年龄豁免,且仅用于 override 的
|
|
229
|
+
`@effect/vitest` 不是已安装的审批目标。
|
|
230
|
+
`trustPolicyExclude` 是另一项独立策略:其中精确的 `effect` 与
|
|
231
|
+
`@effect/opentelemetry` 例外用于处理 trusted-publisher metadata 向 provenance
|
|
232
|
+
attestation 的迁移,并不等同于 release-age 审批。
|
|
235
233
|
|
|
236
234
|
## 契约测试
|
|
237
235
|
|
|
@@ -7,24 +7,20 @@ title: rsc
|
|
|
7
7
|
- **类型:** `boolean`
|
|
8
8
|
- **默认值:** `false`
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
配置 React Server Components (RSC)。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
:::warning UltraModern 可用性
|
|
13
|
+
当前 UltraModern 公司发行版不提供也不支持 RSC。请保持该选项为 `false`。Rspack Flight 运行时仍在上游审查中;除非应用显式提供完整的可选工具链,否则启用 RSC 会按设计失败。
|
|
14
|
+
|
|
15
|
+
请勿安装 `react-server-dom-rspack`,也不要添加应用级 pnpm 补丁来绕过此边界。
|
|
16
|
+
:::
|
|
13
17
|
|
|
14
18
|
```ts title="modern.config.ts"
|
|
15
19
|
export default defineConfig({
|
|
16
20
|
server: {
|
|
17
|
-
rsc:
|
|
21
|
+
rsc: false,
|
|
18
22
|
},
|
|
19
23
|
});
|
|
20
24
|
```
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
在启用 RSC 之前,请确保:
|
|
24
|
-
1. React 和 React DOM 已升级到 19 版本(建议 19.2.4 以上版本)
|
|
25
|
-
2. 已安装 `react-server-dom-rspack@0.0.2` 依赖
|
|
26
|
-
|
|
27
|
-
:::
|
|
28
|
-
|
|
29
|
-
有关使用 RSC 的更多信息,请参阅 [React Server Components 指南](/guides/basic-features/render/rsc)。
|
|
30
|
-
|
|
26
|
+
[React Server Components 指南](/guides/basic-features/render/rsc) 仅作为未来采用上游实现时的参考资料保留。
|
|
@@ -21,29 +21,20 @@ React Server Components (RSC) 是一种新的组件类型,允许在服务端
|
|
|
21
21
|
|
|
22
22
|
## 快速开始
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
2. **安装 `react-server-dom-rspack@0.0.2` 依赖**
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npm install react-server-dom-rspack@0.0.2
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
:::warning 注意事项
|
|
33
|
-
|
|
34
|
-
1. 目前暂不支持在 SPA 项目中使用 [Server Functions](https://react.dev/reference/rsc/server-functions)
|
|
35
|
-
2. 目前在 Rspack 构建时,产物分片和体积还未达到最优状态,我们将在近期进一步优化
|
|
24
|
+
:::warning UltraModern 可用性
|
|
25
|
+
当前 UltraModern 公司发行版不提供也不支持 RSC。在 Rspack Flight 运行时完成上游工作之前,框架会保持 [`server.rsc`](/configure/app/server/rsc) 关闭。请勿安装 `react-server-dom-rspack`,也不要携带应用级 pnpm 补丁来提前启用它。
|
|
36
26
|
|
|
27
|
+
本页其余内容仅作为未来采用上游实现时的参考资料保留。
|
|
37
28
|
:::
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
请保持 [`server.rsc`](/configure/app/server/rsc) 为 `false`:
|
|
40
31
|
|
|
41
32
|
```ts title="modern.config.ts"
|
|
42
33
|
import { defineConfig } from '@modern-js/app-tools';
|
|
43
34
|
|
|
44
35
|
export default defineConfig({
|
|
45
36
|
server: {
|
|
46
|
-
rsc:
|
|
37
|
+
rsc: false,
|
|
47
38
|
},
|
|
48
39
|
});
|
|
49
40
|
```
|
|
@@ -18,7 +18,7 @@ AI Agent 由此获取与当前框架版本严格匹配的 API、配置与约定
|
|
|
18
18
|
`AGENTS.md` 是给 AI 编码助手的项目指引,告诉它在动手前先阅读随包文档、并遵循 Modern.js 的约定;同时会生成 `CLAUDE.md`,通过 `@AGENTS.md` 让 Claude Code 复用同一份指引。
|
|
19
19
|
|
|
20
20
|
- **新建项目**:`npx @modern-js/create` 默认生成这两个文件,加 `--no-agents-md` 可跳过。
|
|
21
|
-
- **已有项目**:在项目根运行 `npx @modern-js/create agents-md` 生成或更新,可随时重复运行,你添加的自定义内容会被保留。
|
|
21
|
+
- **已有项目**:在项目根运行 `npx @modern-js/create --agents-md-only` 生成或更新,可随时重复运行,你添加的自定义内容会被保留。
|
|
22
22
|
|
|
23
23
|
Modern.js 只维护 `AGENTS.md` 中 `<!-- BEGIN:modernjs-agent-rules -->` 标记内的内容,标记之外你写的内容不会被改动。
|
|
24
24
|
|
|
@@ -128,12 +128,24 @@ pnpm overrides/trust policy 和 pnpm lockfile。剩余失败就是源码迁移
|
|
|
128
128
|
`api/lambda`、`shared/effect` 和 `src/effect`。
|
|
129
129
|
|
|
130
130
|
严格 Effect 生成 workspace 会通过 pnpm overrides 固定兼容版本组:
|
|
131
|
-
`effect@4.0.0-beta.
|
|
132
|
-
`@effect/vitest@4.0.0-beta.
|
|
133
|
-
Effect
|
|
134
|
-
`@effect/
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
`effect@4.0.0-beta.107`、`@effect/opentelemetry@4.0.0-beta.107` 和
|
|
132
|
+
`@effect/vitest@4.0.0-beta.107`。不要添加与这些 overrides 冲突的 app 本地直接
|
|
133
|
+
Effect 版本。严格的 24 小时发布年龄门禁适用于实际安装的包;当前版本组不包含 Effect
|
|
134
|
+
年龄豁免,仅用于 override 的 `@effect/vitest` 也不是已安装的审批目标。
|
|
135
|
+
`trustPolicyExclude` 是独立策略,仅为 `effect` 和
|
|
136
|
+
`@effect/opentelemetry` 保留精确例外,以处理 trusted-publisher metadata 向
|
|
137
|
+
provenance attestation 的迁移;它不属于 release-age 审批。
|
|
138
|
+
|
|
139
|
+
### 当前生成依赖基线
|
|
140
|
+
|
|
141
|
+
| 范围 | 固定版本 |
|
|
142
|
+
| --- | --- |
|
|
143
|
+
| Effect runtime 与测试版本组 | `effect`、`@effect/opentelemetry`、`@effect/vitest`:`4.0.0-beta.107` |
|
|
144
|
+
| Effect compiler | `@effect/tsgo@0.36.2` |
|
|
145
|
+
| TanStack Router | `@tanstack/react-router@1.170.25`、`@tanstack/router-core@1.171.21`、`@tanstack/history@1.162.1` |
|
|
146
|
+
| Module Federation | `bridge-react`、`manifest`、`modern-js-v3`、`rspack`:`2.8.2`;`@module-federation/node@2.7.49` |
|
|
147
|
+
| React Router | `react-router@7.18.2` |
|
|
148
|
+
| Node 与包管理工具 | Node `26.7.0`、`@types/node@^26.2.0`、pnpm `11.21.0` |
|
|
137
149
|
|
|
138
150
|
渐进迁移意味着尚未迁移的旧 Modern.js app 可以保留现有 runtime,直到被转换为
|
|
139
151
|
UltraModern。一个 surface 一旦生成为或迁移为 UltraModern HTTP API,就只能使用
|
|
@@ -24,7 +24,7 @@ Modern.js 所有的官方包使用**统一版本号**进行发布,因此升级
|
|
|
24
24
|
- 访问 [npm](https://www.npmjs.com/package/@modern-js/app-tools) 查看 `@modern-js/app-tools` 的最新版本
|
|
25
25
|
- 查看 [GitHub Releases](https://github.com/web-infra-dev/modern.js/releases)
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
<ReleaseNote />
|
|
28
28
|
|
|
29
29
|
2. **更新 package.json**
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ Modern.js 所有的官方包使用**统一版本号**进行发布,因此升级
|
|
|
46
46
|
|
|
47
47
|
更新完 `package.json` 后,重新安装依赖:
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
<PackageManagerTabs command="install" />
|
|
50
50
|
|
|
51
51
|
:::tip
|
|
52
52
|
当升级时,需要对 Modern.js 官方提供的所有包做统一升级,而不是升级单个依赖。确保所有 `@modern-js/**` 包的版本号保持一致。
|
|
@@ -72,16 +72,11 @@ Modern.js 所有的官方包使用**统一版本号**进行发布,因此升级
|
|
|
72
72
|
|
|
73
73
|
### pnpm
|
|
74
74
|
|
|
75
|
-
对于使用 pnpm 的项目,请在**项目根目录**的 `
|
|
75
|
+
对于使用 pnpm 的项目,请在**项目根目录**的 `pnpm-workspace.yaml` 中添加以下配置,然后重新执行 `pnpm install`:
|
|
76
76
|
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"overrides": {
|
|
81
|
-
"package-name": "^1.0.0"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
77
|
+
```yaml title="pnpm-workspace.yaml"
|
|
78
|
+
overrides:
|
|
79
|
+
package-name: ^1.0.0
|
|
85
80
|
```
|
|
86
81
|
|
|
87
82
|
### Yarn
|
|
@@ -109,6 +104,6 @@ Modern.js 所有的官方包使用**统一版本号**进行发布,因此升级
|
|
|
109
104
|
```
|
|
110
105
|
|
|
111
106
|
:::info
|
|
112
|
-
对于 Monorepo
|
|
107
|
+
对于 Monorepo 仓库,请在项目根目录的包管理器配置中锁定依赖版本;该 override 会影响 Monorepo 中的所有 package。
|
|
113
108
|
|
|
114
109
|
:::
|
package/package.json
CHANGED
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"modern.js",
|
|
20
20
|
"ultramodern.js"
|
|
21
21
|
],
|
|
22
|
-
"version": "3.
|
|
22
|
+
"version": "3.8.1-ultramodern.2",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.
|
|
27
|
+
"@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.8.1-ultramodern.2",
|
|
28
28
|
"mermaid": "^11.16.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -34,17 +34,32 @@
|
|
|
34
34
|
"@rspress/shared": "2.0.17",
|
|
35
35
|
"@shikijs/transformers": "^4.3.1",
|
|
36
36
|
"@types/fs-extra": "11.0.4",
|
|
37
|
-
"@types/node": "^26.
|
|
37
|
+
"@types/node": "^26.2.0",
|
|
38
38
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
39
39
|
"classnames": "^2.5.1",
|
|
40
40
|
"clsx": "^2.1.1",
|
|
41
41
|
"fs-extra": "^11.3.6",
|
|
42
|
-
"react": "^19.2.
|
|
43
|
-
"react-dom": "^19.2.
|
|
42
|
+
"react": "^19.2.8",
|
|
43
|
+
"react-dom": "^19.2.8",
|
|
44
44
|
"rsbuild-plugin-open-graph": "1.1.3",
|
|
45
45
|
"ts-node": "^10.9.2",
|
|
46
46
|
"typescript": "^7.0.2"
|
|
47
47
|
},
|
|
48
|
+
"nx": {
|
|
49
|
+
"targets": {
|
|
50
|
+
"build": {
|
|
51
|
+
"inputs": [
|
|
52
|
+
"build",
|
|
53
|
+
"^build",
|
|
54
|
+
"{projectRoot}/docs/**/*",
|
|
55
|
+
"{projectRoot}/rspress.config.ts"
|
|
56
|
+
],
|
|
57
|
+
"outputs": [
|
|
58
|
+
"{projectRoot}/doc_build"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
48
63
|
"scripts": {
|
|
49
64
|
"dev": "rspress dev",
|
|
50
65
|
"dev:no_lazy": "LAZY=false rspress dev",
|