Avoid rc package deep imports#1223
Conversation
|
@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
变更总览本次 PR 将 变更详情导入路径迁移与 API 扩展
🎯 3 (中等复杂度) | ⏱️ ~20 分钟相关 PR
建议的审阅者
🚥 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 unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/BaseSelect/index.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/OptionList.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. src/Select.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1223 +/- ##
=======================================
Coverage 99.44% 99.44%
=======================================
Files 31 31
Lines 1266 1266
Branches 442 442
=======================================
Hits 1259 1259
Misses 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request updates the versions of @rc-component/util and @rc-component/virtual-list and refactors imports across the codebase to use root package paths instead of deep internal paths. It also expands the types exported from the main entry point. The reviewer recommends exporting additional common types, such as RawValueType and Mode, to better support downstream consumers and further eliminate the need for deep imports.
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 `@tests/shared/throwOptionValue.tsx`:
- Line 3: The import of resetWarned is incorrect — it is not exported from the
top-level '`@rc-component/util`'; update the import statement that currently reads
"import { resetWarned } from '`@rc-component/util`';" to import from the warning
submodule instead, e.g. "import { resetWarned } from
'`@rc-component/util/lib/warning`';" so the resetWarned symbol is resolved from
the correct module.
🪄 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: d1ee11b6-66e0-4e5b-bfb9-a7e55fc9f025
📒 Files selected for processing (23)
package.jsonsrc/BaseSelect/index.tsxsrc/OptionList.tsxsrc/Select.tsxsrc/SelectInput/Content/index.tsxsrc/SelectInput/Input.tsxsrc/SelectInput/index.tsxsrc/SelectTrigger.tsxsrc/index.tssrc/utils/keyUtil.tssrc/utils/legacyUtil.tssrc/utils/valueUtil.tssrc/utils/warningPropsUtil.tstests/Accessibility.test.tsxtests/Combobox.test.tsxtests/Multiple.test.tsxtests/OptionList.test.tsxtests/Select.test.tsxtests/Tags.test.tsxtests/shared/focusTest.tsxtests/shared/removeSelectedTest.tsxtests/shared/throwOptionValue.tsxtypings/index.d.ts
💤 Files with no reviewable changes (1)
- typings/index.d.ts
背景
避免 rc 包之间继续依赖
es/lib构建产物路径,统一改为从包根入口导入公开 API。调整内容
@rc-component/father-plugin,交由插件统一限制深路径导入。@rc-component/util与@rc-component/virtual-list,使用根入口已导出的 API。lib路径的导入替换为包根入口导入。@rc-component/select根入口类型导出,方便下游包和 antd 去除深路径导入。验证
npm run lint通过,仅存在项目已有 warning。Summary by CodeRabbit
发布说明
Chores
@rc-component/util升级至 v1.11.1,@rc-component/virtual-list升级至 v1.2.0,@rc-component/father-plugin升级至 v2.2.0Refactor
其他