Skip to content

v3.8.0

Latest

Choose a tag to compare

@caohuilin caohuilin released this 06 Aug 06:15

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 #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 #8781
  • feat: support configuring the Mock directory through dev.mockDir in #8780

Bug Fixes 🐞

  • fix: guard language detector process access for edge runtimes in #8751
  • fix: type render route misses explicitly in #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 #8776
  • fix: make custom server output runnable under native ESM (pass moduleType, resolve .tsx / .jsx entries, transform JSX) in #8784
  • fix: respect output.module for service-worker environment output in #8752

Other Changes ✨

  • Export the programmatic deploy API and make it own the build, server plugin in #8783
  • Export closeServer from the package root. Programmatic dev and start in #8783
  • Export the programmatic build API and its options from the package root, initialize the builder when build is supplied through the app-context command, and close completed non-watch builds before returning. The onPrepare dist cleanup now also recognizes the programmatic appContext.command, so programmatic dev/build clean stale output the same way the CLI does (still honoring output.cleanDistPath and running before nestedRoutes.json is generated). in #8783

更新内容

新特性 🎉

  • feat: 随包分发与安装版本一致的文档,并生成指向它的 AGENTS.md / CLAUDE.md,让 AI 编码助手读到与所装版本匹配的文档, 详情可查看 #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)。, 详情可查看 #8781
  • feat: 支持通过 dev.mockDir 配置 Mock 目录, 详情可查看 #8780

Bug 修复 🐞

  • fix: 修复语言检测器在 Edge 运行时访问 process 的问题, 详情可查看 #8751
  • fix: 明确渲染路由未命中的类型, 详情可查看 #8754
  • fix(server-core): 通过进程级 AsyncLocalStorage 让 hono 请求上下文在重复加载的模块副本间共享,宿主与插件解析到不同 server-core 实例时 BFF 不再报 "Can't call useContext out of server scope", 详情可查看 #8776
  • fix: 修复自定义 Server 在原生 ESM 下的产物不可运行问题(透传 moduleType、支持 .tsx / .jsx 入口解析、编译 JSX), 详情可查看 #8784
  • fix: 在 service-worker 环境中遵循 output.module 输出配置, 详情可查看 #8752

其他变更 ✨

  • loading, and deploy hook lifecycle., 详情可查看 #8783
  • initialization now uses the app-context command when no CLI build command is
    present, including occupied port selection., 详情可查看 #8783
  • 从包根导出程序化 build API 及其选项,在通过 app-context command 传入 build 时初始化 builder,并在返回前关闭已完成的非 watch 构建。onPrepare 的 dist 清理现在也识别程序化的 appContext.command,使程序化 dev/build 与 CLI 一样清理陈旧产物(仍遵循 output.cleanDistPath,并在生成 nestedRoutes.json 之前执行)。, 详情可查看 #8783