Avoid rc package deep imports#732
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (15)
总体说明将项目内 变更内容
预估代码审查工作量🎯 2 (Simple) | ⏱️ ~12 分钟 可能相关的 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)
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.
Code Review
This pull request updates the project's dependencies, specifically upgrading @rc-component/util and @rc-component/father-plugin. The main code changes involve refactoring imports across the codebase to use top-level named imports from @rc-component/util instead of deep path imports. Additionally, several test files received minor formatting and linting improvements. A review comment suggests further consolidating imports in src/InputNumber.tsx by using inline type imports for better conciseness.
| import type { InputFocusOptions } from '@rc-component/util'; | ||
| import { proxyObject, triggerFocus, useEvent, useLayoutUpdateEffect } from '@rc-component/util'; |
There was a problem hiding this comment.
可以将来自同一个包的类型导入和普通导入合并,使代码更加简洁。由于项目使用了 TypeScript 5.1,支持在命名导入中使用 type 前缀。
| import type { InputFocusOptions } from '@rc-component/util'; | |
| import { proxyObject, triggerFocus, useEvent, useLayoutUpdateEffect } from '@rc-component/util'; | |
| import { type InputFocusOptions, proxyObject, triggerFocus, useEvent, useLayoutUpdateEffect } from '@rc-component/util'; |
|
Refs ant-design/ant-design#58115 antd 侧统一跟踪 rc 包 es/lib 深路径引用问题。 |
背景
antd 侧限制继续使用 rc 包的
lib/es深路径导入,需要将 input-number 中对 rc 包内部路径的依赖迁移到包根入口。调整内容
@rc-component/father-plugin,使用插件统一拦截 rc 包lib/es深路径导入。@rc-component/util,将源码和测试中对KeyCode、raf、warning、hooks、DOM 工具等内部路径的引用改为从@rc-component/util根入口导入。click.test.tsx中原有的mini-decimalmock 方式,仅替换KeyCode导入,避免扩大测试行为改动。验证
npm run lintnpm test -- --runInBandnpm run compileSummary by CodeRabbit
发行说明
@rc-component/util至最新版本,获得更好的性能和兼容性支持@rc-component/father-plugin以支持新的构建工具链