Repository navigation
加快Render - #491
Merged
Merged
加快Render#491
Conversation
Collaborator
Author
|
相關issue: #265 |
CodFrm
reviewed
Jul 5, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR accelerates rendering by deferring non-critical tasks, optimizes utility functions, updates HTML templates, and bumps several dependencies to newer versions.
- Defer loggerCore.debug calls using
requestIdleCallbackin popup and options pages - Optimize
randomString, implement native crypto-based MD5 with fallback, and clean up HTML/doctypes - Memoize component lists in the popup, refine CSS specificity, and update package versions
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pkg/utils/utils.ts | Optimized randomString, added native crypto MD5 with fallback |
| src/pages/template.html | Fixed <!DOCTYPE html>, removed obsolete X-UA-Compatible |
| src/pages/sandbox.html | Fixed <!DOCTYPE html>, removed obsolete X-UA-Compatible |
| src/pages/offscreen.html | Fixed <!DOCTYPE html>, enhanced iframe sandbox attributes |
| src/pages/popup/main.tsx | Deferred non-critical logging via requestIdleCallback |
| src/pages/options/main.tsx | Deferred non-critical logging via requestIdleCallback |
| src/pages/popup/index.css | Scoped .arco-collapse selector, removed !important |
| src/pages/popup/App.tsx | Added useMemo, simplified URL effect, cleaned up handlers |
| package.json | Bumped React, tools, and devDependencies versions |
Comments suppressed due to low confidence (2)
src/pages/popup/App.tsx:104
- [nitpick] The variable name
bUserScriptsAvailableuses Hungarian notation; consider renaming it touserScriptsAvailableorisUserScriptsAvailableFlagfor clarity.
const bUserScriptsAvailable = isUserScriptsAvailable();
src/pages/popup/index.css:13
- [nitpick] Using the
[class]attribute selector may unintentionally limit rule application; ensure this specificity is intended and consider a clearer selector to improve maintainability.
.arco-collapse[class] {
Collaborator
Author
|
@CodFrm 有空的話看一看 vitest 升上 3.x.x 版本有沒有問題吧 https://cn.vitest.dev/guide/migration 我看過好像不用改代碼。不肯定 |
Collaborator
Author
|
剛發現 calculateMd5 的新代碼是錯誤的 |
Member
|
@cyfung1031 我升级了vitest到最新版本了,并修改了calculateMd5 bbc2550 |
Member
|
@cyfung1031 我刚刚在Windows环境上跑,才发现无法使用vitest了 https://github.com/scriptscat/scriptcat/actions/runs/16246287627 奇怪,ci通过了,我再看看我本地的环境 我更新了我本地的node(22.6.0)到最新可以了 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
X-UA-Compatible移除,修正<!DOCTYPE html>requestIdleCallback