[DRAFT] inject.js 瘦身#502
Closed
cyfung1031 wants to merge 15 commits intoscriptscat:mainfrom
Closed
Conversation
Member
|
确实应该将inject/content的utils工具方法和service_worker之类的方法分离开来,避免引用到不需要的内容,之前一直知道这个问题想做的 为什么把default都删除了,应该不影响吧 |
Collaborator
Author
Collaborator
Author
|
@CodFrm 這個檔案有一堆TypeScript未定義的紅線,能幫助看一下嗎 https://github.com/scriptscat/scriptcat/blob/main/src/pages/components/CloudScriptPlan/index.tsx 另外, ExportParams = ? 我看起來應該是不能编译 不知道為什麼一直以來能通過 |
Member
|
@cyfung1031 重构mv3后,我都忘记这块了,这块很久没维护了,可能是我的eslint规则没那么严格,没有报错,处理了 |
Merged
Collaborator
Author
|
移至 #505 |
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.

因為部份library (例如dayjs) 不是ES Modules
所以打包後體積過大
要把 types 從 ts實作 分離,而且 utils 中簡單工具也要分離,不依賴dayjs
試作成果:418 KB (0.18.1) -> 142 KB ( 試作品 )
inject.js 及 content.js 都成功抽走垃圾代碼
(先等其他PR整合, 如 #494)
#499 的 favicon.ts 會一併整合更新