@samitouri / QOS-React / commits / a4234bcfbf

infer mode only compiles component/hook decls

Forks the logic from Program.ts, letting us customize what gets compiled.

Joe Savona committed Feb 17, 2024 at 17:37 UTC a4234bcfbff4dc209b06f8d4612ef71410333bcb
2 files changed +2 -1
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts
+1 -1
@@ -374,7 +374,7 @@ export function compileProgram(
374 }
375 }
376
377 -export function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean {
377 +function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean {
378 if (hasUseMemoCacheCall(fn)) {
379 return false;
380 }
compiler/packages/sprout/src/SproutTodoFilter.ts
+1
@@ -437,6 +437,7 @@ const skipFilter = new Set([
437 "forest/forest-object-type-valid.flow",
438 "forest/forest-partial-reassignment-type-annotation.flow",
439 "forest/todo-forest-phi-type-unused-initializer.flow",
440 + "forest/forest-hook.flow",
441
442 // TODO: we probably want to always skip these
443 "rules-of-hooks/rules-of-hooks-0592bd574811",