@bleedingdev/modern-js-main-doc 3.5.0-ultramodern.6 → 3.5.0-ultramodern.9

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.
@@ -197,7 +197,7 @@ The generated `api.client.*` API only exists for loader-materialized `@api/index
197
197
  ## Effect cohort
198
198
 
199
199
  UltraModern-generated workspaces pin the framework-compatible Effect cohort
200
- through `pnpm-workspace.yaml` overrides. For `3.5.0-ultramodern.6`, generated
200
+ through `pnpm-workspace.yaml` overrides. For `3.5.0-ultramodern.9`, generated
201
201
  apps use:
202
202
 
203
203
  ```yaml
@@ -28,6 +28,11 @@ type BuildCacheConfig =
28
28
 
29
29
  Controls the caching behavior during the build process.
30
30
 
31
+ When persistent Rspack cache is enabled, Modern.js treats `cacheDirectory` as a
32
+ base directory and stores each Rsbuild/Rspack environment in its own child
33
+ directory, such as `client`, `server`, or `workerSSR`. This avoids concurrent
34
+ environment compilers writing to the same filesystem cache root.
35
+
31
36
  Modern.js will enable build cache by default to improve the compile speed. You can disable the build cache by setting it to `false`:
32
37
 
33
38
  ```js
@@ -78,20 +78,20 @@ mise exec -- pnpm check
78
78
  mise exec -- pnpm build
79
79
  ```
80
80
 
81
- Strict generated API migration requires `3.5.0-ultramodern.6` or newer.
81
+ Strict generated API migration requires `3.5.0-ultramodern.9` or newer.
82
82
  `3.4.0-ultramodern.20` and earlier cohorts do not include this full direct
83
83
  `api/index.ts` generator, generated `.mts` checks, strict Oxlint boundary rule
84
84
  set, Effect cohort overrides, and strict Effect migration command. Agents that
85
85
  cannot install that BleedingDev cohort yet should use the local Modern.js
86
- workspace for migration validation; otherwise pin `3.5.0-ultramodern.6` or
86
+ workspace for migration validation; otherwise pin `3.5.0-ultramodern.9` or
87
87
  newer with `--ultramodern-package-version`.
88
88
 
89
89
  Before hand-editing package aliases or generated metadata, run the framework
90
90
  migration command from the target workspace:
91
91
 
92
92
  ```bash
93
- pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.6 ultramodern \
94
- migrate-strict-effect --version 3.5.0-ultramodern.6
93
+ pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.9 ultramodern \
94
+ migrate-strict-effect --version 3.5.0-ultramodern.9
95
95
  pnpm api:check
96
96
  pnpm contract:check
97
97
  ```
@@ -189,9 +189,9 @@ instead of patching generated output by hand.
189
189
  Cloudflare D1 bindings are first-class on `deploy.worker.d1Databases`; use that
190
190
  config instead of app-local postprocessing when a generated app owns D1
191
191
  migrations. Cloudflare public output excludes server-only `api` and `shared`
192
- directories by default, and generated Modern/Rspack caches are isolated per app
193
- and build target so local `build` and `cloudflare:build` runs do not share the
194
- same Rspack cache directory.
192
+ directories by default, and generated Modern/Rspack caches are isolated per app,
193
+ build target, and Rspack environment so local `build`, `cloudflare:build`, and
194
+ multi-environment compilers do not share the same filesystem cache directory.
195
195
 
196
196
  ## Human Workflow
197
197
 
@@ -195,7 +195,7 @@ export default defineConfig({
195
195
  ## Effect 版本组
196
196
 
197
197
  UltraModern 生成的 workspace 会通过 `pnpm-workspace.yaml` overrides 锁定与框架兼容的
198
- Effect 版本组。`3.5.0-ultramodern.6` 使用:
198
+ Effect 版本组。`3.5.0-ultramodern.9` 使用:
199
199
 
200
200
  ```yaml
201
201
  minimumReleaseAgeExclude:
@@ -28,6 +28,10 @@ type BuildCacheConfig =
28
28
 
29
29
  控制 Modern.js 在构建过程中的缓存行为。
30
30
 
31
+ 启用 Rspack 持久化缓存时,Modern.js 会把 `cacheDirectory` 视为基础目录,并为每个
32
+ Rsbuild/Rspack environment 写入独立子目录,例如 `client`、`server` 或
33
+ `workerSSR`。这样可以避免并发 environment compiler 写入同一个文件系统 cache 根目录。
34
+
31
35
  在构建时,Modern.js 默认会开启构建缓存来提升二次构建的速度。如果不希望缓存,你可以将 `buildCache` 置为 `false` 将其禁用掉:
32
36
 
33
37
  ```js
@@ -71,18 +71,18 @@ mise exec -- pnpm check
71
71
  mise exec -- pnpm build
72
72
  ```
73
73
 
74
- 严格生成 API 迁移要求 `3.5.0-ultramodern.6` 或更新版本。
74
+ 严格生成 API 迁移要求 `3.5.0-ultramodern.9` 或更新版本。
75
75
  `3.4.0-ultramodern.20` 及更早 cohort 还没有这套完整的直接
76
76
  `api/index.ts` 生成器、生成的 `.mts` 检查、严格 Oxlint 边界规则、Effect 版本组
77
77
  overrides 和严格 Effect 迁移命令。还不能安装该 BleedingDev cohort 的 agent 应使用本地
78
78
  Modern.js workspace 做迁移校验;否则用 `--ultramodern-package-version` 固定
79
- `3.5.0-ultramodern.6` 或更新版本。
79
+ `3.5.0-ultramodern.9` 或更新版本。
80
80
 
81
81
  手写 package alias 或生成 metadata 之前,先在目标 workspace 运行框架迁移命令:
82
82
 
83
83
  ```bash
84
- pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.6 ultramodern \
85
- migrate-strict-effect --version 3.5.0-ultramodern.6
84
+ pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.9 ultramodern \
85
+ migrate-strict-effect --version 3.5.0-ultramodern.9
86
86
  pnpm api:check
87
87
  pnpm contract:check
88
88
  ```
@@ -161,8 +161,9 @@ Federation 冲突,都应在对应归属文件中修复,不要手写补丁覆
161
161
 
162
162
  Cloudflare D1 绑定使用一等配置 `deploy.worker.d1Databases`;生成 app 拥有 D1
163
163
  migration 时不要再用 app 本地 postprocess。Cloudflare public output 默认排除服务端
164
- `api` 和 `shared` 目录,并且生成的 Modern/Rspack cache 会按 app 与构建目标隔离,避免
165
- 本地 `build` 与 `cloudflare:build` 共享同一个 Rspack cache 目录。
164
+ `api` 和 `shared` 目录,并且生成的 Modern/Rspack cache 会按 app、构建目标和 Rspack
165
+ environment 隔离,避免本地 `build`、`cloudflare:build` 以及多 environment compiler
166
+ 共享同一个文件系统 cache 目录。
166
167
 
167
168
  ## 人类工作流
168
169
 
package/package.json CHANGED
@@ -19,14 +19,14 @@
19
19
  "modern.js",
20
20
  "ultramodern.js"
21
21
  ],
22
- "version": "3.5.0-ultramodern.6",
22
+ "version": "3.5.0-ultramodern.9",
23
23
  "publishConfig": {
24
24
  "registry": "https://registry.npmjs.org/",
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
28
  "mermaid": "^11.16.0",
29
- "@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.5.0-ultramodern.6"
29
+ "@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.5.0-ultramodern.9"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@rsbuild/plugin-sass": "2.0.0",