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

feat: upgrade opensumi to 3.4.3 #198

Merged
merged 3 commits into from
Oct 15, 2024
Merged

feat: upgrade opensumi to 3.4.3 #198

merged 3 commits into from
Oct 15, 2024

Conversation

bytemain
Copy link
Member

@bytemain bytemain commented Oct 12, 2024

Types

  • 🎉 New Features

Background or solution

ChangeLog

Summary by CodeRabbit

  • 新功能
    • 更新了多个依赖项的版本,以提高性能和稳定性。
  • 修复问题
    • 更新了 worker-host 文件名,确保正确加载资源。
    • 更新了 webview 相关的脚本和 HTML 文件,提升用户体验。
  • 文档
    • 更新了版本信息,确保用户获取到最新的版本信息。

Copy link

coderabbitai bot commented Oct 12, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

本次拉取请求对多个 package.json 文件进行了更新,主要涉及 @codeblitzjs/core@codeblitzjs/ide-cli@codeblitzjs/ide-core@codeblitzjs/ide-sumi-core 包的 dependenciesengines 部分。所有相关包的 opensumi 依赖版本均从 3.3.3 更新至 3.4.4-next-1728882643.0,同时 @codeblitzjs/ide-core@codeblitzjs/ide-sumi-core 包中的多个依赖也进行了类似的版本更新。此外,packages/sumi-core/resources/manifest.jsonpackages/toolkit/define.json 文件中的相关属性也进行了更新。

Changes

文件路径 变更摘要
package.json, packages/cli/package.json, packages/core/package.json, packages/sumi-core/package.json 更新 opensumi 及相关依赖版本从 3.3.33.4.4-next-1728882643.0
packages/sumi-core/resources/manifest.json, packages/toolkit/define.json 更新 worker-host 文件名及 __OPENSUMI_VERSION____WORKER_HOST____WEBVIEW_ENDPOINT____WEBVIEW_SCRIPT__ 属性值。
packages/sumi-core/resources/webview.25aac54e/index.html, packages/sumi-core/resources/webview.9ae5c833.js, packages/sumi-core/resources/webview.66e57793.js 更新 webview 相关文件的引用及实现,移除旧的 webview 文件并添加新的实现。

Possibly related PRs

Suggested reviewers

  • Ricbet

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 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.

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

@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

🧹 Outside diff range and nitpick comments (1)
packages/sumi-core/package.json (1)

Line range hint 2-2: 考虑更新包的版本号

当依赖项有重大更新时,通常也需要更新包自身的版本号。建议考虑是否需要增加 @codeblitzjs/ide-sumi-core 包的版本号。

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bf78c2e and c00f41d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (6)
  • package.json (1 hunks)
  • packages/cli/package.json (1 hunks)
  • packages/core/package.json (1 hunks)
  • packages/sumi-core/package.json (1 hunks)
  • packages/sumi-core/resources/manifest.json (1 hunks)
  • packages/toolkit/define.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/sumi-core/resources/manifest.json
  • packages/toolkit/define.json
🧰 Additional context used
🔇 Additional comments (4)
packages/cli/package.json (1)

13-13: 版本更新看起来正确且一致

这些更改符合将 opensumi 升级到 3.4.3 版本的 PR 目标。版本更新看起来是正确的,并且在 engines 和 dependencies 部分保持一致。

为确保整个项目中的版本更新保持一致,建议运行以下脚本:

您需要检查脚本输出,确保所有相关文件都已更新到正确的版本。如果发现任何不一致,请进行相应的更新。

需要我为您运行这个脚本吗?

Also applies to: 19-19

✅ Verification successful

版本更新已成功验证

所有相关的 package.json 文件中的 opensumi 版本均已更新至 3.4.3,且未发现旧版本 3.3.3

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证所有 package.json 文件中 opensumi 相关版本是否已更新至 3.4.3

# 测试:搜索所有 package.json 文件中的 opensumi 版本。预期:只有 3.4.3 版本。
fd -e json -x rg --json '"opensumi":\s*"3\.4\.3"' {} | jq -r '.data.path.text + ":" + (.data.lines.text | tostring)'

# 测试:搜索所有 package.json 文件中的旧版本。预期:没有结果。
fd -e json -x rg --json '"opensumi":\s*"3\.3\.3"' {} | jq -r '.data.path.text + ":" + (.data.lines.text | tostring)'

Length of output: 861

packages/sumi-core/package.json (2)

18-25: 依赖项更新正确

这些更改正确地将 @opensumi 相关的依赖项从 3.3.3 版本更新到了 3.4.3 版本,符合 PR 的目标。保持所有 @opensumi 依赖项版本一致是个好做法。


