-
Notifications
You must be signed in to change notification settings - Fork 22
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
#6581: lazy load page script to reduce memory footprint #6772
Conversation
src/pageScript/messenger/pigeon.ts
Outdated
@@ -47,6 +51,16 @@ function assertCustomEvent( | |||
} | |||
} | |||
|
|||
const injectPageScriptOnce = once(async (): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from lifecycle.ts
@@ -89,15 +88,6 @@ const _navigationListeners = new Set<() => void>(); | |||
|
|||
const WAIT_LOADED_INTERVAL_MS = 25; | |||
|
|||
const injectPageScriptOnce = once(async (): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to pigeon.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's in src/pageScript/messenger/sender.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's in src/pageScript/messenger/sender.ts
Move to src/pageScript/messenger/sender.ts 😄
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6772 +/- ##
==========================================
- Coverage 70.05% 70.03% -0.02%
==========================================
Files 1188 1193 +5
Lines 36936 36949 +13
Branches 6937 6937
==========================================
+ Hits 25875 25879 +4
- Misses 11061 11070 +9
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't immediately see what's importing the polyfill. expectContext does not use browser
https://github.com/pixiebrix/pixiebrix-extension/blob/main/src/utils/expectContext.ts
|
||
/** @file The first messenger before webext-messenger. Deprecated, see https://github.com/pixiebrix/webext-messenger/issues/5 */ | ||
|
||
export interface RemoteProcedureCallRequest<TMeta extends Meta = Meta> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving these utils to a separate files opens them to being mistakenly imported since they're not individually deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I'll deprecate the whole file
660f1b6
to
61bc4fb
Compare
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
What does this PR do?
lifecycle.ts
was loading the Page Editor on every frame, and the injection was blocking mod startup@/utils/legacyMessengerUtils
src/contentScript/pageEditor/inferSingleElementSelector.ts
Remaining Work
browser-polyfill
checkFuture Work
Checklist
src/tsconfig.strictNullChecks.json
(if possible): N/A