-
Notifications
You must be signed in to change notification settings - Fork 25
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
Drop some comments and logging #8073
Changes from 9 commits
4218391
b61a2ba
22d10cf
6d3fd09
88a8529
c8a6361
06c2f0e
926be65
a8a9ddd
166c0ce
ef12aee
3d2b2cd
e11d6ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,14 +242,13 @@ export class WithAsyncModVariable extends TransformerABC { | |
); | ||
} | ||
|
||
const bodyPromise = runPipeline(body, { | ||
key: "body", | ||
counter: 0, | ||
}); | ||
|
||
void bodyPromise | ||
// eslint-disable-next-line promise/prefer-await-to-then -- not blocking | ||
.then((data: JsonObject) => { | ||
// Non-blocking async call | ||
(async () => { | ||
try { | ||
const data = (await runPipeline(body, { | ||
key: "body", | ||
counter: 0, | ||
})) as JsonObject; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Async-await code is easier to follow, and shorter if we account for the Here for example it makes the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we consider making There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be OK for now (e.g., The future change toRunPipeline would be to make the type |
||
if (!isCurrentNonce()) { | ||
return; | ||
} | ||
|
@@ -267,9 +266,7 @@ export class WithAsyncModVariable extends TransformerABC { | |
}, | ||
"put", | ||
); | ||
}) | ||
// eslint-disable-next-line promise/prefer-await-to-then -- not blocking | ||
.catch((error) => { | ||
} catch (error) { | ||
if (!isCurrentNonce()) { | ||
return; | ||
} | ||
|
@@ -287,7 +284,8 @@ export class WithAsyncModVariable extends TransformerABC { | |
}, | ||
"put", | ||
); | ||
}); | ||
} | ||
})(); | ||
|
||
return { | ||
requestId, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,7 +130,6 @@ let modActivationPanelEntry: ModActivationPanelEntry | null = null; | |
* Attach the sidebar to the page if it's not already attached. Then re-renders all panels. | ||
*/ | ||
export async function showSidebar(): Promise<void> { | ||
console.debug("sidebarController:showSidebar"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These logs are super old, we should try to remove old logs on parts of the extension that are stable and are no longer monitoring. |
||
reportEvent(Events.SIDEBAR_SHOW); | ||
if (isMV3() || isLoadedInIframe()) { | ||
try { | ||
|
@@ -178,10 +177,6 @@ export async function activateExtensionPanel(extensionId: UUID): Promise<void> { | |
* @see HIDE_SIDEBAR_EVENT_NAME | ||
*/ | ||
export function hideSidebar(): void { | ||
console.debug("sidebarController:hideSidebar", { | ||
isSidebarFrameVisible: sidebarMv2.isSidebarFrameVisible(), | ||
}); | ||
|
||
reportEvent(Events.SIDEBAR_HIDE); | ||
sidebarMv2.removeSidebarFrame(); | ||
window.dispatchEvent(new CustomEvent(HIDE_SIDEBAR_EVENT_NAME)); | ||
|
@@ -208,14 +203,8 @@ export async function updateSidebar( | |
export async function renderPanelsIfVisible(): Promise<void> { | ||
expectContext("contentScript"); | ||
|
||
console.debug("sidebarController:renderPanelsIfVisible"); | ||
|
||
if (await isSidePanelOpen()) { | ||
void sidebarInThisTab.renderPanels(getTimedSequence(), panels); | ||
} else { | ||
console.debug( | ||
"sidebarController:renderPanelsIfVisible: skipping renderPanels because the sidebar is not visible", | ||
); | ||
} | ||
} | ||
|
||
|
@@ -372,11 +361,6 @@ export function reservePanels(refs: ModComponentRef[]): void { | |
export function updateHeading(extensionId: UUID, heading: string): void { | ||
const entry = panels.find((x) => x.extensionId === extensionId); | ||
|
||
console.debug("sidebarController:updateHeading %s", extensionId, { | ||
heading, | ||
panel: entry, | ||
}); | ||
|
||
if (entry) { | ||
entry.heading = heading; | ||
console.debug( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ const PanelContent: React.FC = () => { | |
return () => { | ||
navigationEvent.remove(onNavigation); | ||
}; | ||
}, [navigationEvent, onNavigation]); | ||
}, [onNavigation]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
||
useEffect(() => { | ||
// Automatically connect on load | ||
|
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.
Comment related to "headers" generation. We don't have such restrictions anymore