Skip to content

Remove legacy PortalWrapper#780

Open
QDyanbing wants to merge 1 commit into
react-component:masterfrom
QDyanbing:migrate-portal-wrapper
Open

Remove legacy PortalWrapper#780
QDyanbing wants to merge 1 commit into
react-component:masterfrom
QDyanbing:migrate-portal-wrapper

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

背景

PortalWrapper 是早期 portal/body scroll lock 逻辑遗留下来的辅助组件。当前 Ant Design v6 相关链路已不再运行时使用该组件,下游 @rc-component/dialog 也已在 react-component/dialog#565 中将 GetContainer 类型改为从 @rc-component/util root 导入。

改动内容

  • 移除 legacy PortalWrapper 组件及其文档示例。
  • GetContainer 类型直接保留在 src/index.ts 中导出。
  • 精简 Portal 相关测试,仅保留 Portal 本体行为覆盖。
  • 调整 Portal 中遗留注释,移除对 PortalWrapper 的引用。

验证

  • npm test -- Portal.test.tsx
  • npm run lint(仅保留既有 warning)
  • npm run compile(仅保留既有 warning)
  • npm test
  • git diff --check

Summary by CodeRabbit

发布说明

  • 重构

    • 移除了 PortalWrapper 组件及其相关功能(容器管理、滚动效果切换)。
    • 简化了 Portal 组件逻辑,更新了内部注释。
    • GetContainer 类型定义已调整。
  • 文档

    • 移除了 Portal 相关的演示文档和示例代码。
  • 测试

    • 更新了测试套件,移除了 PortalWrapper 相关的测试用例。

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@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

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

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: cadb582b-4385-4bf4-ac53-b1ce1a023fdb

📥 Commits

Reviewing files that changed from the base of the PR and between b7731c3 and 8e8b310.

📒 Files selected for processing (6)
  • docs/demo/portal.md
  • docs/examples/portal.tsx
  • src/Portal.tsx
  • src/PortalWrapper.tsx
  • src/index.ts
  • tests/Portal.test.tsx
💤 Files with no reviewable changes (3)
  • docs/demo/portal.md
  • docs/examples/portal.tsx
  • src/PortalWrapper.tsx

Walkthrough

该 PR 完整移除了 src/PortalWrapper.tsx(含 getOpenCountGetContainerPortalWrapperPropsPortalWrapper 组件),将 GetContainer 类型内联至 src/index.ts,同步删除相关测试用例和文档示例,并更新 Portal.tsx 中的注释说明。

Changes

移除 PortalWrapper 模块

Layer / File(s) Summary
移除 PortalWrapper 导出并内联 GetContainer 类型
src/PortalWrapper.tsx, src/index.ts, src/Portal.tsx
src/PortalWrapper.tsx 全部实现被移除,包括容器挂载、滚动锁定、打开计数等逻辑;src/index.tsGetContainer 由重导出改为直接内联定义为 string | HTMLElement | (() => HTMLElement)src/Portal.tsx 更新遗留注释以说明为何由 Portal 自身保留该逻辑。
移除 PortalWrapper 测试与文档示例
tests/Portal.test.tsx, docs/demo/portal.md, docs/examples/portal.tsx
删除所有 PortalWrapper 相关测试用例(含 raf mock、容器挂载、openCount、wrapperClassName 等场景)及对应的 portal 示例文档页面。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • react-component/util#729:该 PR 调整了 PortalWrappercacheOverflow 的 TypeScript 类型,与当前 PR 完整删除 PortalWrapper.tsx 存在直接代码冲突。
  • react-component/util#765:该 PR 同样涉及 src/index.tsPortal/PortalWrapper 相关 API 的导出调整,与当前 PR 修改同一导出行直接相关。

Poem

🐇 旧的传送门,轻轻关上门,
PortalWrapper 悄然谢幕离场,
GetContainer 化身一行类型,
注释更清晰,测试更轻盈,
兔子跳一跳,代码更简洁! ✨

🚥 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 PR标题清晰准确地反映了主要变更:移除了legacy PortalWrapper组件及相关代码。
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/Portal.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

src/index.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

tests/Portal.test.tsx

ESLint 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@QDyanbing QDyanbing marked this pull request as ready for review June 18, 2026 06:03

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

Copy link
Copy Markdown
Contributor

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 removes the PortalWrapper component, along with its associated demo, tests, and references. The GetContainer type, previously exported from PortalWrapper, is now defined and exported directly from src/index.ts. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.78%. Comparing base (b7731c3) to head (8e8b310).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #780      +/-   ##
==========================================
- Coverage   86.42%   85.78%   -0.64%     
==========================================
  Files          39       38       -1     
  Lines        1068      964     -104     
  Branches      388      332      -56     
==========================================
- Hits          923      827      -96     
+ Misses        143      135       -8     
  Partials        2        2              

☔ View full report in Codecov by Harness.
📢 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.

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