Line range hint 13-38: 验证其他依赖项是否需要更新

我们已经更新了所有 @opensumi 相关的依赖项。建议检查其他依赖项是否也需要更新,以确保与新版本的 @opensumi 包兼容。

请运行以下脚本来检查其他依赖项的最新版本:

packages/core/package.json (1)

36-77: 依赖项更新看起来很好

所有的 @opensumi 依赖项都已经从 3.3.3 版本更新到了 3.4.3 版本。这个更新与 PR 的目标一致,即升级 opensumi 到 3.4.3 版本。

为了确保兼容性,建议运行以下脚本来检查是否有任何与新版本不兼容的代码:

这个脚本将帮助我们识别可能需要注意的地方,以确保顺利升级。

✅ Verification successful

验证通过,没有发现问题。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:检查代码库中是否有任何与新的 @opensumi 3.4.3 版本不兼容的用法

# 搜索可能使用了已废弃或更改的 API 的地方
rg --type typescript --type javascript "import.*from.*@opensumi" -A 10 -B 10

# 检查是否有任何硬编码的版本号,这些可能需要更新
rg --type typescript --type javascript "@opensumi.*3\.3\.3"

# 检查 package-lock.json 或 yarn.lock 文件中是否有冲突的版本
if [ -f package-lock.json ]; then
  jq '.dependencies | to_entries[] | select(.key | startswith("@opensumi")) | select(.value.version != "3.4.3")' package-lock.json
elif [ -f yarn.lock ]; then
  rg "@opensumi.*#" yarn.lock | rg -v "3.4.3"
fi

Length of output: 308


Script:

#!/bin/bash
# 描述:检查代码库中是否有任何与新的 @opensumi 3.4.3 版本不兼容的用法

# 搜索可能使用了已废弃或更改的 API 的地方,针对 .ts、.tsx、.js 和 .jsx 文件
rg "import.*from.*@opensumi" --glob "*.ts" --glob "*.tsx" --glob "*.js" --glob "*.jsx" -A 10 -B 10

# 检查是否有任何硬编码的版本号,这些可能需要更新
rg "@opensumi.*3\.3\.3" --glob "*.ts" --glob "*.tsx" --glob "*.js" --glob "*.jsx"

# 检查 package-lock.json 或 yarn.lock 文件中是否有冲突的版本
if [ -f package-lock.json ]; then
  jq '.dependencies | to_entries[] | select(.key | startswith("@opensumi")) | select(.value.version != "3.4.3")' package-lock.json
elif [ -f yarn.lock ]; then
  rg "@opensumi.*#" yarn.lock | rg -v "3.4.3"
fi

Length of output: 232898

