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

Revert "chore(deps-dev): bump react from 18.3.1 to 19.0.0" #433

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

YumoImer
Copy link
Collaborator

@YumoImer YumoImer commented Dec 30, 2024

Reverts #424

Summary by CodeRabbit

  • 依赖项更新
    • 将 React 和 React DOM 的依赖版本从 ^19.0.0 降级到 ^18.3.1

Copy link
Contributor

coderabbitai bot commented Dec 30, 2024

📝 Walkthrough

变更概述

演练

此次拉取请求主要修改了 package.json 文件中的 React 依赖版本。reactreact-dom 的版本从 ^19.0.0 降级到 ^18.3.1。这表明项目需要调整其 React 库的兼容性,可能是为了解决特定的版本兼容性问题或确保与现有代码的兼容性。

变更

文件 变更摘要
package.json - react 版本从 ^19.0.0 更新到 ^18.3.1
- react-dom 版本从 ^19.0.0 更新到 ^18.3.1

可能相关的拉取请求

  • chore: Update package.json #110:更新了 package.jsonreactreact-dom 的对等依赖版本,从 >=16.9.0 变更到 >=18.0.0,与本次 PR 的版本变更直接相关。

诗歌

🐰 兔子的依赖魔法
版本回滚,代码轻舞
从十九到十八,兼容之歌
React 库中,调整悄然
技术的节奏,永不停歇 🚀


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

Walkthrough

This 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

File Summary
package.json Reverted React version from 19.0.0 back to 18.3.1.
bun.lockb Lock file updated to reflect the reversion of React version.

Copy link

github-actions bot commented Dec 30, 2024

Preview is ready

@@ -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",

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.

Copy link

codecov bot commented Dec 30, 2024

Bundle Report

Bundle size has no change ✅

Copy link
Contributor

@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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 410d225 and 7ecd4f1.

⛔ 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",
Copy link
Contributor

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

@YumoImer YumoImer merged commit 0dc25ad into main Dec 30, 2024
11 of 15 checks passed
@YumoImer YumoImer deleted the revert-424-dependabot/npm_and_yarn/react-19.0.0 branch December 30, 2024 08:49
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