Skip to content

Avoid util deep imports - #17

Merged
zombieJ merged 2 commits into
react-component:masterfrom
QDyanbing:avoid-deep-imports
Jun 8, 2026
Merged

Avoid util deep imports#17
zombieJ merged 2 commits into
react-component:masterfrom
QDyanbing:avoid-deep-imports

Conversation

@QDyanbing

Copy link
Copy Markdown
Contributor

变更内容

  • 升级 @rc-component/util 到当前 latest ^1.11.1
  • 升级 @rc-component/father-plugin^2.2.0,交由插件统一处理 rc 深路径 import 限制。
  • 将源码中对 @rc-component/util/lib/* 的引用改为从 @rc-component/util 根入口导入。

背景

配合 rc 包统一避免依赖其他 rc 包的 es / lib 构建产物内部路径,改为使用公开根入口 API。

验证

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

@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@QDyanbing has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 32 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d6ceb5e4-6b22-4687-9688-f3b44141ed90

📥 Commits

Reviewing files that changed from the base of the PR and between 5455ccb and abc654f.

📒 Files selected for processing (3)
  • package.json
  • src/MutateObserver.tsx
  • src/useMutateObserver.tsx
✨ 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.

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

Copy link
Copy Markdown

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 and refactors import statements in src/MutateObserver.tsx and src/useMutateObserver.tsx to reference the root package instead of specific file paths. Feedback was provided to consolidate multiple import statements from the same package into a single block for better readability.

Comment thread src/MutateObserver.tsx Outdated
@afc163

afc163 commented May 25, 2026

Copy link
Copy Markdown
Member
  1. 在 antd 里搞个 issue 来跟踪
  2. 最好 antd 这层加测试防护,而不是每个 rc 里加,容易漏。

@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.78%. Comparing base (5455ccb) to head (abc654f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #17   +/-   ##
=======================================
  Coverage   78.78%   78.78%           
=======================================
  Files           2        2           
  Lines          33       33           
  Branches       11       11           
=======================================
  Hits           26       26           
  Misses          7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@QDyanbing

Copy link
Copy Markdown
Contributor Author
  1. 在 antd 里搞个 issue 来跟踪
  2. 最好 antd 这层加测试防护,而不是每个 rc 里加,容易漏。

测试的防护已在 @rc-component/father-plugin 里面加上了;
现在主要就是在处理rc包使用了lib目录的;

@QDyanbing

Copy link
Copy Markdown
Contributor Author

Refs ant-design/ant-design#58115

antd 侧统一跟踪 rc 包 es/lib 深路径引用问题。

@zombieJ
zombieJ merged commit e2008c8 into react-component:master Jun 8, 2026
8 checks passed
@QDyanbing
QDyanbing deleted the avoid-deep-imports branch June 13, 2026 08:54
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.

3 participants