Commit 545b1d5 1 parent 2c40d48 commit 545b1d5 Copy full SHA for 545b1d5
File tree 2 files changed +16
-2
lines changed
third_party/react-devtools/package
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,21 @@ export class ReactDevToolsModel extends SDK.SDKModel.SDKModel<EventTypes> {
163
163
164
164
#finishInitializationAndNotify( ) : void {
165
165
this . #bridge = ReactDevTools . createBridge ( this . #wall) ;
166
- this . #store = ReactDevTools . createStore ( this . #bridge) ;
166
+ this . #store = ReactDevTools . createStore ( this . #bridge, {
167
+ supportsReloadAndProfile : true ,
168
+ } ) ;
169
+ this . #attachReloadToProfileListener( ) ;
167
170
this . dispatchEventToListeners ( Events . InitializationCompleted ) ;
168
171
}
169
172
173
+ #attachReloadToProfileListener( ) : void {
174
+ this . #wall. listen ( ( message : ReactDevToolsTypes . Message ) : void => {
175
+ if ( message . event === 'reloadAppForProfiling' ) {
176
+ SDK . ResourceTreeModel . ResourceTreeModel . reloadAllPages ( false ) ;
177
+ }
178
+ } ) ;
179
+ }
180
+
170
181
#handleBackendExecutionContextUnavailable( { data : errorMessage } : ReactDevToolsBindingsBackendExecutionContextUnavailableEvent ) : void {
171
182
this . dispatchEventToListeners ( Events . InitializationFailed , errorMessage ) ;
172
183
}
Original file line number Diff line number Diff line change @@ -19,9 +19,12 @@ export type Bridge = {
19
19
} ;
20
20
export type Store = Object ;
21
21
export type BrowserTheme = 'dark' | 'light' ;
22
+ export type Config = {
23
+ supportsReloadAndProfile ?: boolean ,
24
+ } ;
22
25
23
26
export function createBridge ( wall : Wall ) : Bridge ;
24
- export function createStore ( bridge : Bridge ) : Store ;
27
+ export function createStore ( bridge : Bridge , config ?: Config ) : Store ;
25
28
26
29
export type Source = {
27
30
sourceURL : string ,
You can’t perform that action at this time.
0 commit comments