package.json Outdated
@@ -7,7 +7,7 @@
"description": "codeblitzjs",
"main": "index.js",
"engines": {
"opensumi": "3.3.3"
"opensumi": "3.4.3"
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

发现多个 package.json 文件中的 opensumi 版本未更新至 3.4.3,请手动检查并更新以下文件中的 opensumi 版本:

  • biome.json
  • dprint.json
  • lerna.json
  • package.json
  • packages/cli/package.json
  • packages/code-api/package.json
  • packages/code-service/package.json
  • packages/common/package.json
  • packages/core/package.json
  • packages/i18n/package.json
  • packages/plugin/package.json
  • packages/registry/package.json
  • packages/startup/package.json
  • packages/sumi-core/package.json
  • packages/toolkit/define.json
  • packages/toolkit/fixtures/worker-example/package.json
  • packages/toolkit/snippet.json
  • packages/toolkit/package.json
  • packages/tsconfig.base.json
  • tsconfig.json
🔗 Analysis chain

更新已确认,但需要进一步验证

opensumi 引擎版本已正确更新到 3.4.3,这与 PR 的目标一致。

请运行以下脚本以验证其他 package.json 文件中的 opensumi 版本是否也已更新:

另外,建议检查是否需要因为这次升级而对代码库进行相应的修改。您可能需要查看 opensumi 3.4.3 的更新日志,以确定是否有任何破坏性更改或新功能需要在代码中进行调整。


初步验证脚本执行时出现错误,请运行以下修正后的脚本以检查所有 package.json 文件中的 opensumi 版本:


初步验证发现部分 package.json 文件中的 opensumi 版本未更新至 3.4.3,请运行以下修正后的脚本以进一步验证所有文件的一致性:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:检查所有 package.json 文件中的 opensumi 版本

# 测试:搜索所有包含 opensumi 版本的 package.json 文件。预期:所有文件都应显示版本 3.4.3
fd -e json -x grep -H '"opensumi":' {} +

Length of output: 1437


Script:

#!/bin/bash
# 描述:检查所有 package.json 文件中的 opensumi 版本

# 测试:搜索所有包含 opensumi 版本的 package.json 文件。预期:所有文件都应显示版本 3.4.3
fd -e json -x grep -H '"opensumi": "3\.4\.3"' {} +

Length of output: 1371


Script:

#!/bin/bash
# 描述:查找所有 package.json 文件中 opensumi 版本不为 3.4.3 的条目

# 使用 fd 查找所有 .json 文件,并使用 jq 提取 opensumi 版本
fd -e json | while read -r file; do
  version=$(jq -r '.opensumi' "$file" 2>/dev/null)
  if [ "$version" != "3.4.3" ]; then
    echo "$file:    \"opensumi\": \"$version\""
  fi
done

Length of output: 7944

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: 4

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c00f41d and 5ca3de9.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • package.json (1 hunks)
  • packages/cli/package.json (1 hunks)
  • packages/core/package.json (1 hunks)
  • packages/core/src/core/diff-viewer/internal/base.ts (10 hunks)
  • packages/sumi-core/package.json (1 hunks)
  • packages/sumi-core/resources/manifest.json (1 hunks)
  • packages/sumi-core/resources/webview.25aac54e/index.html (1 hunks)
  • packages/sumi-core/resources/webview.66e57793.js (0 hunks)
  • packages/sumi-core/resources/webview.9ae5c833.js (1 hunks)
  • packages/toolkit/define.json (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/sumi-core/resources/webview.66e57793.js
✅ Files skipped from review due to trivial changes (1)
  • packages/sumi-core/resources/webview.25aac54e/index.html
🚧 Files skipped from review as they are similar to previous changes (5)
  • package.json
  • packages/cli/package.json
  • packages/sumi-core/package.json
  • packages/sumi-core/resources/manifest.json
  • packages/toolkit/define.json
🧰 Additional context used
🪛 Biome
packages/sumi-core/resources/webview.9ae5c833.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 1-1: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1-1: Unexpected control character(s) in regular expression: \u0000

Control characters are unusual and potentially incorrect inputs, so they are disallowed.

(lint/suspicious/noControlCharactersInRegex)


[error] 1-1: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1-1: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1-1: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 1-1: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 1-1: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 1-1: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (4)
packages/core/package.json (1)

36-77: OpenSumi 依赖全面升级至预发布版本

这次更新将所有 @opensumi 依赖从 3.3.3 版本升级到了 3.4.4-next-1728882643.0 版本。这是一个重要的升级,可能带来新功能和改进。然而,需要注意以下几点:

  1. 使用预发布版本可能会引入不稳定性,建议在生产环境中谨慎使用。
  2. 建议在合并此PR之前,对使用新版本依赖的项目进行全面测试,以确保兼容性和稳定性。
  3. 考虑更新 @codeblitzjs/ide-core 包自身的版本号,以反映这次重要的依赖更新。

为了验证新版本的稳定性和兼容性,建议运行以下脚本:

考虑更新 package.json 中的 "version" 字段,以反映这次依赖的重大更新。例如:

 {
   "name": "@codeblitzjs/ide-core",
-  "version": "2.1.0",
+  "version": "2.2.0",
   "description": "@codeblitzjs/ide-core",
   ...
 }
packages/core/src/core/diff-viewer/internal/base.ts (3)

328-330: 函数签名更新正确,使用合理

函数 getDiffInfoForUri 的更新增加了 editor: ICodeEditor 参数,使其能够直接与编辑器状态交互。使用 InlineDiffController.get(editor) 获取控制器是合理的。


366-366: 成功订阅了部分编辑事件

通过 this.inlineDiffService.onPartialEdit 订阅部分编辑事件,确保了编辑器能够响应并处理这些事件,逻辑正确。


426-428: 确保 handleAction 方法存在并正确使用

在调用 handler.handleAction(EResultKind.ACCEPT)handler.handleAction(EResultKind.DISCARD) 时,请确认 InlineDiffController 实例具有 handleAction 方法,并且该方法能够正确处理传入的参数 EResultKind.ACCEPTEResultKind.DISCARD

请运行以下脚本以验证 handleAction 方法的存在:

Also applies to: 434-436

@bytemain bytemain merged commit ed1f678 into main Oct 15, 2024
4 checks passed
@bytemain bytemain deleted the feat/update-opensumi-3.4.3 branch October 15, 2024 03:21
@coderabbitai coderabbitai bot mentioned this pull request Oct 22, 2024
1 task
@coderabbitai coderabbitai bot mentioned this pull request Nov 5, 2024
1 task
@coderabbitai coderabbitai bot mentioned this pull request Dec 3, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants