Skip to content

Commit 8374c2a

Browse files
authored
[DevTools] Remove experimental __IS_INTERNAL_MCP_BUILD__ flag and related code (facebook#35755)
This is unused.
1 parent 892c686 commit 8374c2a

File tree

9 files changed

+0
-94
lines changed

9 files changed

+0
-94
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ module.exports = {
507507
__IS_FIREFOX__: 'readonly',
508508
__IS_EDGE__: 'readonly',
509509
__IS_NATIVE__: 'readonly',
510-
__IS_INTERNAL_MCP_BUILD__: 'readonly',
511510
__IS_INTERNAL_VERSION__: 'readonly',
512511
chrome: 'readonly',
513512
},

packages/react-devtools-core/webpack.backend.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ module.exports = {
7272
__IS_CHROME__: false,
7373
__IS_EDGE__: false,
7474
__IS_NATIVE__: true,
75-
__IS_INTERNAL_MCP_BUILD__: false,
7675
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-core"`,
7776
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
7877
'process.env.GITHUB_URL': `"${GITHUB_URL}"`,

packages/react-devtools-core/webpack.standalone.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ module.exports = {
9191
__IS_FIREFOX__: false,
9292
__IS_CHROME__: false,
9393
__IS_EDGE__: false,
94-
__IS_INTERNAL_MCP_BUILD__: false,
9594
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-core"`,
9695
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
9796
'process.env.EDITOR_URL': EDITOR_URL != null ? `"${EDITOR_URL}"` : null,

packages/react-devtools-extensions/webpack.config.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ const IS_FIREFOX = process.env.IS_FIREFOX === 'true';
3434
const IS_EDGE = process.env.IS_EDGE === 'true';
3535
const IS_INTERNAL_VERSION = process.env.FEATURE_FLAG_TARGET === 'extension-fb';
3636

37-
const IS_INTERNAL_MCP_BUILD = process.env.IS_INTERNAL_MCP_BUILD === 'true';
38-
3937
const featureFlagTarget = process.env.FEATURE_FLAG_TARGET || 'extension-oss';
4038

4139
let statsFileName = `webpack-stats.${featureFlagTarget}.${__DEV__ ? 'development' : 'production'}`;
@@ -48,9 +46,6 @@ if (IS_FIREFOX) {
4846
if (IS_EDGE) {
4947
statsFileName += `.edge`;
5048
}
51-
if (IS_INTERNAL_MCP_BUILD) {
52-
statsFileName += `.mcp`;
53-
}
5449
statsFileName += '.json';
5550

5651
const babelOptions = {
@@ -139,7 +134,6 @@ module.exports = {
139134
__IS_FIREFOX__: IS_FIREFOX,
140135
__IS_EDGE__: IS_EDGE,
141136
__IS_NATIVE__: false,
142-
__IS_INTERNAL_MCP_BUILD__: IS_INTERNAL_MCP_BUILD,
143137
__IS_INTERNAL_VERSION__: IS_INTERNAL_VERSION,
144138
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-extensions"`,
145139
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,

packages/react-devtools-fusebox/webpack.config.frontend.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ module.exports = {
8585
__IS_CHROME__: false,
8686
__IS_FIREFOX__: false,
8787
__IS_EDGE__: false,
88-
__IS_INTERNAL_MCP_BUILD__: false,
8988
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-fusebox"`,
9089
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
9190
'process.env.EDITOR_URL': EDITOR_URL != null ? `"${EDITOR_URL}"` : null,

packages/react-devtools-inline/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ module.exports = {
7777
__IS_FIREFOX__: false,
7878
__IS_EDGE__: false,
7979
__IS_NATIVE__: false,
80-
__IS_INTERNAL_MCP_BUILD__: false,
8180
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-inline"`,
8281
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
8382
'process.env.EDITOR_URL': EDITOR_URL != null ? `"${EDITOR_URL}"` : null,

packages/react-devtools-shared/src/backend/fiber/renderer.js

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -8871,86 +8871,6 @@ export function attach(
88718871
return unresolvedSource;
88728872
}
88738873

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-
89548874
return {
89558875
cleanup,
89568876
clearErrorsAndWarnings,
@@ -8994,6 +8914,5 @@ export function attach(
89948914
supportsTogglingSuspense,
89958915
updateComponentFilters,
89968916
getEnvironmentNames,
8997-
...internalMcpFunctions,
89988917
};
89998918
}

scripts/flow/react-devtools.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ declare const __IS_FIREFOX__: boolean;
1616
declare const __IS_CHROME__: boolean;
1717
declare const __IS_EDGE__: boolean;
1818
declare const __IS_NATIVE__: boolean;
19-
declare const __IS_INTERNAL_MCP_BUILD__: boolean;
2019

2120
declare const chrome: any;

scripts/jest/devtools/setupEnv.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ global.__IS_FIREFOX__ = false;
1515
global.__IS_CHROME__ = false;
1616
global.__IS_EDGE__ = false;
1717
global.__IS_NATIVE__ = false;
18-
global.__IS_INTERNAL_MCP_BUILD__ = false;
1918

2019
const ReactVersionTestingAgainst = process.env.REACT_VERSION || ReactVersion;
2120

0 commit comments

Comments
 (0)