web-infra-dev/modern.js
 Watch   
 Star   
 Fork   
13 days ago
modern.js

v3.8.2

What's Changed

Bug Fixes 🐞

更新内容

Bug 修复 🐞

19 days ago
modern.js

v3.8.1

What's Changed

Other Changes ✨

更新内容

其他变更 ✨

20 days ago
modern.js

v3.8.0

What's Changed

New Features 🎉

  • feat: bundle version-matched docs into @modern-js/app-tools and generate AGENTS.md / CLAUDE.md pointing 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 generate AGENTS.md / CLAUDE.md in new projects created by @modern-js/create (skip with --no-agents-md). Existing projects can run npx @modern-js/create --agents-md-only to 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.mockDir in https://github.com/web-infra-dev/modern.js/pull/8780

Bug Fixes 🐞

Other Changes ✨

更新内容

新特性 🎉

  • 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

Bug 修复 🐞

其他变更 ✨

2026-07-16 02:06:04
modern.js

v3.7.0

What's Changed

New Features 🎉

Bug Fixes 🐞

更新内容

新特性 🎉

2026-07-09 13:13:23
modern.js

v3.6.0

What's Changed

New Features 🎉

Bug Fixes 🐞

Other Changes ✨

更新内容

新特性 🎉

Bug 修复 🐞

其他变更 ✨

2026-07-02 10:00:59
modern.js

v2.71.1

What's Changed

Bug Fixes 🐞

更新内容

Bug 修复 🐞

  • 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. from performance.prefetch) made the real <link rel="stylesheet"> be skipped and the route rendered unstyled. It now reuses the shared hasStylesheetLink helper (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
2026-06-26 18:06:10
modern.js

v3.5.0

What's Changed

New Features 🎉

Bug Fixes 🐞

Other Changes ✨

Rsbuild Update 📦

  • Upgrade @rsbuild/core from v2.0.10 to v2.1.0. See v2.1.0 for details.

更新内容

新特性 🎉

  • A new additive app-tools hook modifyBuilderEnvironments runs in generateBuilder after the framework's static environment merge and before createBuilder. It mirrors modifyEntrypoints as 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-environment output/distPath/ordering, or otherwise adjust the resolved environments map instead of being limited to a config-static merge. feat(app-tools): 新增 modifyBuilderEnvironments hook,可在创建 builder 前变换 builder 环境表 新增的 app-tools hook modifyBuilderEnvironmentsgenerateBuilder 中、框架静态环境合并之后、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

Bug 修复 🐞

其他变更 ✨

Rsbuild 更新 📦

  • 升级 @rsbuild/core 从 v2.0.10 到 v2.1.0,查看 v2.1.0 了解详情。
2026-06-18 13:36:25
modern.js

v3.4.0

What's Changed

New Features 🎉

Bug Fixes 🐞

更新内容

新特性 🎉

  • feat(server-core): 为 server 插件 fallback hook 传递 request 和 monitors 上下文, 详情可查看 https://github.com/web-infra-dev/modern.js/pull/8678
  • server.rsc now accepts an object form { environments?: { server?: string; client?: string } } in addition to a boolean. This forwards the existing environments option of rsbuild-plugin-rsc, letting frameworks that declare their own Rsbuild environments map RSC onto them instead of having the plugin create new empty server/client environments (which otherwise fall back to the default ./src entry and fail to resolve in non-convention setups). Passing true/false keeps 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

Bug 修复 🐞

  • 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. from performance.prefetch) made the real <link rel="stylesheet"> be skipped and the route rendered unstyled. It now reuses the shared hasStylesheetLink helper (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
2026-06-11 02:05:39
modern.js

v3.3.0

What's Changed

New Features 🎉

更新内容

新特性 🎉

  • 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
2026-06-04 02:05:49
modern.js

v3.2.2

Summary

What's Changed

Bug Fixes 🐞

Rsbuild Update 📦

更新内容

Bug 修复 🐞

Rsbuild 更新 📦