Skip to content

v2.36.0

Compare
Choose a tag to compare
@caohuilin caohuilin released this 12 Oct 02:58

What's Changed

New Features 🎉

Bug Fixes 🐞

Docs update 📄

Other Changes

  • chore(builder): simplify assets rule by @9aoy in #4701
  • chore: remove legacy monorepo include and unused utils by @chenjiahan in #4752
  • chore(builder): update rspack to 0.3.5 by @9aoy in #4730
  • chore(builder): migrate monorepo-utils to rsbuild repo by @chenjiahan in #4763
  • chore(builder): use rspack.xxxPlugin instead of builtins configuration by @9aoy in #4728
  • chore(app-tools): remove afterDev hook tty judgment to ensure development and testing environments are consistent by @2heal1 in #4768
  • chore(builder): support the use of the RSPACK_PROFILE environment variable for Rspack build performance profile by @9aoy in #4772
  • chore(module-tools): bump swc-plugins 0.6.4, remove unused deps by @chenjiahan in #4709
  • refactor(plugin-module): use buildConfig.hooks to realize afresh by @10Derozan in #4651
  • chore(builder): update rspack to 0.3.6 by @9aoy in #4767
  • chore(builder): bump webpack-dev-middleware v6.1.1 and move to builder-shared by @chenjiahan in #4742
  • chore(runtime): remove unused redux-logger dependencies by @chenjiahan in #4713
  • refactor(module-tools): by @10Derozan in #4651
    • merge libuild to module tools, add buildConfig.hooks to support load, transform and renderChunk
    • support buildConfig.tsconfig, refine the scenarios for custom tsconfig, so replace dts.tsconfigPath with this.
    • disable buildConfig.transformLodash by default:
      This optimisation was introduced in version 2.22.0 to reduce code size by modularising lodash import, but it may also cause some compatibility issues, so in version 2.32.0 a new transformLodash configuration has been added to manually disable this optimisation. In this version, this optimisation is turned off by default, and lodash is not processed separately by default.
    • only use swc transform when enable transformImport, transformLodash or externalHelpers.
      swc conversion was introduced in version 2.16.0, but the implementation still has some problems, such as format cjs does not have "Annotate the CommonJS export names for ESM import in node", sourceType commonjs support is poor, etc. In this version, swc conversion is no longer used in full, and all kinds of limitations and judgements are removed, and only swc is used as a supplement to some features.
    • remove unuse dependecies and improve code quality.
    • support debug mode to print debug logs.
    • fix some css module bugs.
    • support buildConfig.jsx: preserve .
    • support glob input in js and dts generator.
    • support banner and footer.

更新内容

新特性 🎉

  • feat: 在 BFF 中支持自定义 SDK 由 @yimingjfe 实现, 详情可查看 #4746
  • feat: 使用 rslog 作为 logger 由 @chenjiahan 实现, 详情可查看 #4748
  • feat(builder): 使用 jiti 来加载配置 由 @chenjiahan 实现, 详情可查看 #4754
  • feat(module-tools): 优化 watch 模式下的日志 由 @chenjiahan 实现, 详情可查看 #4729
  • feat(builder): 优化时间日志的格式 由 @chenjiahan 实现, 详情可查看 #4702
  • feat(builder): 拆分 tslib 到 lib-polyfill.js 中 由 @chenjiahan 实现, 详情可查看 #4712

