v3.8.2
- fix: make published crossProject BFF client declarations resolvable in consumers in https://github.com/web-infra-dev/modern.js/pull/8797
- fix: 修复发布后的 crossProject BFF 客户端声明在消费方项目中无法解析类型的问题, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8797
v3.8.1
- chore(app-tools): bump the package version for release in https://github.com/web-infra-dev/modern.js/pull/8798
- chore(app-tools): 更新包版本以发布新版本, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8798
v3.8.0
- feat: bundle version-matched docs into
@modern-js/app-toolsand generateAGENTS.md/CLAUDE.mdpointing at them, so AI coding agents read docs matching the installed version in https://github.com/web-infra-dev/modern.js/pull/8781 - feat: agent knowledge supply — bundle version-matched English docs into the app-tools tarball (
docs/) on publish, and generateAGENTS.md/CLAUDE.mdin new projects created by@modern-js/create(skip with--no-agents-md). Existing projects can runnpx @modern-js/create --agents-md-onlyto add or idempotently refresh these files after an upgrade (managed marker block is updated in place, user content is preserved). Also fixes boolean flags swallowing the following positional argument (e.g.create --sub my-app). in https://github.com/web-infra-dev/modern.js/pull/8781 - feat: support configuring the Mock directory through
dev.mockDirin https://github.com/web-infra-dev/modern.js/pull/8780
- fix: guard language detector process access for edge runtimes in https://github.com/web-infra-dev/modern.js/pull/8751
- fix: type render route misses explicitly in https://github.com/web-infra-dev/modern.js/pull/8754
- fix(server-core): share the hono request context storage across duplicated module copies via a process-global AsyncLocalStorage, so BFF handlers no longer fail with "Can't call useContext out of server scope" when the host and plugin resolve different server-core instances in https://github.com/web-infra-dev/modern.js/pull/8776
- fix: make custom server output runnable under native ESM (pass
moduleType, resolve.tsx/.jsxentries, transform JSX) in https://github.com/web-infra-dev/modern.js/pull/8784 - fix: respect output.module for service-worker environment output in https://github.com/web-infra-dev/modern.js/pull/8752
- Export the programmatic
deployAPI and make it own the build, server plugin in https://github.com/web-infra-dev/modern.js/pull/8783 - Export
closeServerfrom the package root. Programmaticdevandstartin https://github.com/web-infra-dev/modern.js/pull/8783 - Export the programmatic
buildAPI and its options from the package root, initialize the builder whenbuildis supplied through the app-context command, and close completed non-watch builds before returning. TheonPreparedist cleanup now also recognizes the programmaticappContext.command, so programmaticdev/buildclean stale output the same way the CLI does (still honoringoutput.cleanDistPathand running beforenestedRoutes.jsonis generated). in https://github.com/web-infra-dev/modern.js/pull/8783
- feat: 随包分发与安装版本一致的文档,并生成指向它的
AGENTS.md/CLAUDE.md,让 AI 编码助手读到与所装版本匹配的文档, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8781 - feat: Agent 知识供给 —— 发布时将版本匹配的英文文档打进 app-tools tarball(
docs/),并在@modern-js/create新建项目时默认生成AGENTS.md/CLAUDE.md(--no-agents-md可跳过)。已有项目可运行npx @modern-js/create --agents-md-only在升级后补齐或幂等更新这两个文件(就地更新托管标记块,保留用户自定义内容)。同时修复布尔参数吞掉后续位置参数的问题(如create --sub my-app)。, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8781 - feat: 支持通过
dev.mockDir配置 Mock 目录, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8780
- fix: 修复语言检测器在 Edge 运行时访问 process 的问题, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8751
- fix: 明确渲染路由未命中的类型, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8754
- fix(server-core): 通过进程级 AsyncLocalStorage 让 hono 请求上下文在重复加载的模块副本间共享,宿主与插件解析到不同 server-core 实例时 BFF 不再报 "Can't call useContext out of server scope", 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8776
- fix: 修复自定义 Server 在原生 ESM 下的产物不可运行问题(透传
moduleType、支持.tsx/.jsx入口解析、编译 JSX), 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8784 - fix: 在 service-worker 环境中遵循 output.module 输出配置, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8752
- loading, and deploy hook lifecycle., 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8783
- initialization now uses the app-context command when no CLI build command is present, including occupied port selection., 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8783
- 从包根导出程序化
buildAPI 及其选项,在通过 app-context command 传入build时初始化 builder,并在返回前关闭已完成的非 watch 构建。onPrepare的 dist 清理现在也识别程序化的appContext.command,使程序化dev/build与 CLI 一样清理陈旧产物(仍遵循output.cleanDistPath,并在生成nestedRoutes.json之前执行)。, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8783
v3.7.0
- feat(builder): add
source.reactCompilerto enable React Compiler via Rspack's built-in SWC implementation in https://github.com/web-infra-dev/modern.js/pull/8763
- fix(runtime): exclude the SSR hydration runtime from CSR bundles in https://github.com/web-infra-dev/modern.js/pull/8762
- fix(runtime): exclude the RSC client runtime from web bundles when
server.rscis disabled in https://github.com/web-infra-dev/modern.js/pull/8762
- feat(builder): 新增
source.reactCompiler配置,基于 Rspack 内置 SWC 的 Rust 版 React Compiler 提供一键开启能力, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8763
v3.6.0
- feat(server): unified dev-server runtime hot reload, replacing the BFF-local hot update in https://github.com/web-infra-dev/modern.js/pull/8720
- fix: prevent path traversal in static asset middleware in https://github.com/web-infra-dev/modern.js/pull/8749
- refactor: drop React 17 support and import react-dom/client statically in the browser runtime in https://github.com/web-infra-dev/modern.js/pull/8750
- feat(server): 统一 dev-server 运行时热更新,替换 BFF 本地热更, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8720
- fix: 修复静态资源中间件的路径穿越问题, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8749
- refactor: 浏览器运行时移除 React 17 支持,并改为静态引入 react-dom/client, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8750
v2.71.1
- fix(runtime): string-mode SSR no longer drops a route's stylesheet when the same CSS is referenced by a non-stylesheet
<link>(e.g.<link rel="prefetch">) by @deepcoldy in https://github.com/web-infra-dev/modern.js/pull/8689 - fix(runtime): streaming SSR no longer skips route stylesheets when the same CSS URL already appears as a non-stylesheet
<link>such asrel="prefetch"by @yimingjfe in https://github.com/web-infra-dev/modern.js/pull/8695
LoadableCollector.emitStyleAssets(string SSR) deduped injected route stylesheets against every<link href>in the template, so a<link rel="prefetch">for the same css URL (e.g. fromperformance.prefetch) made the real<link rel="stylesheet">be skipped and the route rendered unstyled. It now reuses the sharedhasStylesheetLinkhelper (also used by streaming SSR), which only matches existing<link rel="stylesheet">tags. 由 @deepcoldy 实现, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8689- fix(runtime): 流式 SSR 不再因为同一 CSS URL 已作为
rel="prefetch"等非 stylesheet<link>出现在模板中而跳过路由样式注入 由 @yimingjfe 实现, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8695
v3.5.0
- feat(app-tools): add
modifyBuilderEnvironmentshook to transform the builder environments map before the builder is created in https://github.com/web-infra-dev/modern.js/pull/8717 - feat(builder): upgrade rsbuild version to 2.1.0 in https://github.com/web-infra-dev/modern.js/pull/8721
- fix(runtime): use the final HTML template parameters when rendering custom Document in https://github.com/web-infra-dev/modern.js/pull/8715
- chore(ai-infra): repo-level AI coding agents infrastructure (AGENTS.md / CLAUDE.md, skills docs, AI Coding Agents guide). in https://github.com/web-infra-dev/modern.js/pull/8651
- chore(builder): upgrade @rsbuild/plugin-type-check to 1.5.0 in https://github.com/web-infra-dev/modern.js/pull/8725
- Upgrade @rsbuild/core from v2.0.10 to v2.1.0. See v2.1.0 for details.
- A new additive app-tools hook
modifyBuilderEnvironmentsruns ingenerateBuilderafter the framework's static environment merge and beforecreateBuilder. It mirrorsmodifyEntrypointsas a transform-object async hook: each tapped callback receives{ environments }and may return a replacement map that chains to the next callback; tapping nothing leaves the environments byte-identical, so the change is fully backward compatible. This lets frameworks programmatically add environments (e.g. a custom browser worker environment), set per-environmentoutput/distPath/ordering, or otherwise adjust the resolved environments map instead of being limited to a config-static merge. feat(app-tools): 新增modifyBuilderEnvironmentshook,可在创建 builder 前变换 builder 环境表 新增的 app-tools hookmodifyBuilderEnvironments在generateBuilder中、框架静态环境合并之后、createBuilder之前执行。它与modifyEntrypoints一致,是 transform-object 异步 hook:每个回调收到{ environments },可返回替换后的环境表并链式传给下一个回调;不挂载任何回调时环境表字节不变,完全向后兼容。框架可借此以编程方式新增环境(如自定义浏览器 worker 环境)、设置 per-environment 的output/distPath/顺序,或调整已解析的环境表,而不再局限于静态配置合并。, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8717 - feat(builder): 更新 Rsbuild 版本到 2.1.0, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8721
- fix(runtime): 渲染自定义 Document 时使用最终的 HTML 模板参数, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8715
- No package release needed: this PR only adds repo-level files and docs content; it makes no change to any published package's runtime (
@modern-js/createhas zero net diff). Empty changeset added to satisfy the changeset bot without triggering a version bump., 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8651 - chore(builder): 升级 @rsbuild/plugin-type-check 到 1.5.0, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8725
- 升级 @rsbuild/core 从 v2.0.10 到 v2.1.0,查看 v2.1.0 了解详情。
v3.4.0
- feat(server-core): pass request and monitors context to server plugin fallback hooks in https://github.com/web-infra-dev/modern.js/pull/8678
- feat(builder): support customizing RSC server/client environment names via
server.rsc.environmentsin https://github.com/web-infra-dev/modern.js/pull/8691
- fix(plugin-i18n): keep browser backend locale paths independent from assetPrefix in https://github.com/web-infra-dev/modern.js/pull/8679
- fix(plugin-i18n): align SSR backend with detected public locales directory in https://github.com/web-infra-dev/modern.js/pull/8679
- fix(runtime): string-mode SSR no longer drops a route's stylesheet when the same CSS is referenced by a non-stylesheet
<link>(e.g.<link rel="prefetch">) in https://github.com/web-infra-dev/modern.js/pull/8699 - fix(runtime,app-tools): inject CSS of React.lazy descendants into streaming SSR shell to prevent FOUC; slim inline route manifest to only
chunkIdswhen RSC is disabled in https://github.com/web-infra-dev/modern.js/pull/8677 - fix(runtime): split streaming SSR chunk at SHELL_STREAM_END_MARK so suspense boundary content is not swallowed before shellAfter in https://github.com/web-infra-dev/modern.js/pull/8676
- feat(server-core): 为 server 插件 fallback hook 传递 request 和 monitors 上下文, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8678
server.rscnow accepts an object form{ environments?: { server?: string; client?: string } }in addition to a boolean. This forwards the existingenvironmentsoption ofrsbuild-plugin-rsc, letting frameworks that declare their own Rsbuild environments map RSC onto them instead of having the plugin create new emptyserver/clientenvironments (which otherwise fall back to the default./srcentry and fail to resolve in non-convention setups). Passingtrue/falsekeeps the previous default behavior, so the change is fully backward compatible. feat(builder): 支持通过server.rsc.environments自定义 RSC server/client 环境名server.rsc在原有 boolean 之外新增对象形式{ environments?: { server?: string; client?: string } },透传rsbuild-plugin-rsc已有的environments选项,使已声明自有 Rsbuild 环境的框架可将 RSC 映射到这些环境,而不必让插件新建空的server/client环境(否则会回落到默认入口./src而无法解析)。传true/false时行为不变,完全向后兼容。, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8691
- fix(plugin-i18n): 浏览器端 backend 加载本地语言资源时不再拼接 assetPrefix, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8679
- fix(plugin-i18n): SSR backend 跟随检测到的 public locales 目录,避免与根 locales 目录读取不一致, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8679
LoadableCollector.emitStyleAssets(string SSR) deduped injected route stylesheets against every<link href>in the template, so a<link rel="prefetch">for the same css URL (e.g. fromperformance.prefetch) made the real<link rel="stylesheet">be skipped and the route rendered unstyled. It now reuses the sharedhasStylesheetLinkhelper (also used by streaming SSR), which only matches existing<link rel="stylesheet">tags., 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8699- fix(runtime,app-tools): 流式 SSR 注入 React.lazy 子 chunk 的 CSS 到首屏 shell, 避免懒加载组件出现样式闪烁; 非 RSC 场景下 inline 路由 manifest 仅保留
chunkIds, 减少 HTML 体积, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8677 - fix(runtime): 流式 SSR 在 SHELL_STREAM_END_MARK 位置切分 chunk,避免 suspense 兑现内容被夹在 shellAfter 之前, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8676
v3.3.0
- feat: enable Rspack lazy compilation by default in CSR and stream SSR dev (string SSR / RSC / SSG stay disabled) in https://github.com/web-infra-dev/modern.js/pull/8638
- feat(builder): support TypeScript Go checks through
tools.tsCheckerin https://github.com/web-infra-dev/modern.js/pull/8673
- feat: keep stream SSR first-screen assets correct under lazy compilation by forcing route components eager feat: CSR 与 stream SSR 开发环境下默认开启 Rspack 按需编译(string SSR / RSC / SSG 仍默认关闭) feat: 通过强制路由组件 eager 编译,保证 stream SSR 在按需编译下首屏资源仍正确, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8638
- feat(builder): 通过
tools.tsChecker支持 TypeScript Go 类型检查, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8673
v3.2.2
- fix(plugin-i18n): expose i18n fields on runtime context type in https://github.com/web-infra-dev/modern.js/pull/8642
- Upgrade @rsbuild/core from v2.0.0 to v2.0.10. See v2.0.1, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9, and v2.0.10 for details.
- fix(plugin-i18n): 将 i18n 字段暴露到运行时上下文类型上, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8642