Skip to content

chore: export util root APIs#765

Merged
zombieJ merged 3 commits into
react-component:masterfrom
QDyanbing:avoid-deep-imports
May 18, 2026
Merged

chore: export util root APIs#765
zombieJ merged 3 commits into
react-component:masterfrom
QDyanbing:avoid-deep-imports

Conversation

@QDyanbing
Copy link
Copy Markdown
Contributor

@QDyanbing QDyanbing commented May 18, 2026

Summary

  • upgrade @rc-component/father-plugin to ^2.2.0
  • export root APIs needed to avoid lib / es deep imports from rc packages and antd: resetWarned, spyElementPrototype, spyElementPrototypes, Portal, PortalWrapper
  • export supporting types Prepend and Option for existing util examples

Validation

  • npm run compile
  • npm run lint (passes with existing warnings)
  • npm test -- --runInBand
  • git diff --check

Summary by CodeRabbit

  • Chores
    • 更新开发依赖以引入构建/发布相关改进(升级构建插件版本)。
    • 扩展对外接口:新增若干类型导出、测试钩子导出并补充默认导出,提升库在使用与测试场景下的灵活性与可用性。

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2cb6307f-7cc9-4a59-9780-2d8ef6893e58

📥 Commits

Reviewing files that changed from the base of the PR and between ea65e18 and d4d3a47.

📒 Files selected for processing (1)
  • src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/index.ts

Walkthrough

更新 devDependency @rc-component/father-plugin,并在 src/index.ts 扩展导出:新增 PrependOption 类型,合并若干工具导出,增加 resetWarned、测试钩子导出,并补齐 Portal 默认导出。

Changes

库接口与依赖更新

Layer / File(s) Summary
构建工具依赖升级
package.json
@rc-component/father-plugin 版本从 ^2.0.1 升级至 ^2.2.0
barrel 导出扩展
src/index.ts
新增并调整导出:Prepend(来自 ./Dom/dynamicCSS)、Option as ToArrayOptions(来自 ./Children/toArray),将 mergePropsutils/getutils/set 归并到同一导出块;扩展 warning 导出包含 resetWarned;新增测试钩子 spyElementPrototype/spyElementPrototypes;补上 Portal 的默认导出。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • react-component/util#762: 与本 PR 都修改 src/index.ts 的 barrel 导出,涉及测试钩子 spyElementPrototype / spyElementPrototypes 的导出。
  • react-component/util#657: 与本 PR 在 src/index.ts 中扩展 warning 导出有重叠(noteOnce / resetWarned 相关)。
  • react-component/util#764: 与本 PR 在 src/index.ts 的测试钩子导出上存在直接相关/对立的更改(一方添加/另一方移除 spyElementPrototype 系列导出)。

Suggested reviewers

  • afc163
  • zombieJ

Poem

🐰 我翻箱倒柜把导出理清,
新增类型悄悄跳进队形,
Portal 站好在首行,
警告复位也来了声,
构建小步升级心欢喜。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题'chore: export util root APIs'准确总结了主要变更,即在package入口导出根级API,与src/index.ts中新增多个导出声明的主要改动相符。
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/index.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-react".

(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react@latest --save-dev

The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs+fabric@3.0.0/node_modules/@umijs/fabric/dist/eslint.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.


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/father-plugin dependency and expands the public API by exporting several new types, utilities, and components, including Portal and PortalWrapper. Feedback suggests aliasing the generic Option type to ToArrayOptions to avoid potential naming collisions and exporting PortalWrapperProps to ensure consistency with other component exports.

Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.42%. Comparing base (510af7e) to head (d4d3a47).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #765   +/-   ##
=======================================
  Coverage   86.42%   86.42%           
=======================================
  Files          39       39           
  Lines        1068     1068           
  Branches      373      388   +15     
=======================================
  Hits          923      923           
  Misses        143      143           
  Partials        2        2           

☔ 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 QDyanbing marked this pull request as ready for review May 18, 2026 07:55
Comment thread src/index.ts Outdated
QDyanbing and others added 2 commits May 18, 2026 16:14
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid generic Option name collision when importing from package root.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zombieJ zombieJ merged commit a0763c8 into react-component:master May 18, 2026
8 of 9 checks passed
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.

2 participants