Bug 修复 🐞

  • fix(server): 使用 cjs 格式的 hmr-client 来修复 hmr 问题 由 @chenjiahan 实现, 详情可查看 #4719
  • fix: 修复 sourcemap 由 @10Derozan 实现, 详情可查看 #4765
  • fix: watch 模式下产物不更新 由 @10Derozan 实现, 详情可查看 #4771
  • fix(app-tools): 对齐 rspack 模式下的 resolve.modules 配置 由 @chenjiahan 实现, 详情可查看 #4762
  • fix(module-tools): 将 init watcher 从 onStart 钩子移动到 createCompiler 中 由 @10Derozan 实现, 详情可查看 #4733
  • fix(plugin-garfish): 只对 assetPrefix 的默认值进行覆盖 由 @chenjiahan 实现, 详情可查看 #4725
  • fix(plugin-proxy): 修复 Windows 下运行 networksetup 失败的问题 由 @chenjiahan 实现, 详情可查看 #4700
  • fix(builder): 错误匹配了包含 node_modules 的目录 由 @chenjiahan 实现, 详情可查看 #4720

文档更新 📄

  • docs: 增加 AppContext 属性的描述 由 @chenjiahan 实现, 详情可查看 #4726

其他变更

  • chore(builder): 简化 assets 规则 由 @9aoy 实现, 详情可查看 #4701

  • chore: 移除旧版的 monorepo include 逻辑和未使用的 utils 由 @chenjiahan 实现, 详情可查看 #4752

  • chore(builder): 升级 rspack 到 0.3.5 由 @9aoy 实现, 详情可查看 #4730

  • chore(builder): 迁移 monorepo-utils 到 rsbuild 仓库 由 @chenjiahan 实现, 详情可查看 #4763

  • chore(builder): 使用 rspack.xxxPlugin 代替 builtins configuration 由 @9aoy 实现, 详情可查看 #4728

  • chore(app-tools): 移除 afterDev hook tty 判断来确保开发、测试环境行为一致 由 @2heal1 实现, 详情可查看 #4768

  • chore(builder):支持使用 RSPACK_PROFILE 环境变量来进行 Rspack 构建性能分析 由 @9aoy 实现, 详情可查看 #4772

  • chore(module-tools): 升级 swc-plugins 0.6.4, 移除无用依赖 由 @chenjiahan 实现, 详情可查看 #4709

  • refactor(plugin-module): 使用 buildConfig.hooks 重新实现各插件功能 由 @10Derozan 实现, 详情可查看 #4651

  • chore(builder): 升级 rspack 到 0.3.6 由 @9aoy 实现, 详情可查看 #4767

  • chore(builder): 升级 webpack-dev-middleware v6.1.1 并移动到 builder-shared 由 @chenjiahan 实现, 详情可查看 #4742

  • chore(runtime): 移除未使用的 redux-logger 依赖 由 @chenjiahan 实现, 详情可查看 #4713

  • refactor(module-tools): 由 @10Derozan 实现, 详情可查看 #4651

    • 将 libuild 合入模块工程,添加 buildConfig.hooks,支持 load, transform 和 renderChunk 钩子。
    • 支持 buildConfig.tsconfig 配置,用来完善自定义 tsconfig 的场景,请用它来替换 dts.tsconfigPath
    • 默认禁用 buildConfig.transformLodash:
      此优化是由 2.22.0 版本引入,通过模块化 lodash 的导入从而减小代码体积,但这也可能导致一些兼容性问题,因此在 2.32.0 版本新增了 transformLodash 配置,可以手动关闭此优化。在此版本,默认关闭此优化,默认不对 lodash 作单独的处理。
    • 只有在开启 transformImport, transformLodash 或 externalHelpers 时才使用 swc 转换。
      swc 转换是在 2.16.0 版本引入,但实现仍存在一些问题,例如 format cjs 没有 “Annotate the CommonJS export names for ESM import in node”,sourceType commonjs 支持不佳等等,在此版本,不再全量使用 swc 转换,移除各种限制和判断,只使用 swc 作为部分功能的补充。
    • 移除未使用的依赖并提升代码质量。
    • 支持 debug 模式打印调试日志。
    • 修复一些 css module 问题。
    • 支持 buildConfig.jsx: preserve 选项。
    • 支持 glob 模式输入在 js 和 dts 生成器中。
    • 支持 banner 和 footer 配置。