Skip to content

Commit

Permalink
Add reload-to-profile for Fusebox
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmondChuiHW committed Sep 22, 2024
1 parent e8c7943 commit 0bab29e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion front_end/panels/react_devtools/ReactDevToolsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,22 @@ export class ReactDevToolsModel extends SDK.SDKModel.SDKModel<EventTypes> {

#finishInitializationAndNotify(): void {
this.#bridge = ReactDevTools.createBridge(this.#wall);
this.#store = ReactDevTools.createStore(this.#bridge);
this.#store = ReactDevTools.createStore(this.#bridge, {
supportsReloadAndProfile: true,
bypassReloadAndProfileCapabilityChecks: true,
});
this.#attachReloadToProfileListener();
this.dispatchEventToListeners(Events.InitializationCompleted);
}

#attachReloadToProfileListener(): void {
this.#wall.listen((message: ReactDevToolsTypes.Message): void => {
if (message.event === 'reloadAppForProfiling') {
SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(false);
}
});
}

#handleBackendExecutionContextUnavailable({data: errorMessage}: ReactDevToolsBindingsBackendExecutionContextUnavailableEvent): void {
this.dispatchEventToListeners(Events.InitializationFailed, errorMessage);
}
Expand Down

0 comments on commit 0bab29e

Please sign in to comment.