From a4234bcfbff4dc209b06f8d4612ef71410333bcb Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Sat, 17 Feb 2024 17:37:00 -0800 Subject: [PATCH] infer mode only compiles component/hook decls Forks the logic from Program.ts, letting us customize what gets compiled. --- .../babel-plugin-react-forget/src/Entrypoint/Program.ts | 2 +- compiler/packages/sprout/src/SproutTodoFilter.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts index 69f2bfaba9..48794a07b5 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts @@ -374,7 +374,7 @@ export function compileProgram( } } -export function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean { +function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean { if (hasUseMemoCacheCall(fn)) { return false; } diff --git a/compiler/packages/sprout/src/SproutTodoFilter.ts b/compiler/packages/sprout/src/SproutTodoFilter.ts index 619b81a458..6f643f8482 100644 --- a/compiler/packages/sprout/src/SproutTodoFilter.ts +++ b/compiler/packages/sprout/src/SproutTodoFilter.ts @@ -437,6 +437,7 @@ const skipFilter = new Set([ "forest/forest-object-type-valid.flow", "forest/forest-partial-reassignment-type-annotation.flow", "forest/todo-forest-phi-type-unused-initializer.flow", + "forest/forest-hook.flow", // TODO: we probably want to always skip these "rules-of-hooks/rules-of-hooks-0592bd574811",