[compiler][playground] Make change detection work in playground

Summary: The change detection mode was unavailable in the playground because the pragma was not a boolean. This fixes that by special casing it in pragma parsing, similar to validateNoCapitalizedCalls

ghstack-source-id: 4a8c17d21ab8b7936ca61c9dd1f7fdf8322614c9
Pull Request resolved: https://github.com/facebook/react/pull/29889
This commit is contained in:
Mike Vitousek
2024-06-13 11:02:47 -07:00
parent 7bb830682c
commit 2e22c8f186
@@ -410,6 +410,17 @@ export function parseConfigPragma(pragma: string): EnvironmentConfig {
continue;
}
if (
key === "enableChangeDetectionForDebugging" &&
(val === undefined || val === "true")
) {
maybeConfig[key] = {
source: "react-compiler-runtime",
importSpecifierName: "$structuralCheck",
};
continue;
}
if (typeof defaultConfig[key as keyof EnvironmentConfig] !== "boolean") {
// skip parsing non-boolean properties
continue;