This commit is contained in:
Sathya Gunasekaran
2023-08-31 11:15:41 +01:00
parent c456662318
commit da61d47e87
2 changed files with 8 additions and 0 deletions
@@ -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,