-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: retire deprecated api #511
Conversation
Walkthrough这次变更主要移除了 Trigger 组件中已弃用的属性和函数。在 Changes
Sequence Diagram(s)sequenceDiagram
participant C as 调用者
participant GT as generateTrigger
participant P as TriggerProps
C->>GT: 传入 TriggerProps(包含 autoDestroy, popupMotion, maskMotion)
GT->>P: 读取 autoDestroy 及运动属性
GT-->>GT: 根据 autoDestroy 计算 mergedAutoDestroy
GT->>GT: 直接使用 popupMotion 和 maskMotion 处理运动逻辑
GT->>C: 返回处理后的 trigger 配置
Possibly related PRs
Suggested reviewers
Poem
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
docs/examples/body-overflow.tsxOops! 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:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs[email protected][email protected]/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. docs/examples/case.tsxOops! 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:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs[email protected][email protected]/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. docs/examples/simple.tsxOops! 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:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs[email protected][email protected]/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.
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🔇 Additional comments (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/index.tsx (1)
48-123
: 建议添加迁移指南注释建议在
TriggerProps
接口上方添加注释,说明已移除的属性以及用户应该使用的新属性,这样可以帮助用户更顺利地进行迁移。+/** + * @deprecated The following properties have been removed: + * - destroyPopupOnHide (use autoDestroy instead) + * - popupTransitionName (use popupMotion instead) + * - maskTransitionName (use maskMotion instead) + * - popupAnimation (use popupMotion instead) + * - maskAnimation (use maskMotion instead) + */ export interface TriggerProps {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/index.tsx
(3 hunks)src/util.ts
(0 hunks)tests/basic.test.jsx
(0 hunks)tests/mask.test.jsx
(1 hunks)tests/util.test.jsx
(0 hunks)
💤 Files with no reviewable changes (3)
- src/util.ts
- tests/util.test.jsx
- tests/basic.test.jsx
🔇 Additional comments (3)
tests/mask.test.jsx (1)
24-26
: 迁移到新的动画 API 实现正确!成功地将已弃用的
maskTransitionName
属性迁移到新的maskMotion
对象结构。这种改变与组件 API 的现代化方向保持一致。src/index.tsx (2)
191-191
: 简化 autoDestroy 逻辑正确!成功移除了对已弃用的
destroyPopupOnHide
属性的依赖,使用autoDestroy
作为唯一的控制选项使代码更加清晰。
683-684
: 动画属性传递更新正确!成功地将 motion 相关属性直接传递给 Popup 组件,移除了对已弃用属性的支持,使代码更加简洁。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #511 +/- ##
==========================================
- Coverage 97.75% 97.71% -0.04%
==========================================
Files 13 13
Lines 800 788 -12
Branches 235 235
==========================================
- Hits 782 770 -12
Misses 18 18 ☔ View full report in Codecov by Sentry. |
这一块我理解别的依赖的地方也需要对应做改动
Summary by CodeRabbit