portal
portal copied to clipboard
chore: use rc-component/util
Summary by CodeRabbit
发行说明
-
依赖更新
- 将包版本从
1.1.2升级到2.0.0 - 替换
rc-util依赖为@rc-component/util - 更新 React 类型定义到最新版本
- 将包版本从
-
代码改进
- 更新导入路径和模块引用
- 增强 TypeScript 类型安全性
- 重构部分函数声明方式
-
测试更新
- 更新测试用例中的模块引用
- 为引用添加更精确的类型标注
"""
概述
遍历
这个拉取请求主要涉及将依赖从 rc-util 迁移到 @rc-component/util,同时更新了项目的版本号到 2.0.0。更改包括更新导入路径、调整类型定义、添加更精确的类型注解,并对一些文件的函数声明方式进行了轻微修改。
变更
| 文件 | 变更摘要 |
|---|---|
.gitignore |
添加 pnpm-lock.yaml 到忽略文件列表 |
package.json |
- 版本升级到 2.0.0 - 添加 @rc-component/util 依赖- 移除 rc-util 依赖- 更新 React 类型定义 |
docs/examples/getContainer.tsxtests/index.test.tsx |
为 useRef 添加明确的 HTML 元素类型 |
src/Portal.tsxsrc/useDom.tsxsrc/useScrollLocker.tsxtests/webkit.test.tsx |
更新导入路径从 rc-util 到 @rc-component/util |
诗歌
🐰 依赖的兔子跳跃变换,
从旧路径到新的天堂,
类型更安全,代码更明朗,
版本跃升至二点零,
兔子微笑,一切通畅! 🚀 """
📜 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 0f7ff351c5ad4f4bffeedd20e83efbbba1ebd4ad and 3f7beb2e96e370bd44c75cc1484dce55d8939c7b.
📒 Files selected for processing (1)
package.json(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: preview
🔇 Additional comments (4)
package.json (4)
3-3: 版本号升级需要更新文档从 1.1.2 升级到 2.0.0 是一个重大版本更新,需要相应的文档支持。
57-58: 谨慎使用 React 19注意到开发依赖中更新到了 React 19 相关包,但:
- React 19 目前仍在开发中,可能存在不稳定性
- devDependencies 使用了 React 19,但实际运行依赖仍是 React 18
- 这种不一致可能导致开发和生产环境的行为差异
建议:
- 暂时保持使用稳定版本的 React 18
- 或者在文档中明确说明对 React 19 的支持状态
Also applies to: 69-70
53-55: 测试库版本更新可能需要适配测试相关依赖有较大版本更新:
- @testing-library/jest-dom: 5.16.4 -> 6.6.3
- @testing-library/react: 13.0.0 -> 16.2.0
- @types/jest: 26.0.20 -> 29.5.14
建议:
- 检查现有测试是否需要适配新版本
- 确保所有测试用例都能正常运行
- 在升级说明中提及测试库的更新要求
48-49: 验证依赖迁移的兼容性将
rc-util替换为@rc-component/util是一个重要变更,需要确保:
- 所有 API 的兼容性
- 没有遗漏任何功能迁移
- 更新相关文档说明迁移步骤
✅ Verification successful
依赖迁移验证完成,确认兼容性良好 ✅
- 所有
rc-util的引用已完全迁移至@rc-component/util- 新包提供了完全兼容的 API 实现
- 包由同一团队维护,最近更新活跃(2周前发布新版本)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # 检查 rc-util 的使用情况 echo "检查代码中是否还存在 rc-util 的引用..." rg "rc-util" echo -e "\n检查 @rc-component/util 的使用情况..." rg "@rc-component/util"Length of output: 1377
Script:
#!/bin/bash # Install package locally to examine structure npm install @rc-component/util # Check package structure echo "Package structure:" ls -R node_modules/@rc-component/util/lib/ # Check package.json echo -e "\nPackage information:" cat node_modules/@rc-component/util/package.json # Check types echo -e "\nAvailable type definitions:" find node_modules/@rc-component/util -name "*.d.ts"Length of output: 10268
Script:
#!/bin/bash # Get package details echo "Package details:" npm view @rc-component/util # Get repository info echo -e "\nRepository content:" gh repo view rc-component/util --json description,homepageUrl,url # Check specific files in repository echo -e "\nChecking specific imported paths:" curl -s https://raw.githubusercontent.com/react-component/util/master/src/hooks/useLayoutEffect.ts echo -e "\n---\n" curl -s https://raw.githubusercontent.com/react-component/util/master/src/Dom/canUseDom.tsLength of output: 2435
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?
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR. (Beta)@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
🎊 PR Preview 3f7beb2e96e370bd44c75cc1484dce55d8939c7b has been successfully built and deployed to https://react-component-portal-preview-pr-23.surge.sh
🕐 Build time: 95.258s
🤖 By surge-preview
New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/@rc-component/[email protected] | environment | +1 |
202 kB | zombiej |
| npm/@testing-library/[email protected] 🔁 npm/@testing-library/[email protected] | None | +12 |
2.44 MB | testing-library-bot |
| npm/@testing-library/[email protected] 🔁 npm/@testing-library/[email protected] | Transitive: eval | +18 |
3.68 MB | brrianalexis, cmckinstry, dfcook, ...13 more |
| npm/@types/[email protected] 🔁 npm/@types/[email protected] | Transitive: environment | +6 |
772 kB | types |
| 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 |
🚮 Removed packages: npm/[email protected]
