Skip to content

异步代码优化#651

Merged
CodFrm merged 11 commits intoscriptscat:mainfrom
cyfung1031:asyncLoadOptimize2
Aug 24, 2025
Merged

异步代码优化#651
CodFrm merged 11 commits intoscriptscat:mainfrom
cyfung1031:asyncLoadOptimize2

Conversation

@cyfung1031
Copy link
Copy Markdown
Collaborator

No description provided.

@cyfung1031
Copy link
Copy Markdown
Collaborator Author

先這樣。

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request optimizes asynchronous code by converting async/await patterns to promise chains throughout the codebase. The main purpose is to improve async handling patterns and reduce code complexity.

Key changes:

  • Refactored async/await patterns to promise chains for better flow control
  • Updated configuration loading to use promise chains instead of async functions
  • Simplified backup export logic by returning promise arrays directly

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/pkg/config/config.ts Added async value support with promise-based configuration loading
src/pkg/backup/export.ts Converted async methods to return promise arrays for parallel execution
src/pages/options/routes/Setting.tsx Changed async config loading to promise chain pattern
src/pages/components/CodeEditor/index.tsx Simplified config loading using promise chains
src/locales/locales.ts Converted matchLanguage from async function to promise-returning function
src/app/service/service_worker/utils.ts Removed unused utility functions
src/app/service/service_worker/synchronize.ts Optimized resource import operations using promise arrays
src/app/service/service_worker/script.ts Refactored script resource building to use promise chains
src/app/service/service_worker/runtime.ts Converted nested async operations to flatMap promise patterns
src/app/service/service_worker/fetch.ts Simplified icon fetching using promise chains
src/app/service/offscreen/gm_api.ts Fixed FormData file handling with proper promise chains
src/app/service/content/gm_api.ts Optimized FormData processing using promise arrays

Comment thread src/pkg/config/config.ts
Comment thread src/pkg/config/config.ts
@CodFrm CodFrm merged commit 55440e7 into scriptscat:main Aug 24, 2025
3 checks passed
@cyfung1031 cyfung1031 deleted the asyncLoadOptimize2 branch October 4, 2025 02:09
@cyfung1031 cyfung1031 review requested due to automatic review settings March 23, 2026 19:37
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.

3 participants