-
Notifications
You must be signed in to change notification settings - Fork 201
chore: bump upstream version #655
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Walkthrough将若干依赖更新并替换测试与示例中的虚拟列表 / 表单模块导入与 mock:修改 Changes
Sequence Diagram(s)(跳过 — 更改为依赖/导入与测试 mock 的替换,未引入新的跨组件顺序交互) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 分钟
Possibly related PRs
Suggested reviewers
诗歌
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Summary of ChangesHello @yoyo837, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on maintaining the project's health by updating several core dependencies to their latest minor or patch versions. This ensures the project benefits from recent bug fixes, performance enhancements, and new features provided by these upstream packages, contributing to overall stability and compatibility. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request bumps the versions of several @rc-component dependencies. While the updates are straightforward, the pull request description is empty. It's a good practice to provide context for dependency updates, such as linking to changelogs or summarizing the changes, to help with the review process and for future reference. I've also added one suggestion to improve the consistency of version range specifiers in package.json.
| "@rc-component/select": "~1.3.0", | ||
| "@rc-component/tree": "~1.1.0", | ||
| "@rc-component/util": "^1.4.0", |
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.
There's an inconsistency in the version range specifiers used for dependencies. @rc-component/select and @rc-component/tree use ~ (tilde), which restricts updates to patch releases, while @rc-component/util uses ^ (caret), allowing minor version updates.
For consistency and to fully benefit from semantic versioning, it's recommended to use ^ for all dependencies. This ensures that you receive non-breaking feature updates and bug fixes automatically.
If pinning to specific minor versions for certain packages is intentional due to stability concerns, consider adding a comment to package.json to document the reason.
| "@rc-component/select": "~1.3.0", | |
| "@rc-component/tree": "~1.1.0", | |
| "@rc-component/util": "^1.4.0", | |
| "@rc-component/select": "^1.3.0", | |
| "@rc-component/tree": "^1.1.0", | |
| "@rc-component/util": "^1.4.0", |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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)
package.json (1)
46-48: 补充 PR 说明文档,说明版本更新的目的和破坏性变更。建议为此 PR 添加详细说明,包括:
- 更新这些版本的原因(功能改进、安全修复等)
- 是否存在破坏性变更(breaking changes)需要代码调整
- 相关的更新日志链接(CHANGELOG 或发布说明)
- 是否需要对现有代码进行迁移调整
这样可以帮助审阅者理解变更的影响范围,以及是否需要配合其他代码更改。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (1)
package.json (1)
46-48: Verify compatibility and testing for upstream dependency updates.The three @rc-component minor version bumps (@rc-component/[email protected], @rc-component/[email protected], @rc-component/[email protected]) all exist on npm. Before merging:
- Confirm CI/CD tests pass with these new versions
- Document any breaking changes or API adjustments needed (if applicable)
- Check for any peer dependency conflicts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #655 +/- ##
=======================================
Coverage 99.83% 99.83%
=======================================
Files 17 17
Lines 619 619
Branches 190 190
=======================================
Hits 618 618
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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: 2
♻️ Duplicate comments (1)
package.json (1)
46-48: 版本范围说明符的不一致性仍然存在。与之前的审查意见一致,依赖项使用了不同的版本范围说明符:
@rc-component/select和@rc-component/tree使用~(波浪号),限制为补丁版本更新@rc-component/util使用^(插入符号),允许次要版本更新建议对所有依赖项统一使用
^以保持一致性并充分利用语义化版本控制。如果为特定包固定次要版本是出于稳定性考虑,建议在package.json中添加注释说明原因。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
examples/form.tsx(1 hunks)package.json(1 hunks)tests/Select.spec.tsx(2 hunks)tests/__mocks__/@rc-component/virtual-list.js(1 hunks)tests/__mocks__/rc-virtual-list.js(0 hunks)
💤 Files with no reviewable changes (1)
- tests/mocks/rc-virtual-list.js
🔇 Additional comments (3)
tests/Select.spec.tsx (2)
12-15: LGTM!Mock 路径更新正确。将 mock 路径从
rc-virtual-list/lib/hooks/useScrollTo更新为@rc-component/virtual-list/lib/hooks/useScrollTo与 package.json 中的依赖变更保持一致。
1-1: Remove unusedactimport from @testing-library/react.The
actfunction is not used anywhere in this test file and can be safely removed.package.json (1)
54-54: All newly added package versions are available on npm registry.@rc-component/form@^1.4.0, @rc-component/virtual-list@^1.0.1, and other mentioned @rc-component packages (select, tree, util) all exist on npm and are compatible for installation.
| import React, { Component } from 'react'; | ||
| import Select from '@rc-component/select'; | ||
| import Form, { useForm, Field } from 'rc-field-form'; | ||
| import Form, { useForm, Field } from '@rc-component/form'; |
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.
🧩 Analysis chain
🌐 Web query:
@rc-component/form package npm API Form useForm Field
💡 Result:
Short summary of the @rc-component/form (rc-field-form) API — Form, Form.useForm, Field
-
Import:
import Form, { Field } from 'rc-field-form'. [1][2] -
Form (props)
- form: FormInstance (pass instance returned by Form.useForm()).
- initialValues: object.
- name: string (FormProvider name).
- preserve: boolean (preserve removed field values).
- validateMessages: templates for validator messages.
- onValuesChange(changedValues, allValues).
- onFieldsChange(changedFields, allFields).
- onFinish(values) — called on successful submit.
- onFinishFailed({ values, errorFields, outOfDate }).
- component, fields (controlled fields list), valuePropName, etc. [1][2]
-
Form.useForm / Form instance (methods)
- const [form] = Form.useForm(); pass to . [1][2]
- Common instance methods: getFieldValue(name), getFieldsValue([nameList]), setFieldsValue(values), getFieldError(name), validateFields([names]), resetFields([names]), submit(), setFields([...]) — (see type defs in repo). [1][2]
-
Field (props / usage)
- children.
- Rules support typical validation rule options (required, pattern, type, min, max, len, enum, message, validator).
- Field registers with Form and maps child input value via valuePropName (default "value"). [1][2]
References / docs:
- npm package page (@rc-component/form / rc-field-form) — API table and examples. [1]
- GitHub repository (react-component/field-form) — README and TypeScript interfaces (detailed types/methods). [2]
If you want, I can paste the most-used Form instance method signatures from the repo's TypeScript interfaces.
🌐 Web query:
@rc-component/form useForm named export import destructure
💡 Result:
Short answer: there isn’t a separate named export called useForm to destructure — call the static method on the Form default export (Form.useForm).
Examples:
-
import and call the static method:
import Form from 'rc-field-form';
const [form] = Form.useForm();
return ...;. [1][2] -
if you prefer destructuring-like syntax for methods returned from the instance:
const [form] = Form.useForm();
const { getFieldValue, setFieldsValue } = form;
// use getFieldValue / setFieldsValue in your component. [1][2]
Sources: rc-field-form docs / package README. [1][2]
🏁 Script executed:
cat examples/form.tsxRepository: react-component/tree-select
Length of output: 3905
Fix incorrect import pattern—useForm is not a named export.
The import import Form, { useForm, Field } from '@rc-component/form' will fail because useForm is a static method on Form, not a named export. Line 47 will throw a runtime error.
Change to:
import Form, { Field } from '@rc-component/form';
And update line 47 from const [form] = useForm(); to const [form] = Form.useForm();
🤖 Prompt for AI Agents
In examples/form.tsx around line 3 (and affecting line 47), the import is wrong:
useForm is not a named export from '@rc-component/form' but a static method on
Form; update the import to only bring in Form and Field (remove useForm from the
named imports) and change the form initialization on line 47 from calling
useForm() to calling Form.useForm() so the code uses the static method
correctly.
| import List from '@rc-component/virtual-list/lib/mock'; | ||
|
|
||
| export default List; |
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.
🧩 Analysis chain
🏁 Script executed:
cd /tmp && find . -name "package.json" -type f | head -5 && cat package.json 2>/dev/null | grep -A5 -B5 "@rc-component/virtual-list" || echo "Searching from repo root..."Repository: react-component/tree-select
Length of output: 120
🏁 Script executed:
git ls-files | grep -E "package\.json$"Repository: react-component/tree-select
Length of output: 83
🏁 Script executed:
cat package.json | grep -A 2 -B 2 "@rc-component/virtual-list"Repository: react-component/tree-select
Length of output: 259
🏁 Script executed:
# Search for usage of the mock in test files
rg "from.*virtual-list" tests/ --type js --type jsx --type ts --type tsxRepository: react-component/tree-select
Length of output: 98
🏁 Script executed:
rg "virtual-list" tests/ --type js --type tsRepository: react-component/tree-select
Length of output: 364
🏁 Script executed:
# Search for mock usage more broadly
rg "/@rc-component/virtual-list" . --type js --type tsRepository: react-component/tree-select
Length of output: 53
🏁 Script executed:
# Check if there are any jest config references to this mock
cat jest.config.js 2>/dev/null || cat jest.config.ts 2>/dev/null || echo "No jest config found"Repository: react-component/tree-select
Length of output: 199
🏁 Script executed:
# Search for moduleNameMapper or mock-related config
rg "moduleNameMapper|virtual-list" . --type js --type jsonRepository: react-component/tree-select
Length of output: 233
🌐 Web query:
@rc-component/virtual-list lib/mock export npm package
💡 Result:
Do you mean whether the path "@rc-component/virtual-list/lib/mock" is published/officially exported by the rc-virtual-list npm package?
Short answer: No—rc-virtual-list publishes its built files under lib/ (the package entry points are the package's main/exports), but there is no documented or supported public export named "lib/mock" in the package. Confirmed by the package repository and npm listing (see package repo and npm page). [1][2]
If you need a mock helper from that repo, either:
- look for test/mock code in the GitHub repo and copy/port it into your project, or
- open an issue/PR on the repo asking the maintainers to export a supported mock helper.
Sources:
- GitHub repository file listing for react-component/virtual-list. [1]
- rc-virtual-list package on npm. [2]
🌐 Web query:
@rc-component/virtual-list 1.0.1 package structure exports
💡 Result:
I couldn't find a package published as "@rc-component/virtual-list" at version 1.0.1. The project is published on npm as rc-virtual-list (unscoped); its package.json on npm/GitHub shows main/module entries (e.g. main: "./lib/index", module: "./es/index") and the repository is react-component/virtual-list. See npm and GitHub for the published package.json and repo: [1][2].
If you specifically need the exports/structure for a particular published tarball (e.g. a 1.0.1 release), tell me where that version is published (npm package name or a tarball/commit link) and I’ll fetch the package.json/files and list the exports precisely.
Sources:
[1] rc-virtual-list on npm — package page and versions.
[2] react-component/virtual-list repository on GitHub.
The mock import path is incorrect and will cause runtime failures.
@rc-component/virtual-list/lib/mock is not a documented or supported export from the @rc-component/virtual-list package. The package only publishes main/module entries (lib/index, es/index) without a mock export. Either:
- Check the package repository for test/mock utilities to port into this project, or
- Open an issue with @rc-component/virtual-list maintainers to export a mock helper
🤖 Prompt for AI Agents
In tests/__mocks__/@rc-component/virtual-list.js lines 1-3, the file imports
from a non-exported path '@rc-component/virtual-list/lib/mock' which will fail
at runtime; replace this with a supported approach by either (A) creating a
local mock implementation that exports the same API your tests expect (copy/port
the upstream mock utilities into this repo under tests/__mocks__ and export them
here), or (B) import from the package's published entrypoint and wrap/spy the
real module where possible (e.g., require('@rc-component/virtual-list') and
re-export only the functions/components you need). If you cannot port a mock,
open an issue with the upstream maintainers requesting a published mock export.
Ensure the new mock matches the public API used in tests and update any tests
that depend on internal implementation details.
Summary by CodeRabbit
发布说明
✏️ Tip: You can customize this high-level summary in your review settings.