mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add flag
This commit is contained in:
@@ -50,6 +50,9 @@ export type Hook = {
|
||||
export type EnvironmentConfig = Partial<{
|
||||
customHooks: Map<string, Hook>;
|
||||
|
||||
// 🌲
|
||||
enableForest: boolean;
|
||||
|
||||
/**
|
||||
* Enable memoization of JSX elements in addition to other types of values. When disabled,
|
||||
* other types (objects, arrays, call expressions, etc) are memoized, but not known JSX
|
||||
|
||||
@@ -28,6 +28,7 @@ export function transformFixtureInput(
|
||||
let validateNoSetStateInRender = true;
|
||||
let enableEmitFreeze = null;
|
||||
let compilationMode: CompilationMode = "all";
|
||||
let enableForest = false;
|
||||
|
||||
if (firstLine.indexOf("@compilationMode(annotation)") !== -1) {
|
||||
assert(
|
||||
@@ -83,6 +84,9 @@ export function transformFixtureInput(
|
||||
importSpecifierName: "makeReadOnly",
|
||||
};
|
||||
}
|
||||
if (firstLine.includes("@enableForest true")) {
|
||||
enableForest = true;
|
||||
}
|
||||
|
||||
return pluginFn(
|
||||
input,
|
||||
@@ -111,6 +115,7 @@ export function transformFixtureInput(
|
||||
validateNoSetStateInRender,
|
||||
enableEmitFreeze,
|
||||
assertValidMutableRanges: true,
|
||||
enableForest,
|
||||
},
|
||||
compilationMode,
|
||||
logger: null,
|
||||
|
||||
Reference in New Issue
Block a user