Skip to content

Conversation

@EugeneChoi4
Copy link
Contributor

Summary

Removed the old OVERRIDE pragma to make the source of truth for config overrides in the left-hand pane. Now, it will automatically update the output pane each time there is an edit to the config. The old pragma format is still supported, but it will be overwritten by the config pane if they are modifying the same flags. Removed the gating on the config panel so now all users will automatically be able to view it, but it will be initially collapsed.

How did you test this change?

Screen.Recording.2025-09-09.at.3.50.19.PM.mov

@meta-cla meta-cla bot added the CLA Signed label Sep 9, 2025
@EugeneChoi4 EugeneChoi4 marked this pull request as ready for review September 9, 2025 19:59
@EugeneChoi4 EugeneChoi4 added the React Core Team Opened by a member of the React Core Team label Sep 9, 2025
@EugeneChoi4 EugeneChoi4 requested a review from mofeiZ September 9, 2025 20:00
@EugeneChoi4
Copy link
Contributor Author

Hey @mofeiZ, any guidance on what to do for the default config overrides? Should I just leave it empty?

Comment on lines +232 to +243
// Parse config overrides from config editor
let configOverrideOptions: any = {};
const configMatch = configOverrides.match(/^\s*import.*?\n\n\((.*)\)/s);
// TODO: initialize store with URL params, not empty store
if (configOverrides.trim()) {
if (configMatch && configMatch[1]) {
const configString = configMatch[1].replace(/satisfies.*$/, '').trim();
configOverrideOptions = new Function(`return (${configString})`)();
} else {
throw new Error('Invalid config overrides');
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: you can refactor this to a separate function to keep compile clean

Copy link
Contributor

@mofeiZ mofeiZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

enableReanimatedCheck: true,
customOptOutDirectives: null,
target: '19',
panicThreshold: 'all_errors',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's figure out the panicThreshold override in a followup.
irrc we're currently using panicThreshold: 'none' along with a separate linting pass (to record warning diagnostics)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'll just remove panicThreshold for now then

@EugeneChoi4 EugeneChoi4 merged commit fe84397 into facebook:main Sep 11, 2025
21 checks passed
@EugeneChoi4 EugeneChoi4 deleted the compiler-playground-config/4 branch September 11, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants