-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Revert "chore(deps-dev): bump react from 18.3.1 to 19.0.0" #433
Revert "chore(deps-dev): bump react from 18.3.1 to 19.0.0" #433
Conversation
This reverts commit 410d225.
📝 Walkthrough变更概述演练此次拉取请求主要修改了 变更
可能相关的拉取请求
诗歌
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 (
|
WalkthroughThis pull request reverts a previous change that updated the React dependency from version 18.3.1 to 19.0.0. The reversion is likely due to compatibility or stability issues with the newer React version. Changes
|
@@ -225,7 +225,7 @@ | |||
"rc-footer": "^0.6.8", | |||
"rc-resize-observer": "^1.4.0", | |||
"rc-virtual-list": "^3.14.5", | |||
"react": "^19.0.0", | |||
"react": "^18.3.1", |
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.
Reverting the React version from 19.0.0 to 18.3.1 may be necessary due to compatibility issues with other dependencies or stability concerns. Ensure that all dependent packages are compatible with React 18.3.1.
Bundle ReportBundle size has no change ✅ |
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockb
is excluded by!**/bun.lockb
📒 Files selected for processing (1)
package.json
(1 hunks)
🔇 Additional comments (2)
package.json (2)
228-228
: 确认版本回退变更
React 和 React DOM 的版本已正确回退至 18.3.1,这与 PR 的目标一致。版本号保持同步,符合最佳实践。
Also applies to: 230-230
228-228
: 确认 peerDependencies 配置
当前的 peerDependencies 配置("react": ">=18.0.0"
)与回退后的版本兼容,无需调整。
Also applies to: 230-230, 385-389
@@ -225,7 +225,7 @@ | |||
"rc-footer": "^0.6.8", | |||
"rc-resize-observer": "^1.4.0", | |||
"rc-virtual-list": "^3.14.5", | |||
"react": "^19.0.0", | |||
"react": "^18.3.1", |
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.
🛠️ Refactor suggestion
建议更新相关的类型定义
注意到 @types/react
和 @types/react-dom
仍然保持在 19.0.2 版本。建议同步更新这些类型定义以匹配回退后的 React 版本。
- "@types/react": "^19.0.2",
+ "@types/react": "^18.2.0",
- "@types/react-dom": "^19.0.2",
+ "@types/react-dom": "^18.2.0",
Also applies to: 230-230, 108-108
💡 Codebase verification
注意 React 版本不匹配问题
经过验证,发现以下问题:
package.json
中声明的 React 版本是 18.3.1,但在构建站点时使用的是 18.3.0-canary 预发布版本- 项目中使用的 React API(如
useId
、自定义的useSyncState
)都是稳定的 API,没有使用实验性的新特性 - 不同版本的 React 混用可能会导致不可预知的问题
建议:
- 统一使用稳定版本 18.3.1,移除
scripts.site
中对预发布版本的临时安装 - 或者将
package.json
中的版本改为与构建脚本一致的 18.3.0-canary 版本
🔗 Analysis chain
验证开发环境的兼容性
注意到 scripts.site
命令中使用了 React 18.3.0 的预发布版本。建议确认这个预发布版本是否与回退后的 18.3.1 版本兼容。
Also applies to: 230-230, 74-74
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查项目中是否存在使用了 React 19 特性的代码
rg -l "use(Sync|Transition|Deferred|Id|Optimistic)"
Length of output: 204
Script:
#!/bin/bash
# 检查具体的 React Hook 使用情况
rg "use(Sync|Transition|Deferred|Id|Optimistic)" -A 2
# 检查 package.json 中的相关配置
cat package.json | jq '.scripts.site'
Length of output: 2993
Reverts #424
Summary by CodeRabbit
^19.0.0
降级到^18.3.1