Skip to content

修复了三个导致项目无法编译的问题#4270

Closed
qiaozirui wants to merge 0 commit intoQuantumNous:mainfrom
qiaozirui:main
Closed

修复了三个导致项目无法编译的问题#4270
qiaozirui wants to merge 0 commit intoQuantumNous:mainfrom
qiaozirui:main

Conversation

@qiaozirui
Copy link
Copy Markdown

@qiaozirui qiaozirui commented Apr 15, 2026

⚠️ 提交说明 / PR Notice

📝 变更描述 / Description

更新@douyinfe/semi-ui的导入方法,原导入方法无法通过vite检查
在package.json中新增antd,原项目中使用此包,但未导入
更改SiLinkedin为SiLinkerd,原名称在模块中无此名称

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug

✅ 提交前检查项 / Checklist

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

Summary by CodeRabbit

  • Chores
    • Added Ant Design package dependency to the project.
    • Updated OAuth provider icon configuration.
    • Optimized UI stylesheet loading mechanism.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

Walkthrough

The 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

Cohort / File(s) Summary
Dependency Updates
web/package.json
Added Ant Design (antd) v6.3.5 to runtime dependencies.
Source File Updates
web/src/helpers/render.jsx, web/src/index.jsx
Modified OAuth provider icon mapping to use SiLinkerd instead of SiLinkedin; changed Semi UI stylesheet import from specific CSS file path to package-level import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A bunny hops with glee today,
New antd joins the project's way,
Icons swapped with careful care,
Semi styles float through the air,
Small tweaks that help the code to play! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main objective: fixing three compilation issues. It accurately reflects the changeset's purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@qiaozirui qiaozirui marked this pull request as draft April 15, 2026 15:25
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js should 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8aaec8b and efde98f.

📒 Files selected for processing (3)
  • web/package.json
  • web/src/helpers/render.jsx
  • web/src/index.jsx

Comment thread web/package.json Outdated
"@visactor/react-vchart": "~1.8.8",
"@visactor/vchart": "~1.8.8",
"@visactor/vchart-semi-theme": "~1.8.8",
"antd": "^6.3.5",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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).

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