@samitouri / QOS-React-1 / commits / 8374c2abf1

[DevTools] Remove experimental __IS_INTERNAL_MCP_BUILD__ flag and related code (#35755)

This is unused.

Ruslan Lesiutin committed Feb 11, 2026 at 16:59 UTC 8374c2abf13fa803233025192b8d7e87de70b087
9 files changed -94
.eslintrc.js
-1
@@ -507,7 +507,6 @@ module.exports = {
507 __IS_FIREFOX__: 'readonly',
508 __IS_EDGE__: 'readonly',
509 __IS_NATIVE__: 'readonly',
510 - __IS_INTERNAL_MCP_BUILD__: 'readonly',
510 __IS_INTERNAL_VERSION__: 'readonly',
511 chrome: 'readonly',
512 },
packages/react-devtools-core/webpack.backend.js
-1
@@ -72,7 +72,6 @@ module.exports = {
72 __IS_CHROME__: false,
73 __IS_EDGE__: false,
74 __IS_NATIVE__: true,
75 - __IS_INTERNAL_MCP_BUILD__: false,
75 'process.env.DEVTOOLS_PACKAGE': `"react-devtools-core"`,
76 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
77 'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
packages/react-devtools-core/webpack.standalone.js
-1
@@ -91,7 +91,6 @@ module.exports = {
91 __IS_FIREFOX__: false,
92 __IS_CHROME__: false,
93 __IS_EDGE__: false,
94 - __IS_INTERNAL_MCP_BUILD__: false,
94 'process.env.DEVTOOLS_PACKAGE': `"react-devtools-core"`,
95 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
96 'process.env.EDITOR_URL': EDITOR_URL != null ? `"${EDITOR_URL}"` : null,
packages/react-devtools-extensions/webpack.config.js
-6
@@ -34,8 +34,6 @@ const IS_FIREFOX = process.env.IS_FIREFOX === 'true';
34 const IS_EDGE = process.env.IS_EDGE === 'true';
35 const IS_INTERNAL_VERSION = process.env.FEATURE_FLAG_TARGET === 'extension-fb';
36
37 -const IS_INTERNAL_MCP_BUILD = process.env.IS_INTERNAL_MCP_BUILD === 'true';
38 -
37 const featureFlagTarget = process.env.FEATURE_FLAG_TARGET || 'extension-oss';
38
39 let statsFileName = `webpack-stats.${featureFlagTarget}.${__DEV__ ? 'development' : 'production'}`;
@@ -48,9 +46,6 @@ if (IS_FIREFOX) {
46 if (IS_EDGE) {
47 statsFileName += `.edge`;
48 }
51 -if (IS_INTERNAL_MCP_BUILD) {
52 - statsFileName += `.mcp`;
53 -}
49 statsFileName += '.json';
50
51 const babelOptions = {
@@ -139,7 +134,6 @@ module.exports = {
134 __IS_FIREFOX__: IS_FIREFOX,
135 __IS_EDGE__: IS_EDGE,
136 __IS_NATIVE__: false,
142 - __IS_INTERNAL_MCP_BUILD__: IS_INTERNAL_MCP_BUILD,
137 __IS_INTERNAL_VERSION__: IS_INTERNAL_VERSION,
138 'process.env.DEVTOOLS_PACKAGE': `"react-devtools-extensions"`,
139 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
packages/react-devtools-fusebox/webpack.config.frontend.js
-1
@@ -85,7 +85,6 @@ module.exports = {
85 __IS_CHROME__: false,
86 __IS_FIREFOX__: false,
87 __IS_EDGE__: false,
88 - __IS_INTERNAL_MCP_BUILD__: false,
88 'process.env.DEVTOOLS_PACKAGE': `"react-devtools-fusebox"`,
89 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
90 'process.env.EDITOR_URL': EDITOR_URL != null ? `"${EDITOR_URL}"` : null,
packages/react-devtools-inline/webpack.config.js
-1
@@ -77,7 +77,6 @@ module.exports = {
77 __IS_FIREFOX__: false,
78 __IS_EDGE__: false,
79 __IS_NATIVE__: false,
80 - __IS_INTERNAL_MCP_BUILD__: false,
80 'process.env.DEVTOOLS_PACKAGE': `"react-devtools-inline"`,
81 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
82 'process.env.EDITOR_URL': EDITOR_URL != null ? `"${EDITOR_URL}"` : null,
packages/react-devtools-shared/src/backend/fiber/renderer.js
-81
@@ -8871,86 +8871,6 @@ export function attach(
8871 return unresolvedSource;
8872 }
8873
8874 - type InternalMcpFunctions = {
8875 - __internal_only_getComponentTree?: Function,
8876 - };
8877 -
8878 - const internalMcpFunctions: InternalMcpFunctions = {};
8879 - if (__IS_INTERNAL_MCP_BUILD__) {
8880 - // eslint-disable-next-line no-inner-declarations
8881 - function __internal_only_getComponentTree(): string {
8882 - let treeString = '';
8883 -
8884 - function buildTreeString(
8885 - instance: DevToolsInstance,
8886 - prefix: string = '',
8887 - isLastChild: boolean = true,
8888 - ): void {
8889 - if (!instance) return;
8890 -
8891 - const name =
8892 - (instance.kind !== VIRTUAL_INSTANCE
8893 - ? getDisplayNameForFiber(instance.data)
8894 - : instance.data.name) || 'Unknown';
8895 -
8896 - const id = instance.id !== undefined ? instance.id : 'unknown';
8897 -
8898 - if (name !== 'createRoot()') {
8899 - treeString +=
8900 - prefix +
8901 - (isLastChild ? '└── ' : '├── ') +
8902 - name +
8903 - ' (id: ' +
8904 - id +
8905 - ')\n';
8906 - }
8907 -
8908 - const childPrefix = prefix + (isLastChild ? ' ' : '│ ');
8909 -
8910 - let childCount = 0;
8911 - let tempChild = instance.firstChild;
8912 - while (tempChild !== null) {
8913 - childCount++;
8914 - tempChild = tempChild.nextSibling;
8915 - }
8916 -
8917 - let child = instance.firstChild;
8918 - let currentChildIndex = 0;
8919 -
8920 - while (child !== null) {
8921 - currentChildIndex++;
8922 - const isLastSibling = currentChildIndex === childCount;
8923 - buildTreeString(child, childPrefix, isLastSibling);
8924 - child = child.nextSibling;
8925 - }
8926 - }
8927 -
8928 - const rootInstances: Array<DevToolsInstance> = [];
8929 - idToDevToolsInstanceMap.forEach(instance => {
8930 - if (instance.parent === null || instance.parent.parent === null) {
8931 - rootInstances.push(instance);
8932 - }
8933 - });
8934 -
8935 - if (rootInstances.length > 0) {
8936 - for (let i = 0; i < rootInstances.length; i++) {
8937 - const isLast = i === rootInstances.length - 1;
8938 - buildTreeString(rootInstances[i], '', isLast);
8939 - if (!isLast) {
8940 - treeString += '\n';
8941 - }
8942 - }
8943 - } else {
8944 - treeString = 'No component tree found.';
8945 - }
8946 -
8947 - return treeString;
8948 - }
8949 -
8950 - internalMcpFunctions.__internal_only_getComponentTree =
8951 - __internal_only_getComponentTree;
8952 - }
8953 -
8874 return {
8875 cleanup,
8876 clearErrorsAndWarnings,
@@ -8994,6 +8914,5 @@ export function attach(
8914 supportsTogglingSuspense,
8915 updateComponentFilters,
8916 getEnvironmentNames,
8997 - ...internalMcpFunctions,
8917 };
8918 }
scripts/flow/react-devtools.js
-1
@@ -16,6 +16,5 @@ declare const __IS_FIREFOX__: boolean;
16 declare const __IS_CHROME__: boolean;
17 declare const __IS_EDGE__: boolean;
18 declare const __IS_NATIVE__: boolean;
19 -declare const __IS_INTERNAL_MCP_BUILD__: boolean;
19
20 declare const chrome: any;
scripts/jest/devtools/setupEnv.js
-1
@@ -15,7 +15,6 @@ global.__IS_FIREFOX__ = false;
15 global.__IS_CHROME__ = false;
16 global.__IS_EDGE__ = false;
17 global.__IS_NATIVE__ = false;
18 -global.__IS_INTERNAL_MCP_BUILD__ = false;
18
19 const ReactVersionTestingAgainst = process.env.REACT_VERSION || ReactVersion;
20