Skip to content

Commit 8b1d595

Browse files
committed
[DevTools] Enable support for the React DevTools Client to connect to different host/port/path (facebook#35886)
## Summary This enables routing the React Dev Tools through a remote server by being able to specify host, port, and path for the client to connect to. Basically allowing the React Dev Tools server to have the client connect elsewhere. This setups a `clientOptions` which can be set up through environment variables when starting the React Dev Tools server. This change shouldn't affect the traditional usage for React Dev Tools. EDIT: the additional change was moved to another PR ## How did you test this change? Run React DevTools with ``` $ REACT_DEVTOOLS_CLIENT_HOST=<MY_HOST> REACT_DEVTOOLS_CLIENT_PORT=443 REACT_DEVTOOLS_CLIENT_USE_HTTPS=true REACT_DEVTOOLS_PATH=/__react_devtools__/ yarn start ``` Confirm that my application connects to the local React Dev Tools server/instance/electron app through my remote server. DiffTrain build for [c0060cf](facebook@c0060cf)
1 parent ca88825 commit 8b1d595

35 files changed

Lines changed: 93 additions & 152 deletions

compiled/eslint-plugin-react-hooks/index.js

Lines changed: 7 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -45054,76 +45054,17 @@ function validateNoRefAccessInRenderImpl(fn, env, errors) {
4505445054
}
4505545055
if (!didError) {
4505645056
const isRefLValue = isUseRefType(instr.lvalue.identifier);
45057-
if (isRefLValue ||
45058-
(hookKind != null &&
45059-
hookKind !== 'useState' &&
45060-
hookKind !== 'useReducer')) {
45061-
for (const operand of eachInstructionValueOperand(instr.value)) {
45057+
for (const operand of eachInstructionValueOperand(instr.value)) {
45058+
if (isRefLValue ||
45059+
(hookKind != null &&
45060+
hookKind !== 'useState' &&
45061+
hookKind !== 'useReducer')) {
4506245062
validateNoDirectRefValueAccess(errors, operand, env);
4506345063
}
45064-
}
45065-
else if (interpolatedAsJsx.has(instr.lvalue.identifier.id)) {
45066-
for (const operand of eachInstructionValueOperand(instr.value)) {
45064+
else if (interpolatedAsJsx.has(instr.lvalue.identifier.id)) {
4506745065
validateNoRefValueAccess(errors, env, operand);
4506845066
}
45069-
}
45070-
else if (hookKind == null && instr.effects != null) {
45071-
const visitedEffects = new Set();
45072-
for (const effect of instr.effects) {
45073-
let place = null;
45074-
let validation = 'none';
45075-
switch (effect.kind) {
45076-
case 'Freeze': {
45077-
place = effect.value;
45078-
validation = 'direct-ref';
45079-
break;
45080-
}
45081-
case 'Mutate':
45082-
case 'MutateTransitive':
45083-
case 'MutateConditionally':
45084-
case 'MutateTransitiveConditionally': {
45085-
place = effect.value;
45086-
validation = 'ref-passed';
45087-
break;
45088-
}
45089-
case 'Render': {
45090-
place = effect.place;
45091-
validation = 'ref-passed';
45092-
break;
45093-
}
45094-
case 'Capture':
45095-
case 'Alias':
45096-
case 'MaybeAlias':
45097-
case 'Assign':
45098-
case 'CreateFrom': {
45099-
place = effect.from;
45100-
validation = 'ref-passed';
45101-
break;
45102-
}
45103-
case 'ImmutableCapture': {
45104-
place = effect.from;
45105-
const isFrozen = instr.effects.some(e => e.kind === 'Freeze' &&
45106-
e.value.identifier.id === effect.from.identifier.id);
45107-
validation = isFrozen ? 'direct-ref' : 'ref-passed';
45108-
break;
45109-
}
45110-
}
45111-
if (place !== null && validation !== 'none') {
45112-
const key = `${place.identifier.id}:${validation}`;
45113-
if (!visitedEffects.has(key)) {
45114-
visitedEffects.add(key);
45115-
if (validation === 'direct-ref') {
45116-
validateNoDirectRefValueAccess(errors, place, env);
45117-
}
45118-
else {
45119-
validateNoRefPassedToFunction(errors, env, place, place.loc);
45120-
}
45121-
}
45122-
}
45123-
}
45124-
}
45125-
else {
45126-
for (const operand of eachInstructionValueOperand(instr.value)) {
45067+
else {
4512745068
validateNoRefPassedToFunction(errors, env, operand, operand.loc);
4512845069
}
4512945070
}

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e33071c6142ae5212483a63b87d5d962860e535a
1+
c0060cf2a695d719152c939cfc3cced8f7da3e52
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e33071c6142ae5212483a63b87d5d962860e535a
1+
c0060cf2a695d719152c939cfc3cced8f7da3e52

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ __DEV__ &&
14821482
exports.useTransition = function () {
14831483
return resolveDispatcher().useTransition();
14841484
};
1485-
exports.version = "19.3.0-www-classic-e33071c6-20260224";
1485+
exports.version = "19.3.0-www-classic-c0060cf2-20260224";
14861486
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14871487
"function" ===
14881488
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ __DEV__ &&
14821482
exports.useTransition = function () {
14831483
return resolveDispatcher().useTransition();
14841484
};
1485-
exports.version = "19.3.0-www-modern-e33071c6-20260224";
1485+
exports.version = "19.3.0-www-modern-c0060cf2-20260224";
14861486
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14871487
"function" ===
14881488
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-classic-e33071c6-20260224";
613+
exports.version = "19.3.0-www-classic-c0060cf2-20260224";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-modern-e33071c6-20260224";
613+
exports.version = "19.3.0-www-modern-c0060cf2-20260224";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.3.0-www-classic-e33071c6-20260224";
617+
exports.version = "19.3.0-www-classic-c0060cf2-20260224";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.3.0-www-modern-e33071c6-20260224";
617+
exports.version = "19.3.0-www-modern-c0060cf2-20260224";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20404,10 +20404,10 @@ __DEV__ &&
2040420404
(function () {
2040520405
var internals = {
2040620406
bundleType: 1,
20407-
version: "19.3.0-www-classic-e33071c6-20260224",
20407+
version: "19.3.0-www-classic-c0060cf2-20260224",
2040820408
rendererPackageName: "react-art",
2040920409
currentDispatcherRef: ReactSharedInternals,
20410-
reconcilerVersion: "19.3.0-www-classic-e33071c6-20260224"
20410+
reconcilerVersion: "19.3.0-www-classic-c0060cf2-20260224"
2041120411
};
2041220412
internals.overrideHookState = overrideHookState;
2041320413
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20442,7 +20442,7 @@ __DEV__ &&
2044220442
exports.Shape = Shape;
2044320443
exports.Surface = Surface;
2044420444
exports.Text = Text;
20445-
exports.version = "19.3.0-www-classic-e33071c6-20260224";
20445+
exports.version = "19.3.0-www-classic-c0060cf2-20260224";
2044620446
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2044720447
"function" ===
2044820448
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)