Skip to content

Commit 51c6a55

Browse files
committed
[compiler] [playground] Show internals toggle (facebook#34399)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. Before submitting a pull request, please make sure the following is done: 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`. 2. Run `yarn` in the repository root. 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`. 6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect". 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. 9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`). 10. If you haven't already, complete the CLA. Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html --> ## Summary Added a "Show Internals" toggle switch to either show only the Config, Input, Output, and Source Map tabs, or these tabs + all the additional compiler options. The open/close state of these tabs will be preserved (unless on page refresh, which is the same as the currently functionality). <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> ## How did you test this change? <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. How exactly did you verify that your PR solves the issue you wanted to solve? If you leave this empty, your PR will very likely be closed. --> https://github.com/user-attachments/assets/8eb0f69e-360c-4e9b-9155-7aa185a0c018 DiffTrain build for [d4374b3](facebook@d4374b3)
1 parent c2bb6c0 commit 51c6a55

35 files changed

+100
-92
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52206,16 +52206,22 @@ function findProgramSuppressions(programComments, ruleNames, flowSuppressions) {
5220652206
let disableComment = null;
5220752207
let enableComment = null;
5220852208
let source = null;
52209-
const rulePattern = `(${ruleNames.join('|')})`;
52210-
const disableNextLinePattern = new RegExp(`eslint-disable-next-line ${rulePattern}`);
52211-
const disablePattern = new RegExp(`eslint-disable ${rulePattern}`);
52212-
const enablePattern = new RegExp(`eslint-enable ${rulePattern}`);
52209+
let disableNextLinePattern = null;
52210+
let disablePattern = null;
52211+
let enablePattern = null;
52212+
if (ruleNames.length !== 0) {
52213+
const rulePattern = `(${ruleNames.join('|')})`;
52214+
disableNextLinePattern = new RegExp(`eslint-disable-next-line ${rulePattern}`);
52215+
disablePattern = new RegExp(`eslint-disable ${rulePattern}`);
52216+
enablePattern = new RegExp(`eslint-enable ${rulePattern}`);
52217+
}
5221352218
const flowSuppressionPattern = new RegExp('\\$(FlowFixMe\\w*|FlowExpectedError|FlowIssue)\\[react\\-rule');
5221452219
for (const comment of programComments) {
5221552220
if (comment.start == null || comment.end == null) {
5221652221
continue;
5221752222
}
5221852223
if (disableComment == null &&
52224+
disableNextLinePattern != null &&
5221952225
disableNextLinePattern.test(comment.value)) {
5222052226
disableComment = comment;
5222152227
enableComment = comment;
@@ -52228,11 +52234,13 @@ function findProgramSuppressions(programComments, ruleNames, flowSuppressions) {
5222852234
enableComment = comment;
5222952235
source = 'Flow';
5223052236
}
52231-
if (disablePattern.test(comment.value)) {
52237+
if (disablePattern != null && disablePattern.test(comment.value)) {
5223252238
disableComment = comment;
5223352239
source = 'Eslint';
5223452240
}
52235-
if (enablePattern.test(comment.value) && source === 'Eslint') {
52241+
if (enablePattern != null &&
52242+
enablePattern.test(comment.value) &&
52243+
source === 'Eslint') {
5223652244
enableComment = comment;
5223752245
}
5223852246
if (disableComment != null && source != null) {

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f5e96b974073d3ba80dc844d095c49d5b019afe0
1+
d4374b3ae37eb972af6fc492de294a06edd6d325
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f5e96b974073d3ba80dc844d095c49d5b019afe0
1+
d4374b3ae37eb972af6fc492de294a06edd6d325

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ __DEV__ &&
14181418
exports.useTransition = function () {
14191419
return resolveDispatcher().useTransition();
14201420
};
1421-
exports.version = "19.2.0-www-classic-f5e96b97-20250906";
1421+
exports.version = "19.2.0-www-classic-d4374b3a-20250908";
14221422
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14231423
"function" ===
14241424
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
@@ -1418,7 +1418,7 @@ __DEV__ &&
14181418
exports.useTransition = function () {
14191419
return resolveDispatcher().useTransition();
14201420
};
1421-
exports.version = "19.2.0-www-modern-f5e96b97-20250906";
1421+
exports.version = "19.2.0-www-modern-d4374b3a-20250908";
14221422
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14231423
"function" ===
14241424
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
@@ -600,4 +600,4 @@ exports.useSyncExternalStore = function (
600600
exports.useTransition = function () {
601601
return ReactSharedInternals.H.useTransition();
602602
};
603-
exports.version = "19.2.0-www-classic-f5e96b97-20250906";
603+
exports.version = "19.2.0-www-classic-d4374b3a-20250908";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,4 +600,4 @@ exports.useSyncExternalStore = function (
600600
exports.useTransition = function () {
601601
return ReactSharedInternals.H.useTransition();
602602
};
603-
exports.version = "19.2.0-www-modern-f5e96b97-20250906";
603+
exports.version = "19.2.0-www-modern-d4374b3a-20250908";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ exports.useSyncExternalStore = function (
604604
exports.useTransition = function () {
605605
return ReactSharedInternals.H.useTransition();
606606
};
607-
exports.version = "19.2.0-www-classic-f5e96b97-20250906";
607+
exports.version = "19.2.0-www-classic-d4374b3a-20250908";
608608
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
609609
"function" ===
610610
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
@@ -604,7 +604,7 @@ exports.useSyncExternalStore = function (
604604
exports.useTransition = function () {
605605
return ReactSharedInternals.H.useTransition();
606606
};
607-
exports.version = "19.2.0-www-modern-f5e96b97-20250906";
607+
exports.version = "19.2.0-www-modern-d4374b3a-20250908";
608608
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
609609
"function" ===
610610
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
@@ -19708,10 +19708,10 @@ __DEV__ &&
1970819708
(function () {
1970919709
var internals = {
1971019710
bundleType: 1,
19711-
version: "19.2.0-www-classic-f5e96b97-20250906",
19711+
version: "19.2.0-www-classic-d4374b3a-20250908",
1971219712
rendererPackageName: "react-art",
1971319713
currentDispatcherRef: ReactSharedInternals,
19714-
reconcilerVersion: "19.2.0-www-classic-f5e96b97-20250906"
19714+
reconcilerVersion: "19.2.0-www-classic-d4374b3a-20250908"
1971519715
};
1971619716
internals.overrideHookState = overrideHookState;
1971719717
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19745,7 +19745,7 @@ __DEV__ &&
1974519745
exports.Shape = Shape;
1974619746
exports.Surface = Surface;
1974719747
exports.Text = Text;
19748-
exports.version = "19.2.0-www-classic-f5e96b97-20250906";
19748+
exports.version = "19.2.0-www-classic-d4374b3a-20250908";
1974919749
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1975019750
"function" ===
1975119751
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)