Skip to content

perf(web): optimize web Rsbuild and Tailwind build pipeline#5786

Open
QuentinHsu wants to merge 2 commits into
mainfrom
perf/web-rsbuild-tailwind
Open

perf(web): optimize web Rsbuild and Tailwind build pipeline#5786
QuentinHsu wants to merge 2 commits into
mainfrom
perf/web-rsbuild-tailwind

Conversation

@QuentinHsu

@QuentinHsu QuentinHsu commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

概述

  • 将 web 前端共享依赖版本集中到 workspace catalog。
  • 升级 Rsbuild 到 2.1 系列,并迁移 default 前端 Tailwind CSS 编译链路。

改动说明

  • default 和 classic 前端复用 catalog 中的 React、Rsbuild 和相关共享依赖版本。
  • default 前端移除 @tailwindcss/postcss 和 PostCSS 配置。
  • default 前端接入 @rsbuild/plugin-tailwindcss,由 Rsbuild 直接执行 Tailwind CSS 编译。
  • 关闭 Tailwind optimize 与 Rsbuild buildCache,降低构建峰值内存压力。

效果

  • Tailwind 编译不再额外经过 PostCSS 管线。
  • 前端依赖版本管理更集中,减少 default 与 classic 之间的版本漂移。
  • buildCache 关闭会牺牲重复构建缓存收益,但换取更低的构建内存压力。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • Chores
    • Updated the web app’s shared dependency versions to use centralized catalog resolution.
    • Adjusted the default web app’s build setup to align with the latest React and Rsbuild package versions.
    • Removed an extra styling-related configuration from the default web app setup.
    • Disabled build caching in one app configuration and added Tailwind support to the build pipeline.

- move shared Rsbuild and React versions into the web workspace catalog.
- reference the catalog from default and classic packages so both frontends stay aligned.
- upgrade Rsbuild packages to 2.1 and share plugin versions through the web workspace catalog.
- replace the Tailwind PostCSS pipeline with the Rsbuild Tailwind plugin to avoid an extra compilation step.
- disable Tailwind optimization and Rsbuild build cache to lower peak memory during frontend builds.
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 21a8491a-f1af-4545-bd5f-f89e190e5ea6

📥 Commits

Reviewing files that changed from the base of the PR and between 3a506f5 and 117e226.

⛔ Files ignored due to path filters (1)
  • web/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • web/classic/package.json
  • web/default/package.json
  • web/default/postcss.config.mjs
  • web/default/rsbuild.config.ts
  • web/package.json
💤 Files with no reviewable changes (1)
  • web/default/postcss.config.mjs

Walkthrough

Dependency versions for react, react-dom, and Rsbuild packages are centralized into the workspace catalog in web/package.json. Both web/classic and web/default are updated to reference catalog: specifiers. In web/default, Tailwind CSS integration moves from PostCSS (postcss.config.mjs removed, @tailwindcss/postcss dependency dropped) to the Rsbuild pluginTailwindcss. Build cache is disabled in rsbuild.config.ts.

Changes

Catalog wiring and Tailwind plugin migration

Layer / File(s) Summary
Workspace catalog definitions
web/package.json
Adds @rsbuild/core, @rsbuild/plugin-react, @rsbuild/plugin-tailwindcss, react, and react-dom entries to the catalog section.
Switch packages to catalog specifiers
web/classic/package.json, web/default/package.json
Replaces pinned semver strings with catalog: for React and Rsbuild deps in both packages; removes @tailwindcss/postcss from web/default dependencies.
Rsbuild Tailwind plugin, PostCSS removal
web/default/rsbuild.config.ts, web/default/postcss.config.mjs
Deletes postcss.config.mjs, imports and registers pluginTailwindcss({ optimize: false }) in Rsbuild config, and sets buildCache: false.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • QuantumNous/new-api#5227: Directly related — also centralizes frontend dependency versions into the workspace catalog: pattern across web/*/package.json and web/package.json.

Poem

🐇 A catalog blooms where versions once sprawled,
Tailwind now lives where the Rsbuild is called.
PostCSS config hops off into the night,
One tidy workspace, dependencies right.
This bunny approves — the build gleams bright! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main focus on optimizing the web Rsbuild and Tailwind build pipeline.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/web-rsbuild-tailwind

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant