@samitouri / QOS-React / commits / 11d03ffbe0

Promote enableFunctionCallSignatureOptimizations to stable (remove flag)

Per title, this feature flag is enabled everywhere and is clearly stable, let's promote to stable and remove the flag to simplify.

Joe Savona committed Oct 5, 2023 at 09:20 UTC 11d03ffbe08e0366dddf04c49668ca6da72b089d
4 files changed +2 -23
compiler/apps/playground/components/Editor/index.tsx
-5
@@ -116,7 +116,6 @@ function parsePragma(pragma: string) {
116 let enableEmitFreeze = null;
117 let inlineUseMemo = true;
118 let validateHooksUsage = true;
119 - let enableFunctionCallSignatureOptimizations = true;
119 let validateFrozenLambdas = true;
120 let assertValidMutableRanges = true;
121
@@ -141,9 +140,6 @@ function parsePragma(pragma: string) {
140 if (pragma.includes("@inlineUseMemo false")) {
141 inlineUseMemo = false;
142 }
144 - if (pragma.includes("@enableFunctionCallSignatureOptimizations false")) {
145 - enableFunctionCallSignatureOptimizations = false;
146 - }
143 if (pragma.includes("@validateHooksUsage false")) {
144 validateHooksUsage = false;
145 }
@@ -156,7 +152,6 @@ function parsePragma(pragma: string) {
152
153 return {
154 enableAssumeHooksFollowRulesOfReact,
159 - enableFunctionCallSignatureOptimizations,
155 disableAllMemoization,
156 inlineUseMemo,
157 memoizeJsxElements,
compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts
-8
@@ -140,13 +140,6 @@ export type EnvironmentConfig = {
140 */
141 inlineUseMemo: boolean;
142
143 - /**
144 - * Enable optimizations based on the signature of (non-method) built-in function calls.
145 - *
146 - * Defaults to false
147 - */
148 - enableFunctionCallSignatureOptimizations: boolean;
149 -
143 /**
144 * Enable optimizations based on the `noAlias` flag of method signatures. When enabled,
145 * function signatures can declare that they do not alias their arguments, allowing
@@ -240,7 +233,6 @@ const DEFAULT_ENVIRONMENT_CONFIG: Readonly<EnvironmentConfig> = {
233 customHooks: null,
234
235 memoizeJsxElements: true,
243 - enableFunctionCallSignatureOptimizations: true,
236 inlineUseMemo: true,
237 validateHooksUsage: true,
238 enableNoAliasOptimizations: true,
compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts
+1 -6
@@ -742,15 +742,10 @@ function inferBlock(
742 continue;
743 }
744 case "CallExpression": {
745 - let signature = getFunctionCallSignature(
745 + const signature = getFunctionCallSignature(
746 env,
747 instrValue.callee.identifier.type
748 );
749 - signature =
750 - env.config.enableFunctionCallSignatureOptimizations ||
751 - signature?.hookKind != null
752 - ? signature
753 - : null;
749
750 const effects =
751 signature !== null ? getFunctionEffects(instrValue, signature) : null;
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/InferReactiveScopeVariables.ts
+1 -4
@@ -250,10 +250,7 @@ function mayAllocate(env: Environment, instruction: Instruction): boolean {
250 }
251 case "CallExpression":
252 case "MethodCall": {
253 - if (env.config.enableFunctionCallSignatureOptimizations) {
254 - return instruction.lvalue.identifier.type.kind !== "Primitive";
255 - }
256 - return true;
253 + return instruction.lvalue.identifier.type.kind !== "Primitive";
254 }
255 case "RegExpLiteral":
256 case "PropertyStore":