diff --git a/compiler/apps/playground/components/Editor/index.tsx b/compiler/apps/playground/components/Editor/index.tsx index 341deeeb7e..6154b02edf 100644 --- a/compiler/apps/playground/components/Editor/index.tsx +++ b/compiler/apps/playground/components/Editor/index.tsx @@ -114,7 +114,6 @@ function parsePragma(pragma: string) { let disableAllMemoization = false; let validateRefAccessDuringRender = true; let enableEmitFreeze = null; - let inlineUseMemo = true; let validateHooksUsage = true; let validateFrozenLambdas = true; let assertValidMutableRanges = true; @@ -137,9 +136,6 @@ function parsePragma(pragma: string) { importSpecifierName: "makeReadOnly", }; } - if (pragma.includes("@inlineUseMemo false")) { - inlineUseMemo = false; - } if (pragma.includes("@validateHooksUsage false")) { validateHooksUsage = false; } @@ -153,7 +149,6 @@ function parsePragma(pragma: string) { return { enableAssumeHooksFollowRulesOfReact, disableAllMemoization, - inlineUseMemo, memoizeJsxElements, validateHooksUsage, validateRefAccessDuringRender, 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 79a1ee5b98..772b1a8090 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts @@ -106,10 +106,8 @@ function* runWithEnvironment( pruneMaybeThrows(hir); yield log({ kind: "hir", name: "PruneMaybeThrows", value: hir }); - if (env.config.inlineUseMemo) { - inlineUseMemo(hir); - yield log({ kind: "hir", name: "RewriteUseMemo", value: hir }); - } + inlineUseMemo(hir); + yield log({ kind: "hir", name: "RewriteUseMemo", value: hir }); mergeConsecutiveBlocks(hir); yield log({ kind: "hir", name: "MergeConsecutiveBlocks", value: hir }); diff --git a/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts b/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts index a8d3c67094..fb9ef190eb 100644 --- a/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts +++ b/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts @@ -132,14 +132,6 @@ export type EnvironmentConfig = { */ validateNoSetStateInRender: boolean; - /** - * Enable inlining of `useMemo()` function expressions so that they can be more optimally - * compiled. - * - * Defaults to false - */ - inlineUseMemo: boolean; - /** * When enabled, the compiler assumes that hooks follow the Rules of React: * - Hooks may memoize computation based on any of their parameters, thus @@ -224,7 +216,6 @@ const DEFAULT_ENVIRONMENT_CONFIG: Readonly = { customHooks: null, memoizeJsxElements: true, - inlineUseMemo: true, validateHooksUsage: true, assertValidMutableRanges: false,