Conversation
WalkthroughThe pull request adds an Ant Design (antd) dependency to the project, updates the OAuth provider icon mapping to use a different icon from react-icons, and modifies the Semi UI stylesheet import method to use the package-level entry point instead of a specific CSS file path. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/package.json (1)
13-13: Consider optimizing the Vite build configuration for antd.Since antd has been added as a runtime dependency, the Vite build configuration in
web/vite.config.jsshould be updated to include antd in the manual chunks strategy for optimal code splitting and caching, similar to how Semi UI components are currently handled.⚡ Suggested build optimization
In
web/vite.config.js, update the manual chunks configuration:output: { manualChunks: { 'react-core': ['react', 'react-dom', 'react-router-dom'], 'semi-ui': ['@douyinfe/semi-icons', '@douyinfe/semi-ui'], + 'antd': ['antd'], tools: ['axios', 'history', 'marked'],This ensures antd is cached separately and doesn't get re-downloaded when other parts of the application change.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/package.json` at line 13, The Vite build isn't currently splitting antd into its own cached chunk; update the Rollup manualChunks configuration in your vite.config.js (the build.rollupOptions.output.manualChunks handler or manualChunks object) to add a separate chunk entry for 'antd' (e.g., return 'antd' for module ids matching /[\\/]node_modules[\\/]antd[\\/]/ or add an 'antd' key grouping those ids) so antd is emitted as its own vendor chunk and can be cached independently from other vendor code like Semi UI.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/package.json`:
- Line 13: Remove the unused "antd" dependency from web/package.json and replace
any icon usage with react-icons or Semi UI equivalents: ensure the code imports
the correct react-icons symbol (e.g., use SiLinkerd or the intended react-icons
name instead of SiLinkedin) or swap to the appropriate Semi UI icon component;
verify there are no remaining imports of "antd" and update any icon import
statements where SiLinkedin was referenced to use SiLinkerd or a Semi UI icon,
and run a dependency install/build to confirm the bundle no longer includes antd
(check vitePluginSemi configuration and build chunks).
---
Nitpick comments:
In `@web/package.json`:
- Line 13: The Vite build isn't currently splitting antd into its own cached
chunk; update the Rollup manualChunks configuration in your vite.config.js (the
build.rollupOptions.output.manualChunks handler or manualChunks object) to add a
separate chunk entry for 'antd' (e.g., return 'antd' for module ids matching
/[\\/]node_modules[\\/]antd[\\/]/ or add an 'antd' key grouping those ids) so
antd is emitted as its own vendor chunk and can be cached independently from
other vendor code like Semi UI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fe71c77b-f5fa-4154-b75e-e60cdc5ad8fd
📒 Files selected for processing (3)
web/package.jsonweb/src/helpers/render.jsxweb/src/index.jsx
| "@visactor/react-vchart": "~1.8.8", | ||
| "@visactor/vchart": "~1.8.8", | ||
| "@visactor/vchart-semi-theme": "~1.8.8", | ||
| "antd": "^6.3.5", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify actual antd usage in the codebase to assess if full library is needed
echo "=== Direct antd imports ==="
rg -n --type=js --type=jsx --type=ts --type=tsx "from ['\"]antd" -C2
echo -e "\n=== antd component usage ==="
rg -n --type=js --type=jsx --type=ts --type=tsx "import.*from ['\"]antd/" -C2
echo -e "\n=== Count of antd import statements ==="
rg -c --type=js --type=jsx --type=ts --type=tsx "from ['\"]antd"Repository: QuantumNous/new-api
Length of output: 262
🏁 Script executed:
#!/bin/bash
# Better search for antd without file type restrictions
echo "=== Search for antd imports (without file type restrictions) ==="
rg -n "from ['\"]antd" web/ || echo "No matches found"
echo -e "\n=== Search for antd components (broader pattern) ==="
rg -n "antd" web/ | grep -E "(import|require)" | head -20
echo -e "\n=== Check web/package.json for antd ==="
cat web/package.json | grep -A2 -B2 "antd"
echo -e "\n=== Look for Semi UI configuration ==="
rg -n "semi" web/ -i | head -20
echo -e "\n=== Search for SiLinkedin or Linkerd icons ==="
rg -n "SiLinkedin|SiLinkerd" web/ || echo "No icon references found"Repository: QuantumNous/new-api
Length of output: 2216
antd is unused—remove it and use react-icons or Semi UI equivalents for the icon fix.
antd is listed in web/package.json (^6.3.5) but has zero imports throughout the codebase. Adding an entire unused design system library creates unnecessary bundle bloat when Semi UI is already the primary design system (as confirmed by vitePluginSemi configuration, dedicated build chunks, and Tailwind color integration).
The icon change (SiLinkedin → SiLinkerd) is from react-icons, not antd. There is no actual need for antd to fix the icon issue. Either use the appropriate react-icons alternative or find an equivalent Semi UI icon component instead.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/package.json` at line 13, Remove the unused "antd" dependency from
web/package.json and replace any icon usage with react-icons or Semi UI
equivalents: ensure the code imports the correct react-icons symbol (e.g., use
SiLinkerd or the intended react-icons name instead of SiLinkedin) or swap to the
appropriate Semi UI icon component; verify there are no remaining imports of
"antd" and update any icon import statements where SiLinkedin was referenced to
use SiLinkerd or a Semi UI icon, and run a dependency install/build to confirm
the bundle no longer includes antd (check vitePluginSemi configuration and build
chunks).
📝 变更描述 / Description
更新@douyinfe/semi-ui的导入方法,原导入方法无法通过vite检查
在package.json中新增antd,原项目中使用此包,但未导入
更改SiLinkedin为SiLinkerd,原名称在模块中无此名称
🚀 变更类型 / Type of change
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。Summary by CodeRabbit