[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.
Sathya Gunasekaran committed
Sep 6, 2023 at 14:12 UTC
a93aa8f3228c32b0a03a8efd2336e15c2a1e10a2
1 file changed
+2
-7
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts
+2
-7
@@ -7,7 +7,7 @@
7
8
import { NodePath } from "@babel/traverse";
9
import * as t from "@babel/types";
10
-import { lowerUseState } from "../Forest";
10
+import { lowerToForest } from "../Forest";
11
import {
12
HIRFunction,
13
ReactiveFunction,
@@ -247,12 +247,7 @@ export function* run(
247
});
248
249
if (config?.enableForest) {
250
- lowerUseState(reactiveFunction);
251
- yield log({
252
- kind: "reactive",
253
- name: "LowerUseState",
254
- value: reactiveFunction,
255
- });
250
+ yield* lowerToForest(reactiveFunction);
251
}
252
253
promoteUsedTemporaries(reactiveFunction);