Skip to content

v3.4.0

Latest

Choose a tag to compare

@caohuilin caohuilin released this 18 Jun 09:18
9827555

What's Changed

New Features 🎉

  • feat(server-core): pass request and monitors context to server plugin fallback hooks in #8678
  • feat(builder): support customizing RSC server/client environment names via server.rsc.environments in #8691

Bug Fixes 🐞

  • fix(plugin-i18n): keep browser backend locale paths independent from assetPrefix in #8679
  • fix(plugin-i18n): align SSR backend with detected public locales directory in #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 #8699
  • fix(runtime,app-tools): inject CSS of React.lazy descendants into streaming SSR shell to prevent FOUC; slim inline route manifest to only chunkIds when RSC is disabled in #8677
  • fix(runtime): split streaming SSR chunk at SHELL_STREAM_END_MARK so suspense boundary content is not swallowed before shellAfter in #8676

更新内容

新特性 🎉

  • feat(server-core): 为 server 插件 fallback hook 传递 request 和 monitors 上下文, 详情可查看 #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 时行为不变,完全向后兼容。, 详情可查看 #8691

Bug 修复 🐞

  • fix(plugin-i18n): 浏览器端 backend 加载本地语言资源时不再拼接 assetPrefix, 详情可查看 #8679
  • fix(plugin-i18n): SSR backend 跟随检测到的 public locales 目录,避免与根 locales 目录读取不一致, 详情可查看 #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., 详情可查看 #8699
  • fix(runtime,app-tools): 流式 SSR 注入 React.lazy 子 chunk 的 CSS 到首屏 shell, 避免懒加载组件出现样式闪烁; 非 RSC 场景下 inline 路由 manifest 仅保留 chunkIds, 减少 HTML 体积, 详情可查看 #8677
  • fix(runtime): 流式 SSR 在 SHELL_STREAM_END_MARK 位置切分 chunk,避免 suspense 兑现内容被夹在 shellAfter 之前, 详情可查看 #8676