Skip to content

Commit d7d7716

Browse files
committed
[DevTools] remove backend dependency from the global hook (#26563)
## Summary - #26234 is reverted and replaced with a better approach - introduce a new global devtools variable to decouple the global hook's dependency on backend/console.js, and add it to react-devtools-inline and react-devtools-standalone With this PR, I want to introduce a new principle to hook.js: we should always be alert when editing this file and avoid importing from other files. In the past, we try to inline a lot of the implementation because we use `.toString()` to inject this function from the extension (we still have some old comments left). Although it is no longer inlined that way, it has became now more important to keep it clean as it is a de facto global API people are using (9.9K files contains it on Github search as of today). **File size change for extension:** Before: 379K installHook.js After: 21K installHook.js 363K renderer.js DiffTrain build for commit dd53658.
1 parent 020147d commit d7d7716

File tree

13 files changed

+19
-19
lines changed

13 files changed

+19
-19
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23888,7 +23888,7 @@ function createFiberRoot(
2388823888
return root;
2388923889
}
2389023890

23891-
var ReactVersion = "18.3.0-next-85bb7b685-20230406";
23891+
var ReactVersion = "18.3.0-next-dd5365878-20230407";
2389223892

2389323893
// Might add PROFILE later.
2389423894

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8688,7 +8688,7 @@ var devToolsConfig$jscomp$inline_1028 = {
86888688
throw Error("TestRenderer does not support findFiberByHostInstance()");
86898689
},
86908690
bundleType: 0,
8691-
version: "18.3.0-next-85bb7b685-20230406",
8691+
version: "18.3.0-next-dd5365878-20230407",
86928692
rendererPackageName: "react-test-renderer"
86938693
};
86948694
var internals$jscomp$inline_1220 = {
@@ -8719,7 +8719,7 @@ var internals$jscomp$inline_1220 = {
87198719
scheduleRoot: null,
87208720
setRefreshHandler: null,
87218721
getCurrentFiber: null,
8722-
reconcilerVersion: "18.3.0-next-85bb7b685-20230406"
8722+
reconcilerVersion: "18.3.0-next-dd5365878-20230407"
87238723
};
87248724
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
87258725
var hook$jscomp$inline_1221 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9114,7 +9114,7 @@ var devToolsConfig$jscomp$inline_1070 = {
91149114
throw Error("TestRenderer does not support findFiberByHostInstance()");
91159115
},
91169116
bundleType: 0,
9117-
version: "18.3.0-next-85bb7b685-20230406",
9117+
version: "18.3.0-next-dd5365878-20230407",
91189118
rendererPackageName: "react-test-renderer"
91199119
};
91209120
var internals$jscomp$inline_1261 = {
@@ -9145,7 +9145,7 @@ var internals$jscomp$inline_1261 = {
91459145
scheduleRoot: null,
91469146
setRefreshHandler: null,
91479147
getCurrentFiber: null,
9148-
reconcilerVersion: "18.3.0-next-85bb7b685-20230406"
9148+
reconcilerVersion: "18.3.0-next-dd5365878-20230407"
91499149
};
91509150
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
91519151
var hook$jscomp$inline_1262 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-next-85bb7b685-20230406";
30+
var ReactVersion = "18.3.0-next-dd5365878-20230407";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
639639
);
640640
};
641641
exports.useTransition = useTransition;
642-
exports.version = "18.3.0-next-85bb7b685-20230406";
642+
exports.version = "18.3.0-next-dd5365878-20230407";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
642642
);
643643
};
644644
exports.useTransition = useTransition;
645-
exports.version = "18.3.0-next-85bb7b685-20230406";
645+
exports.version = "18.3.0-next-dd5365878-20230407";
646646

647647
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
648648
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
85bb7b685b7aec50879703b94dd31523cf69b34d
1+
dd5365878da2fe88a34dcdbb07d8297a78841da4

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27184,7 +27184,7 @@ function createFiberRoot(
2718427184
return root;
2718527185
}
2718627186

27187-
var ReactVersion = "18.3.0-next-85bb7b685-20230406";
27187+
var ReactVersion = "18.3.0-next-dd5365878-20230407";
2718827188

2718927189
function createPortal$1(
2719027190
children,

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9555,7 +9555,7 @@ var roots = new Map(),
95559555
devToolsConfig$jscomp$inline_1052 = {
95569556
findFiberByHostInstance: getInstanceFromNode,
95579557
bundleType: 0,
9558-
version: "18.3.0-next-85bb7b685-20230406",
9558+
version: "18.3.0-next-dd5365878-20230407",
95599559
rendererPackageName: "react-native-renderer",
95609560
rendererConfig: {
95619561
getInspectorDataForViewTag: function () {
@@ -9597,7 +9597,7 @@ var internals$jscomp$inline_1297 = {
95979597
scheduleRoot: null,
95989598
setRefreshHandler: null,
95999599
getCurrentFiber: null,
9600-
reconcilerVersion: "18.3.0-next-85bb7b685-20230406"
9600+
reconcilerVersion: "18.3.0-next-dd5365878-20230407"
96019601
};
96029602
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96039603
var hook$jscomp$inline_1298 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10264,7 +10264,7 @@ var roots = new Map(),
1026410264
devToolsConfig$jscomp$inline_1130 = {
1026510265
findFiberByHostInstance: getInstanceFromNode,
1026610266
bundleType: 0,
10267-
version: "18.3.0-next-85bb7b685-20230406",
10267+
version: "18.3.0-next-dd5365878-20230407",
1026810268
rendererPackageName: "react-native-renderer",
1026910269
rendererConfig: {
1027010270
getInspectorDataForViewTag: function () {
@@ -10319,7 +10319,7 @@ var roots = new Map(),
1031910319
scheduleRoot: null,
1032010320
setRefreshHandler: null,
1032110321
getCurrentFiber: null,
10322-
reconcilerVersion: "18.3.0-next-85bb7b685-20230406"
10322+
reconcilerVersion: "18.3.0-next-dd5365878-20230407"
1032310323
});
1032410324
exports.createPortal = function (children, containerTag) {
1032510325
return createPortal$1(

0 commit comments

Comments
 (0)