Skip to content
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

chore: update package dependencies #788

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

aojunhao123
Copy link
Contributor

@aojunhao123 aojunhao123 commented Feb 23, 2025

Summary by CodeRabbit

  • Chores
    • 更新了部分依赖和包版本,统一采用新版组件资源,确保内部引用的一致性。
  • Style
    • 调整了代码格式,提升了代码一致性和可维护性。

Copy link

vercel bot commented Feb 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tabs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 25, 2025 7:17am

Copy link

coderabbitai bot commented Feb 23, 2025

Walkthrough

这次提交主要更新了多个文件中的导入路径和依赖项。主要将原先从 rc-motionrc-dropdownrc-menu 导入的内容更换为 @rc-component/motion@rc-component/dropdown@rc-component/menu。同时,在 package.json 中移除了旧依赖并添加了新的包,以及升级了 @rc-component/trigger 的版本。另外,对部分类型定义的代码格式做了微调。整体变更仅涉及引用来源更新,不影响现有逻辑。

Changes

文件 变更摘要
docs/.../animated.tsx, src/TabPanelList/index.tsx, src/interface.ts 更新从 rc-motion 导入 CSSMotion 或 CSSMotionProps 至 @rc-component/motion
src/TabNavList/OperationNode.tsx, src/interface.ts 更新从 rc-dropdown/rc-menu 导入的 Dropdown/Menu 组件和类型至 @rc-component/dropdown/@rc-component/menu
package.json 移除旧依赖(rc-dropdown、rc-menu、rc-motion),添加新依赖(@rc-component/dropdown、@rc-component/menu),并升级 @rc-component/trigger^3.0.0

Possibly related PRs

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

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.

docs/examples/animated.tsx

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[email protected]_jest@29.7.0_@types[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.

src/TabNavList/OperationNode.tsx

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[email protected]_jest@29.7.0_@types[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.

src/TabPanelList/index.tsx

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[email protected]_jest@29.7.0_@types[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.

  • 1 others

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f65defc and 1bbf56f.

📒 Files selected for processing (5)
  • docs/examples/animated.tsx (1 hunks)
  • package.json (1 hunks)
  • src/TabNavList/OperationNode.tsx (1 hunks)
  • src/TabPanelList/index.tsx (1 hunks)
  • src/interface.ts (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/TabNavList/OperationNode.tsx
  • docs/examples/animated.tsx
  • src/interface.ts
🔇 Additional comments (3)
src/TabPanelList/index.tsx (1)

2-2: 导入路径更新正确

CSSMotion 的导入从 rc-motion 更新为 @rc-component/motion,与 PR 中其他文件的更改保持一致。这是一个简单的依赖路径更新,不影响组件的实际使用。

package.json (2)

44-45: 新增依赖项替换旧依赖项

添加了 @rc-component/dropdown@rc-component/menu 依赖,用于替换移除的 rc-dropdownrc-menu。这些新的依赖使用了版本 ~1.0.0,表明它们是较新的包。

建议确认这些新包的 API 与旧包保持兼容,防止出现意外的行为变化。


50-50:

❓ Verification inconclusive

依赖版本升级

@rc-component/trigger^2.0.0 更新到 ^3.0.0,这是一个主版本升级,可能包含破坏性变更。

建议检查该依赖的更新日志,确认主版本升级带来的变化是否会影响现有功能。


🌐 Web query:

@rc-component/trigger 从版本2到版本3的变更日志

💡 Result:

@rc-component/trigger 从版本 2 到 3 的主要变更集中在架构重构、性能优化和功能增强上。以下是关键变更点:

核心架构重构

  1. 替换底层对齐库
    移除对 rc-aligndom-align 的依赖,整合对齐逻辑到组件内部。新算法采用动态计算方式解决 transform 缩放导致的定位偏差问题[3][4]。

  2. 箭头定位优化
    将箭头逻辑从 rc-tooltip 迁移到 rc-trigger 内部管理,支持箭头随弹出层偏移自动调整位置。通过边界值计算实现更精准的居中或贴边定位[3]。

功能增强

  1. 滚动容器自适应
    新增自动检测目标元素所在滚动容器的能力,无需手动配置 getPopupContainer 即可实现滚动同步[3]。

  2. **事件触发优化
    支持更精细的触发行为控制:

    • 延迟显示/隐藏:通过 mouseEnterDelaymouseLeaveDelay 配置悬停延迟
    • 预渲染策略:新增 forceRender 属性避免重复渲染消耗性能[2][6]

API 变更

  1. 破坏性变更

    • PopupAlign 类型从对象结构改为字符串枚举(如 "topLeft" | "bottomRight"
    • onPopupAlign 回调参数调整为标准化坐标对象格式[4][6]
  2. 新增配置项

    <Trigger
      stretch="minWidth" // 新增弹出层宽度自适应模式
      mobile={false}    // 禁用移动端特殊处理
      action={['hover', 'click']} // 支持组合触发方式
    />

样式系统升级

  1. CSS-in-JS 重构
    使用 @ant-design/cssinjs 替代旧版样式方案,支持按需加载和主题动态切换[4]。

  2. 动画优化
    引入硬件加速动画:

    .rc-trigger-popup {
      transition: opacity 0.3s, transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
    }

兼容性调整

  • React 18:完全支持严格模式(Strict Mode)和并发渲染(Concurrent Rendering)
  • 浏览器支持:放弃对 IE11 的支持,最低要求 Chrome 64+/Firefox ESR[6]

这些变更使得 v3 版本的包体积减少约 28%,首次渲染性能提升40%以上(基于 Ant Design 基准测试)[4][6]。升级时需注意检查原有配置项命名及类型定义变化。

Citations:


依赖升级变更提醒

该更新将 @rc-component/trigger^2.0.0 升级到 ^3.0.0,是一次主版本升级,经查阅更新日志,新版本主要包括:

  • 架构重构:移除了对 rc-align/dom-align 的依赖,内部对齐逻辑重构,可能影响一些自定义对齐行为;
  • 箭头定位调整:箭头定位逻辑已内置管理,建议检查弹出层或工具提示中相关样式和定位是否符合预期;
  • API 变更:例如,PopupAlign 类型变更为字符串枚举,onPopupAlign 回调参数也有所调整,如代码中有调用这些接口,请确保做相应更新;
  • 新增功能及配置项:如 forceRenderstretchmobile 等参数的增加,可能需要关注业务中对此类参数的依赖或配置调整。

请确认项目中是否有相关依赖使用,并对照最新文档调整代码,确保不会受到破坏性变更的影响。

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

socket-security bot commented Feb 23, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@rc-component/[email protected] None 0 40.1 kB zombiej
npm/@rc-component/[email protected] environment +5 825 kB zombiej
npm/@rc-component/[email protected] 🔁 npm/@rc-component/[email protected] None +1 191 kB zombiej

🚮 Removed packages: npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

codecov bot commented Feb 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.96%. Comparing base (f65defc) to head (1bbf56f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #788   +/-   ##
=======================================
  Coverage   98.96%   98.96%           
=======================================
  Files          18       18           
  Lines         772      772           
  Branches      227      227           
=======================================
  Hits          764      764           
  Misses          8        8           

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

@zombieJ zombieJ self-assigned this Feb 25, 2025
@zombieJ zombieJ merged commit a710e47 into react-component:master Feb 25, 2025
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