diff --git a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts index f86743c1c3..0ae11aafe7 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts @@ -7,6 +7,7 @@ import { NodePath } from "@babel/traverse"; import * as t from "@babel/types"; +import { lowerUseState } from "../Forest"; import { HIRFunction, ReactiveFunction, @@ -245,6 +246,15 @@ export function* run( value: reactiveFunction, }); + if (config?.enableForest) { + lowerUseState(reactiveFunction); + yield log({ + kind: "reactive", + name: "LowerUseState", + value: reactiveFunction, + }); + } + promoteUsedTemporaries(reactiveFunction); yield log({ kind: "reactive", diff --git a/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/index.ts b/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/index.ts index 698dc600fb..5de4cc9424 100644 --- a/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/index.ts +++ b/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/index.ts @@ -28,3 +28,9 @@ export { pruneTemporaryLValues as pruneUnusedLValues } from "./PruneTemporaryLVa export { pruneUnusedLabels } from "./PruneUnusedLabels"; export { pruneUnusedScopes } from "./PruneUnusedScopes"; export { renameVariables } from "./RenameVariables"; +export { + ReactiveFunctionTransform, + Transformed, + eachReactiveValueOperand, + visitReactiveFunction, +} from "./visitors";