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

refactor: extract electron essentials #2742

Merged
merged 15 commits into from
Jun 2, 2023

Conversation

bytemain
Copy link
Member

Types

  • 🪚 Refactors

Background or solution

OpenSumi 2023 Roadmap - 移除对 isElectronRenderer 的依赖

优化代码中对于 isElectronRenderer 的依赖,将 isElectronRenderer 相关的代码都抽离出独立的函数。

Changelog

split the code related to Electron

@opensumi opensumi bot added the ⚙️ refactor Refactor code label May 23, 2023
@opensumi
Copy link
Contributor

opensumi bot commented May 23, 2023

ChatGPT Code Review:

代码存在一些修改和抽离,主要是针对 Electron 的优化。对于代码的语法和错误拼写问题没有进行修改。

代码的主要功能是抽离和优化 Electron 相关的代码,包括注入 Electron 的相关服务和针对 Electron 的 API 的调用。这样能够让代码在 Electron 环境中更加稳定和高效,并且使得项目更容易维护和扩展。

@bytemain bytemain changed the title WIP: refactor: extract electron essentials refactor: extract electron essentials May 23, 2023
@bytemain bytemain requested review from yantze, Aaaaash and a team May 23, 2023 07:38
@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Patch coverage: 82.50% and project coverage change: -0.01 ⚠️

Comparison is base (b0407c9) 57.73% compared to head (5295733) 57.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2742      +/-   ##
==========================================
- Coverage   57.73%   57.72%   -0.01%     
==========================================
  Files        1327     1329       +2     
  Lines       83580    83609      +29     
  Branches    17378    17383       +5     
==========================================
+ Hits        48252    48263      +11     
- Misses      32108    32124      +16     
- Partials     3220     3222       +2     
Flag Coverage Δ
jsdom 52.72% <82.50%> (-0.01%) ⬇️
node 16.80% <35.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core-browser/src/utils/env.ts 25.00% <ø> (ø)
packages/core-common/src/module.ts 100.00% <ø> (ø)
packages/core-common/src/types/application.ts 100.00% <ø> (ø)
packages/utils/src/os.ts 80.00% <ø> (ø)
...xtension/src/browser/sumi/main.thread.lifecycle.ts 31.57% <33.33%> (+3.80%) ⬆️
packages/core-common/src/error.ts 50.00% <50.00%> (ø)
packages/core-browser/src/common/common.module.ts 70.58% <66.66%> (-4.42%) ⬇️
...ore-browser/src/application/application.service.ts 97.22% <83.33%> (-2.78%) ⬇️
packages/core-browser/src/bootstrap/app.ts 65.86% <85.71%> (+0.42%) ⬆️
...-browser/src/bootstrap/inner-providers-electron.ts 100.00% <100.00%> (ø)
... and 3 more

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bytemain
Copy link
Member Author

暂时先小改,没有大改。

等之后会有个 RFC 写出来,改成用上一些设计模式的

@bytemain bytemain requested review from erha19 and yantze May 25, 2023 09:35
@bytemain bytemain requested a review from erha19 May 31, 2023 10:20
@bytemain bytemain merged commit 454e876 into main Jun 2, 2023
12 checks passed
@bytemain bytemain deleted the refactor/extract-electron-essentials branch June 2, 2023 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ refactor Refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants