feat(vue2): 优化组件安装逻辑,避免重复安装#369
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough在 ChangesVue2 构建分包配置与组件安装去重
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/vue2/src/utils/install.js`:
- Around line 24-27: The deduplication logic in the installComponents function
only tracks Components without considering the Vue instance, causing the same
Components to be incorrectly skipped if installed to different Vue constructors.
Change the installed tracking mechanism from a simple Set that stores only
Components to a structure that tracks the combination of both Vue and Components
(such as using a composite key or Map). Update the check at line 26 to verify if
the specific (Vue, Components) pair has been installed, and ensure the pair is
added to the tracking structure after registration. Apply the same fix to the
similar check mentioned at line 59 to maintain consistency across all
deduplication points in the function.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 02b64977-20fb-4b20-8ccd-752f48be92ec
📒 Files selected for processing (2)
packages/vue2/source/vue.config.jspackages/vue2/src/utils/install.js
配合vue2源码依赖库拆分功能
Summary by CodeRabbit
发布说明
Bug Fixes
Performance