@@ -6,7 +6,10 @@ import {initBackend} from 'react-devtools-shared/src/backend';
66import { installHook } from 'react-devtools-shared/src/hook' ;
77import setupNativeStyleEditor from 'react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor' ;
88
9- import type { BackendBridge } from 'react-devtools-shared/src/bridge' ;
9+ import type {
10+ BackendBridge ,
11+ SavedPreferencesParams ,
12+ } from 'react-devtools-shared/src/bridge' ;
1013import type { Wall } from 'react-devtools-shared/src/frontend/types' ;
1114import {
1215 getIfReloadedAndProfiling ,
@@ -16,31 +19,14 @@ import {
1619} from 'react-devtools-shared/src/utils' ;
1720
1821function startActivation ( contentWindow : any , bridge : BackendBridge ) {
19- const onSavedPreferences = ( data : $FlowFixMe ) => {
22+ const onSavedPreferences = ( data : SavedPreferencesParams ) => {
2023 // This is the only message we're listening for,
2124 // so it's safe to cleanup after we've received it.
2225 bridge . removeListener ( 'savedPreferences' , onSavedPreferences ) ;
2326
24- const {
25- appendComponentStack,
26- breakOnConsoleErrors,
27- componentFilters,
28- showInlineWarningsAndErrors,
29- hideConsoleLogsInStrictMode,
30- disableSecondConsoleLogDimmingInStrictMode,
31- } = data ;
32-
33- contentWindow . __REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ =
34- appendComponentStack ;
35- contentWindow . __REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ =
36- breakOnConsoleErrors ;
27+ const { componentFilters} = data ;
28+
3729 contentWindow . __REACT_DEVTOOLS_COMPONENT_FILTERS__ = componentFilters ;
38- contentWindow . __REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ =
39- showInlineWarningsAndErrors ;
40- contentWindow . __REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ =
41- hideConsoleLogsInStrictMode ;
42- contentWindow . __REACT_DEVTOOLS_DISABLE_SECOND_CONSOLE_LOG_DIMMING_IN_STRICT_MODE__ =
43- disableSecondConsoleLogDimmingInStrictMode ;
4430
4531 // TRICKY
4632 // The backend entry point may be required in the context of an iframe or the parent window.
@@ -49,15 +35,7 @@ function startActivation(contentWindow: any, bridge: BackendBridge) {
4935 // Technically we don't need to store them on the contentWindow in this case,
5036 // but it doesn't really hurt anything to store them there too.
5137 if ( contentWindow !== window ) {
52- window . __REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = appendComponentStack ;
53- window . __REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = breakOnConsoleErrors ;
5438 window . __REACT_DEVTOOLS_COMPONENT_FILTERS__ = componentFilters ;
55- window . __REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ =
56- showInlineWarningsAndErrors ;
57- window . __REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ =
58- hideConsoleLogsInStrictMode ;
59- window . __REACT_DEVTOOLS_DISABLE_SECOND_CONSOLE_LOG_DIMMING_IN_STRICT_MODE__ =
60- disableSecondConsoleLogDimmingInStrictMode ;
6139 }
6240
6341 finishActivation ( contentWindow , bridge ) ;
0 commit comments