@@ -26,6 +26,8 @@ import type {
26
26
import type {
27
27
DevToolsHook ,
28
28
DevToolsHookSettings ,
29
+ ReloadAndProfileConfig ,
30
+ ReloadAndProfileConfigPersistence ,
29
31
} from 'react-devtools-shared/src/backend/types' ;
30
32
import type { ResolveNativeStyle } from 'react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor' ;
31
33
@@ -40,6 +42,7 @@ type ConnectOptions = {
40
42
websocket ?: ?WebSocket ,
41
43
onSettingsUpdated ?: ( settings : $ReadOnly < DevToolsHookSettings > ) => void ,
42
44
isReloadAndProfileSupported ?: boolean ,
45
+ reloadAndProfileConfigPersistence ?: ReloadAndProfileConfigPersistence ,
43
46
} ;
44
47
45
48
let savedComponentFilters : Array < ComponentFilter > =
@@ -60,8 +63,9 @@ export function initialize(
60
63
maybeSettingsOrSettingsPromise ?:
61
64
| DevToolsHookSettings
62
65
| Promise < DevToolsHookSettings > ,
66
+ reloadAndProfileConfig ?: ReloadAndProfileConfig ,
63
67
) {
64
- installHook ( window , maybeSettingsOrSettingsPromise ) ;
68
+ installHook ( window , maybeSettingsOrSettingsPromise , reloadAndProfileConfig ) ;
65
69
}
66
70
67
71
export function connectToDevTools ( options : ?ConnectOptions ) {
@@ -82,6 +86,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
82
86
isAppActive = ( ) => true ,
83
87
onSettingsUpdated,
84
88
isReloadAndProfileSupported = getIsReloadAndProfileSupported ( ) ,
89
+ reloadAndProfileConfigPersistence,
85
90
} = options || { } ;
86
91
87
92
const protocol = useHttps ? 'wss' : 'ws' ;
@@ -175,7 +180,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
175
180
176
181
// TODO (npm-packages) Warn if "isBackendStorageAPISupported"
177
182
// $FlowFixMe[incompatible-call] found when upgrading Flow
178
- const agent = new Agent ( bridge ) ;
183
+ const agent = new Agent ( bridge , reloadAndProfileConfigPersistence ) ;
179
184
if ( onSettingsUpdated != null ) {
180
185
agent . addListener ( 'updateHookSettings' , onSettingsUpdated ) ;
181
186
}
@@ -315,6 +320,7 @@ type ConnectWithCustomMessagingOptions = {
315
320
resolveRNStyle ?: ResolveNativeStyle ,
316
321
onSettingsUpdated ?: ( settings : $ReadOnly < DevToolsHookSettings > ) => void ,
317
322
isReloadAndProfileSupported ?: boolean ,
323
+ reloadAndProfileConfigPersistence ?: ReloadAndProfileConfigPersistence ,
318
324
} ;
319
325
320
326
export function connectWithCustomMessagingProtocol ( {
@@ -325,6 +331,7 @@ export function connectWithCustomMessagingProtocol({
325
331
resolveRNStyle,
326
332
onSettingsUpdated,
327
333
isReloadAndProfileSupported = getIsReloadAndProfileSupported ( ) ,
334
+ reloadAndProfileConfigPersistence,
328
335
} : ConnectWithCustomMessagingOptions ) : Function {
329
336
const hook : ?DevToolsHook = window . __REACT_DEVTOOLS_GLOBAL_HOOK__ ;
330
337
if ( hook == null ) {
@@ -361,7 +368,7 @@ export function connectWithCustomMessagingProtocol({
361
368
bridge . send ( 'overrideComponentFilters' , savedComponentFilters ) ;
362
369
}
363
370
364
- const agent = new Agent ( bridge ) ;
371
+ const agent = new Agent ( bridge , reloadAndProfileConfigPersistence ) ;
365
372
if ( onSettingsUpdated != null ) {
366
373
agent . addListener ( 'updateHookSettings' , onSettingsUpdated ) ;
367
374
}
0 commit comments