From a93aa8f3228c32b0a03a8efd2336e15c2a1e10a2 Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Wed, 6 Sep 2023 14:12:11 +0100 Subject: [PATCH] [hir] Encapsulate pipeline from rest of Forget Future passes will lead to inconsistent state between passes and will require passes to run in a specific order, so let's make sure no one will misconfigure the passes. --- .../babel-plugin-react-forget/src/Entrypoint/Pipeline.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 0ae11aafe7..68179ba8d1 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts @@ -7,7 +7,7 @@ import { NodePath } from "@babel/traverse"; import * as t from "@babel/types"; -import { lowerUseState } from "../Forest"; +import { lowerToForest } from "../Forest"; import { HIRFunction, ReactiveFunction, @@ -247,12 +247,7 @@ export function* run( }); if (config?.enableForest) { - lowerUseState(reactiveFunction); - yield log({ - kind: "reactive", - name: "LowerUseState", - value: reactiveFunction, - }); + yield* lowerToForest(reactiveFunction); } promoteUsedTemporaries(reactiveFunction);