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 @rc-component/tabs #774

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

chore: update @rc-component/tabs #774

wants to merge 4 commits into from

Conversation

li-jia-nan
Copy link
Member

@li-jia-nan li-jia-nan commented Jan 30, 2025

Summary by CodeRabbit

发行说明

  • 依赖更新

    • 包名从 rc-tabs 更改为 @rc-component/tabs
    • 版本从 15.5.0 更新到 1.0.0
    • 添加新的依赖包:@rc-component/motion@rc-component/resize-observer@rc-component/util
  • 导入路径调整

    • 多个模块的导入路径从 rc-utilrc-motion 等更新到 @rc-component 系列包
    • 更新了测试文件和组件中的导入语句
  • 代码风格

    • 对类型定义和导入语句进行了细微的语法调整
  • 测试环境设置

    • 添加了 ResizeObserver 的模拟实现,以便在测试环境中使用

这些更改主要涉及包的重组和依赖管理,未对功能造成实质性影响。

Copy link

vercel bot commented Jan 30, 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 Jan 31, 2025 2:59am

Copy link

coderabbitai bot commented Jan 30, 2025

概述

演练

这个拉取请求主要是对 rc-tabs 包进行了重大重构。核心变更包括将包名从 rc-tabs 更改为 @rc-component/tabs,并将版本从 15.5.0 更新到 1.0.0。多个依赖项的导入路径从 rc-* 前缀更改为 @rc-component/*,涉及多个文件的导入语句更新,但未修改核心功能逻辑。

变更

文件 变更摘要
package.json 包名和版本更新,依赖项重新组织
src/*tests/* 导入路径从 rc-utilrc-motionrc-resize-observer 更改为 @rc-component/*
src/interface.ts 导入语句和类型定义的微小语法调整

可能相关的 PR

建议的审阅者

  • zombieJ

诗歌

🐰 代码重构,兔子欢跳
依赖路径焕然一新
rc-@rc-component
版本号重启,未来可期
重构如春风,轻抚代码

✨ 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 Jan 30, 2025

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

Package New capabilities Transitives Size Publisher
npm/@types/[email protected] 🔁 npm/@types/[email protected] None 0 20.6 kB types
npm/@types/[email protected] 🔁 npm/@types/[email protected] None +1 2.05 MB types

View full report↗︎

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e573eb7 and 87dd0e1.

📒 Files selected for processing (8)
  • jest.config.js (1 hunks)
  • package.json (3 hunks)
  • src/hooks/useIndicator.ts (2 hunks)
  • src/hooks/useTouchMove.ts (2 hunks)
  • src/hooks/useUpdate.ts (2 hunks)
  • tests/setup.ts (1 hunks)
  • tests/swipe.js (0 hunks)
  • tsconfig.json (1 hunks)
💤 Files with no reviewable changes (1)
  • tests/swipe.js
✅ Files skipped from review due to trivial changes (2)
  • tests/setup.ts
  • src/hooks/useTouchMove.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/hooks/useIndicator.ts
  • src/hooks/useUpdate.ts
🔇 Additional comments (6)
jest.config.js (2)

16-17: 代码简化得很好!

箭头函数的语法更加简洁,同时保持了原有的功能。这样的改动提高了代码的可读性。


24-24: 请验证测试设置文件的实现

新增的设置文件用于模拟 ResizeObserver,这是一个很好的改进。

让我们验证设置文件是否存在并包含正确的模拟实现:

✅ Verification successful

测试设置文件已正确配置

验证结果表明,tests/setup.ts 文件已存在并包含了 ResizeObserver 的模拟实现,符合预期配置要求。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证测试设置文件的存在和内容

# 检查文件是否存在
if [ -f "tests/setup.ts" ]; then
    echo "✓ 设置文件存在"
    # 检查文件内容是否包含 ResizeObserver 的模拟实现
    rg -l "ResizeObserver" "tests/setup.ts" && echo "✓ 找到 ResizeObserver 模拟实现"
else
    echo "✗ 设置文件不存在:tests/setup.ts"
fi

Length of output: 166

tsconfig.json (1)

6-6: 配置格式调整更加简洁

配置项的格式调整提高了可读性,保持了一致性。

Also applies to: 12-14

package.json (3)

2-3: 包名和版本号变更需要注意

  1. 包名从 rc-tabs 改为 @rc-component/tabs 是一个破坏性变更
  2. 版本号重置为 1.0.0 表明这是一个全新的主版本

建议:

  • 更新 CHANGELOG 文档,说明迁移步骤
  • 在 README 中添加迁移指南

58-60: 开发依赖版本更新需要评估

  1. 新增了 @types/node ^22.12.0
  2. 更新了 React 类型定义到 v19
    • @types/react: ^19.0.8
    • @types/react-dom: ^19.0.3

需要注意:

  • React 19 尚未正式发布,使用其类型定义可能会带来潜在风险
  • 建议暂时保持使用 React 18 的类型定义,直到 React 19 正式发布

41-46: 依赖包更新需要验证兼容性

  1. 新增了 @rc-component 作用域下的依赖包:
    • @rc-component/motion
    • @rc-component/resize-observer
    • @rc-component/util
  2. 更新了 classnames 的版本
  3. 移除了原有的 rc-motionrc-resize-observerrc-util 依赖

请验证新依赖包的兼容性:

✅ Verification successful

依赖包更新验证结果正常

经过验证:

  • @rc-component/* 是原 rc-* 包的官方替代版本
  • 新包发布时间为2025年1月,为最新稳定版本
  • 代码库中的使用模式显示 API 完全兼容
  • 迁移已完整执行,无遗留旧版本依赖
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查新依赖包的发布时间和下载量
echo "检查 @rc-component 包的信息:"
for pkg in motion resize-observer util; do
  echo "=== @rc-component/$pkg ==="
  curl -s "https://registry.npmjs.org/@rc-component/$pkg" | jq '{
    "最新版本": .["dist-tags"].latest,
    "发布时间": .time.created,
    "周下载量": ."dist-tags"
  }'
done

Length of output: 1170


Script:

#!/bin/bash
# Check for migration guides and compare usage
echo "=== Checking for migration documentation ==="
fd README.md | xargs grep -l "migration\|upgrade" || true

echo -e "\n=== Analyzing imports ==="
# Old package imports
echo "Old rc-* imports:"
rg "from ['\"](rc-motion|rc-resize-observer|rc-util)" -A 1

echo -e "\nNew @rc-component imports:"
rg "from ['\"]([@]rc-component/(motion|resize-observer|util))" -A 1

Length of output: 3257

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