Skip to content

Avoid util deep imports#298

Open
QDyanbing wants to merge 2 commits into
react-component:masterfrom
QDyanbing:avoid-deep-imports
Open

Avoid util deep imports#298
QDyanbing wants to merge 2 commits into
react-component:masterfrom
QDyanbing:avoid-deep-imports

Conversation

@QDyanbing
Copy link
Copy Markdown

@QDyanbing QDyanbing commented May 19, 2026

变更内容

  • 升级 @rc-component/util^1.11.1,使用已补充的根入口导出。
  • 升级 @rc-component/father-plugin^2.2.0,交由插件统一处理 rc 深路径 import 限制。
  • 将源码和测试中对 @rc-component/util/lib/* 的引用改为从 @rc-component/util 根入口导入。

验证

  • git diff --check
  • 此前批量调整中已跑通 npm run compilenpm run lintnpm test

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

变更总览

@rc-component/util 从 ^1.3.0 升级到 ^1.11.0,调整导入方式以使用新版本提供的具名导出。同时升级 @rc-component/father-plugin 到 ^2.2.0。

变更详情

rc-component/util 升级

层级 / 文件 摘要
依赖版本升级和导入方式调整
package.jsonsrc/index.tsxtests/index.test.tsx
@rc-component/util 版本升级至 ^1.11.0,@rc-component/father-plugin 升级至 ^2.2.0。src/index.tsx 中 useControlledState 改为从 @rc-component/util 进行具名导入,tests/index.test.tsx 中 KeyCode 改为从 @rc-component/util 进行具名导入。

预估代码审查工作量

🎯 1 (Trivial) | ⏱️ ~5 分钟

可能相关的 PR

  • react-component/checkbox#294:同样在 src/index.tsxtests/index.test.tsxpackage.json 中调整了从 @rc-component/util 获取的 useControlledStateKeyCode 的导入方式与依赖版本。

建议审查人

  • zombieJ

诗歌

🐰 我们在 util 中跳跃,
命名导入闪闪发光,
版本向前跨越,
依赖随我们成长!✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题 'Avoid util deep imports' 准确概括了本次变更的核心目标:避免从 @rc-component/util 的深层路径导入,改用根入口导出。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the @rc-component/util and @rc-component/father-plugin dependencies. It also refactors imports in src/index.tsx and tests/index.test.tsx to use named imports from the @rc-component/util package root instead of deep paths. I have no feedback to provide as there were no review comments.

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