Avoid rc package deep imports#638
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 ignored due to path filters (1)
📒 Files selected for processing (16)
WalkthroughThis pull request migrates internal component library imports from deep ChangesImport Path Migration and Type Refinement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
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 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
examples/adjust-overflow.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/Cascader.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. src/OptionList/Column.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 |
There was a problem hiding this comment.
Code Review
This pull request updates several dependencies and refactors imports to use main package entry points instead of internal file paths. It also refines TypeScript type definitions and updates test selectors to match class name changes in the rendered output. Feedback was provided regarding a type cast in src/Cascader.tsx, suggesting the use of NonNullable to ensure compatibility with TypeScript's strict mode when accessing optional properties.
| const { valueCells } = info.values[0] as BaseSelectProps['displayValues'][number] & { | ||
| valueCells: SingleValueType; | ||
| }; |
There was a problem hiding this comment.
由于 BaseSelectProps 中的 displayValues 是可选属性,直接通过 [number] 访问其元素类型在严格模式下会报错。建议使用 NonNullable 来确保类型推导的准确性。
| const { valueCells } = info.values[0] as BaseSelectProps['displayValues'][number] & { | |
| valueCells: SingleValueType; | |
| }; | |
| const { valueCells } = info.values[0] as NonNullable<BaseSelectProps['displayValues']>[number] & { | |
| valueCells: SingleValueType; | |
| }; |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
背景
antd 侧需要移除对 rc 包
lib/es内部路径的依赖,统一改为通过 rc 包根入口使用公开 API。关联:ant-design/ant-design#58115
调整
@rc-component/select到~1.7.1,@rc-component/tree到~1.3.2@rc-component/select、@rc-component/tree的内部路径导入改为包根入口导入@rc-component/select新版本展示节点结构,更新相关测试断言和 snapshot验证
npm run compilenpm run lint(仅保留现有 react-hooks warning)npm test -- --runInBandSummary by CodeRabbit
发布说明
Chores
Bug Fixes