From fd2b3e13d330a4559f5aa21462e1cb2cbbcf144b Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Thu, 18 Jul 2024 17:00:24 -0400 Subject: [PATCH] Compiler: unfork prettier config (#30205) Updates the prettier config to format all `.ts` and `.tsx` files in the repo using the existing defaults and removing overrides. The first commit in this PR contains the config changes, the second is just the result of running `yarn prettier-all`. --- .prettierrc.js | 22 +- .../playground/__tests__/e2e/page.spec.ts | 28 +- compiler/apps/playground/app/index.tsx | 22 +- compiler/apps/playground/app/layout.tsx | 19 +- compiler/apps/playground/app/page.tsx | 11 +- compiler/apps/playground/babel.config.js | 6 +- compiler/apps/playground/colors.js | 132 +- .../components/Editor/EditorImpl.tsx | 134 +- .../playground/components/Editor/Input.tsx | 55 +- .../playground/components/Editor/Output.tsx | 109 +- .../playground/components/Editor/index.tsx | 4 +- .../components/Editor/monacoOptions.ts | 16 +- .../apps/playground/components/Header.tsx | 41 +- .../components/Icons/IconGitHub.tsx | 9 +- compiler/apps/playground/components/Logo.tsx | 5 +- .../apps/playground/components/Message.tsx | 24 +- .../playground/components/StoreContext.tsx | 24 +- .../playground/components/TabbedWindow.tsx | 23 +- compiler/apps/playground/components/index.ts | 6 +- compiler/apps/playground/hooks/index.ts | 2 +- .../apps/playground/hooks/useMountEffect.ts | 4 +- compiler/apps/playground/lib/createContext.ts | 6 +- compiler/apps/playground/lib/defaultStore.ts | 4 +- .../lib/reactCompilerMonacoDiagnostics.ts | 26 +- compiler/apps/playground/lib/stores/index.ts | 4 +- .../apps/playground/lib/stores/messages.ts | 6 +- compiler/apps/playground/lib/stores/store.ts | 20 +- compiler/apps/playground/next.config.js | 16 +- compiler/apps/playground/playwright.config.js | 18 +- .../apps/playground/scripts/downloadFonts.js | 8 +- compiler/apps/playground/tailwind.config.js | 28 +- .../jest.config.js | 2 +- .../rollup.config.js | 34 +- .../babel-plugin-annotate-react-code.ts | 92 +- .../scripts/build-react-hooks-fixures.js | 52 +- .../eslint-plugin-react-hooks-test-cases.js | 6 +- .../scripts/jest/e2e-classic.config.js | 4 +- .../scripts/jest/e2e-forget.config.js | 6 +- .../scripts/jest/main.config.js | 8 +- .../scripts/jest/makeE2EConfig.js | 22 +- .../scripts/jest/makeSnapshotResolver.js | 4 +- .../scripts/jest/makeTransform.ts | 62 +- .../scripts/jest/setupEnvE2E.js | 2 +- .../jest/snapshot-resolver-no-forget.js | 2 +- .../jest/snapshot-resolver-with-forget.js | 2 +- .../scripts/jest/transform-no-forget.js | 2 +- .../scripts/jest/transform-with-forget.js | 2 +- .../src/Babel/BabelPlugin.ts | 14 +- .../src/Babel/RunReactCompilerBabelPlugin.ts | 30 +- .../src/CompilerError.ts | 60 +- .../src/Entrypoint/Gating.ts | 41 +- .../src/Entrypoint/Imports.ts | 62 +- .../src/Entrypoint/Options.ts | 48 +- .../src/Entrypoint/Pipeline.ts | 248 +-- .../src/Entrypoint/Program.ts | 320 +-- .../src/Entrypoint/Reanimated.ts | 18 +- .../src/Entrypoint/Suppression.ts | 46 +- .../src/Entrypoint/index.ts | 12 +- .../src/HIR/AssertConsistentIdentifiers.ts | 12 +- .../src/HIR/AssertTerminalBlocksExist.ts | 18 +- .../src/HIR/AssertValidBlockNesting.ts | 24 +- .../src/HIR/AssertValidMutableRanges.ts | 10 +- .../src/HIR/BuildHIR.ts | 1714 ++++++++--------- .../src/HIR/BuildReactiveScopeTerminalsHIR.ts | 36 +- .../src/HIR/ComputeUnconditionalBlocks.ts | 6 +- .../src/HIR/Dominator.ts | 24 +- .../src/HIR/Environment.ts | 110 +- .../src/HIR/FindContextIdentifiers.ts | 54 +- .../src/HIR/Globals.ts | 296 +-- .../src/HIR/HIR.ts | 414 ++-- .../src/HIR/HIRBuilder.ts | 134 +- .../src/HIR/MergeConsecutiveBlocks.ts | 24 +- .../HIR/MergeOverlappingReactiveScopesHIR.ts | 40 +- .../src/HIR/ObjectShape.ts | 214 +- .../src/HIR/PrintHIR.ts | 494 ++--- .../src/HIR/PruneUnusedLabelsHIR.ts | 20 +- .../src/HIR/Types.ts | 72 +- .../src/HIR/index.ts | 28 +- .../src/HIR/visitors.ts | 586 +++--- .../src/Inference/AnalyseFunctions.ts | 46 +- .../src/Inference/DropManualMemoization.ts | 100 +- .../src/Inference/InferAlias.ts | 24 +- .../src/Inference/InferAliasForPhis.ts | 6 +- .../src/Inference/InferAliasForStores.ts | 14 +- .../Inference/InferMutableContextVariables.ts | 20 +- .../src/Inference/InferMutableLifetimes.ts | 24 +- .../src/Inference/InferMutableRanges.ts | 14 +- .../Inference/InferMutableRangesForAlias.ts | 8 +- .../src/Inference/InferReactivePlaces.ts | 48 +- .../src/Inference/InferReferenceEffects.ts | 406 ++-- .../src/Inference/InferTryCatchAliases.ts | 12 +- ...neImmediatelyInvokedFunctionExpressions.ts | 38 +- .../src/Inference/index.ts | 12 +- .../src/Optimization/ConstantPropagation.ts | 222 +-- .../src/Optimization/DeadCodeElimination.ts | 126 +- .../src/Optimization/InstructionReordering.ts | 86 +- .../src/Optimization/OutlineFunctions.ts | 14 +- .../src/Optimization/PruneMaybeThrows.ts | 22 +- .../src/Optimization/index.ts | 6 +- .../ReactiveScopes/AlignMethodCallScopes.ts | 16 +- .../ReactiveScopes/AlignObjectMethodScopes.ts | 30 +- .../AlignReactiveScopesToBlockScopes.ts | 18 +- .../AlignReactiveScopesToBlockScopesHIR.ts | 54 +- .../AssertScopeInstructionsWithinScope.ts | 18 +- .../AssertWellFormedBreakTargets.ts | 12 +- .../src/ReactiveScopes/BuildReactiveBlocks.ts | 60 +- .../ReactiveScopes/BuildReactiveFunction.ts | 360 ++-- .../ReactiveScopes/CodegenReactiveFunction.ts | 999 +++++----- .../CollectReactiveIdentifiers.ts | 12 +- .../CollectReferencedGlobals.ts | 14 +- .../DeriveMinimalDependencies.ts | 86 +- ...tractScopeDeclarationsFromDestructuring.ts | 28 +- .../ReactiveScopes/FlattenReactiveLoops.ts | 44 +- .../ReactiveScopes/FlattenReactiveLoopsHIR.ts | 56 +- .../FlattenScopesWithHooksOrUse.ts | 20 +- .../FlattenScopesWithHooksOrUseHIR.ts | 30 +- .../InferReactiveScopeVariables.ts | 126 +- .../MemoizeFbtAndMacroOperandsInSameScope.ts | 58 +- .../MergeOverlappingReactiveScopes.ts | 34 +- ...rgeReactiveScopesThatInvalidateTogether.ts | 108 +- .../ReactiveScopes/PrintReactiveFunction.ts | 174 +- .../ReactiveScopes/PromoteUsedTemporaries.ts | 32 +- .../ReactiveScopes/PropagateEarlyReturns.ts | 82 +- .../PropagateScopeDependencies.ts | 173 +- .../ReactiveScopes/PruneAllReactiveScopes.ts | 8 +- .../PruneAlwaysInvalidatingScopes.ts | 36 +- .../ReactiveScopes/PruneHoistedContexts.ts | 22 +- .../PruneInitializationDependencies.ts | 98 +- .../ReactiveScopes/PruneNonEscapingScopes.ts | 274 +-- .../PruneNonReactiveDependencies.ts | 24 +- .../ReactiveScopes/PruneTemporaryLValues.ts | 6 +- .../src/ReactiveScopes/PruneUnusedLabels.ts | 22 +- .../src/ReactiveScopes/PruneUnusedScopes.ts | 16 +- .../src/ReactiveScopes/RenameVariables.ts | 22 +- .../src/ReactiveScopes/StabilizeBlockIds.ts | 22 +- .../src/ReactiveScopes/index.ts | 59 +- .../src/ReactiveScopes/visitors.ts | 254 +-- .../src/SSA/EliminateRedundantPhi.ts | 22 +- .../src/SSA/EnterSSA.ts | 52 +- .../src/SSA/LeaveSSA.ts | 96 +- .../src/SSA/index.ts | 6 +- .../src/TypeInference/InferTypes.ts | 272 +-- .../src/TypeInference/index.ts | 2 +- .../src/Utils/ComponentDeclaration.ts | 8 +- .../src/Utils/DisjointSet.ts | 4 +- .../src/Utils/HookDeclaration.ts | 8 +- .../src/Utils/Stack.ts | 2 +- .../src/Utils/logger.ts | 28 +- .../src/Utils/todo.ts | 6 +- .../src/Utils/utils.ts | 16 +- .../ValidateContextVariableLValues.ts | 69 +- .../src/Validation/ValidateHooksUsage.ts | 90 +- .../ValidateLocalsNotReassignedAfterRender.ts | 48 +- .../ValidateMemoizedEffectDependencies.ts | 20 +- .../Validation/ValidateNoCapitalizedCalls.ts | 20 +- .../Validation/ValidateNoRefAccesInRender.ts | 78 +- .../Validation/ValidateNoSetStateInRender.ts | 42 +- .../ValidatePreservedManualMemoization.ts | 124 +- .../src/Validation/ValidateUseMemo.ts | 30 +- .../src/Validation/index.ts | 16 +- .../src/__tests__/DisjointSet-test.ts | 22 +- .../src/__tests__/Logger-test.ts | 60 +- .../src/__tests__/Result-test.ts | 114 +- .../src/__tests__/e2e/constant-prop.e2e.js | 32 +- .../src/__tests__/e2e/hello.e2e.js | 18 +- .../src/__tests__/e2e/update-button.e2e.js | 16 +- .../__tests__/e2e/update-expressions.e2e.js | 10 +- .../src/__tests__/e2e/use-state.e2e.js | 22 +- .../src/__tests__/envConfig-test.ts | 22 +- ...re-in-method-receiver-and-mutate.expect.md | 2 +- ...s-capture-in-method-receiver-and-mutate.js | 2 +- .../compiler/alias-computed-load.expect.md | 4 +- .../fixtures/compiler/alias-computed-load.js | 4 +- .../align-scope-starts-within-cond.expect.md | 2 +- .../align-scope-starts-within-cond.ts | 2 +- ...fe-return-modified-later-logical.expect.md | 4 +- ...opes-iife-return-modified-later-logical.ts | 4 +- ...gn-scopes-nested-block-structure.expect.md | 16 +- .../align-scopes-nested-block-structure.ts | 16 +- ...copes-reactive-scope-overlaps-if.expect.md | 14 +- ...align-scopes-reactive-scope-overlaps-if.ts | 14 +- ...es-reactive-scope-overlaps-label.expect.md | 14 +- ...gn-scopes-reactive-scope-overlaps-label.ts | 14 +- ...opes-reactive-scope-overlaps-try.expect.md | 8 +- ...lign-scopes-reactive-scope-overlaps-try.ts | 8 +- ...rycatch-nested-overlapping-range.expect.md | 2 +- ...copes-trycatch-nested-overlapping-range.ts | 2 +- ...ithin-nested-valueblock-in-array.expect.md | 10 +- ...opes-within-nested-valueblock-in-array.tsx | 10 +- ...cal-expression-instruction-scope.expect.md | 4 +- ...ng-logical-expression-instruction-scope.ts | 4 +- ...ng-primitive-as-dep-nested-scope.expect.md | 12 +- ...llocating-primitive-as-dep-nested-scope.js | 12 +- ...n-in-effect-indirect-usecallback.expect.md | 2 +- ...mutation-in-effect-indirect-usecallback.js | 2 +- ...obal-mutation-in-effect-indirect.expect.md | 2 +- ...llow-global-mutation-in-effect-indirect.js | 2 +- ...obal-mutation-unused-usecallback.expect.md | 2 +- ...llow-global-mutation-unused-usecallback.js | 2 +- ...-reassignment-in-effect-indirect.expect.md | 2 +- ...-global-reassignment-in-effect-indirect.js | 2 +- ...ow-global-reassignment-in-effect.expect.md | 2 +- .../allow-global-reassignment-in-effect.js | 2 +- ...ow-modify-global-in-callback-jsx.expect.md | 18 +- .../allow-modify-global-in-callback-jsx.js | 18 +- ...mutate-global-in-effect-fixpoint.expect.md | 6 +- .../allow-mutate-global-in-effect-fixpoint.js | 6 +- ...-callback-passed-to-jsx-indirect.expect.md | 4 +- ...ref-in-callback-passed-to-jsx-indirect.tsx | 4 +- ...ng-ref-in-callback-passed-to-jsx.expect.md | 4 +- ...mutating-ref-in-callback-passed-to-jsx.tsx | 4 +- ...-callback-passed-to-jsx-indirect.expect.md | 4 +- ...rty-in-callback-passed-to-jsx-indirect.tsx | 4 +- ...operty-in-callback-passed-to-jsx.expect.md | 4 +- ...ref-property-in-callback-passed-to-jsx.tsx | 4 +- ...ow-ref-access-in-effect-indirect.expect.md | 6 +- .../allow-ref-access-in-effect-indirect.js | 6 +- .../allow-ref-access-in-effect.expect.md | 6 +- .../compiler/allow-ref-access-in-effect.js | 6 +- ...access-in-unused-callback-nested.expect.md | 6 +- ...ow-ref-access-in-unused-callback-nested.js | 6 +- .../array-access-assignment.expect.md | 14 +- .../compiler/array-access-assignment.js | 14 +- .../array-concat-should-capture.expect.md | 10 +- .../compiler/array-concat-should-capture.ts | 10 +- .../array-expression-spread.expect.md | 4 +- .../compiler/array-expression-spread.js | 4 +- .../fixtures/compiler/array-join.expect.md | 2 +- .../__tests__/fixtures/compiler/array-join.js | 2 +- ...ay-map-captures-receiver-noAlias.expect.md | 6 +- .../array-map-captures-receiver-noAlias.js | 6 +- .../array-map-frozen-array-noAlias.expect.md | 2 +- .../array-map-frozen-array-noAlias.js | 2 +- .../compiler/array-map-frozen-array.expect.md | 2 +- .../compiler/array-map-frozen-array.js | 2 +- ...le-array-mutating-lambda-noAlias.expect.md | 2 +- ...p-mutable-array-mutating-lambda-noAlias.js | 2 +- ...ap-mutable-array-mutating-lambda.expect.md | 2 +- ...array-map-mutable-array-mutating-lambda.js | 2 +- ...n-mutating-lambda-mutated-result.expect.md | 2 +- ...rray-non-mutating-lambda-mutated-result.js | 2 +- ...ay-map-noAlias-escaping-function.expect.md | 4 +- .../array-map-noAlias-escaping-function.js | 4 +- .../compiler/array-pattern-params.expect.md | 6 +- .../fixtures/compiler/array-pattern-params.js | 6 +- .../compiler/array-properties.expect.md | 6 +- .../fixtures/compiler/array-properties.js | 6 +- .../compiler/array-property-call.expect.md | 6 +- .../fixtures/compiler/array-property-call.js | 6 +- .../compiler/array-push-effect.expect.md | 2 +- .../fixtures/compiler/array-push-effect.js | 2 +- .../compiler/arrow-expr-directive.expect.md | 6 +- .../fixtures/compiler/arrow-expr-directive.js | 6 +- ...rrow-function-one-line-directive.expect.md | 2 +- .../arrow-function-one-line-directive.js | 2 +- .../assignment-expression-computed.expect.md | 4 +- .../assignment-expression-computed.js | 4 +- ...ssignment-expression-nested-path.expect.md | 4 +- .../assignment-expression-nested-path.js | 4 +- ...gnment-variations-complex-lvalue.expect.md | 2 +- .../assignment-variations-complex-lvalue.js | 2 +- .../babel-existing-react-import.expect.md | 2 +- .../compiler/babel-existing-react-import.js | 2 +- ...xisting-react-kitchensink-import.expect.md | 4 +- ...babel-existing-react-kitchensink-import.js | 4 +- ...-existing-react-namespace-import.expect.md | 4 +- .../babel-existing-react-namespace-import.js | 4 +- .../block-scoping-switch-dead-code.expect.md | 2 +- .../block-scoping-switch-dead-code.js | 2 +- ...-scoping-switch-variable-scoping.expect.md | 6 +- .../block-scoping-switch-variable-scoping.js | 6 +- .../bug-codegen-inline-iife.expect.md | 4 +- .../compiler/bug-codegen-inline-iife.ts | 4 +- ...ug-invalid-hoisting-functionexpr.expect.md | 6 +- .../bug-invalid-hoisting-functionexpr.tsx | 6 +- .../capitalized-function-allowlist.expect.md | 4 +- .../capitalized-function-allowlist.js | 4 +- ...pture-indirect-mutate-alias-iife.expect.md | 2 +- .../capture-indirect-mutate-alias-iife.js | 2 +- .../capture-indirect-mutate-alias.expect.md | 6 +- .../compiler/capture-indirect-mutate-alias.js | 6 +- .../compiler/capture-param-mutate.expect.md | 10 +- .../fixtures/compiler/capture-param-mutate.js | 10 +- .../capture-ref-for-later-mutation.expect.md | 12 +- .../capture-ref-for-later-mutation.tsx | 12 +- .../capture_mutate-across-fns-iife.expect.md | 2 +- .../capture_mutate-across-fns-iife.js | 2 +- .../capture_mutate-across-fns.expect.md | 6 +- .../compiler/capture_mutate-across-fns.js | 6 +- .../capturing-arrow-function-1.expect.md | 6 +- .../compiler/capturing-arrow-function-1.js | 6 +- ...fun-alias-captured-mutate-2-iife.expect.md | 10 +- ...turing-fun-alias-captured-mutate-2-iife.js | 10 +- ...ring-fun-alias-captured-mutate-2.expect.md | 6 +- .../capturing-fun-alias-captured-mutate-2.js | 6 +- ...alias-captured-mutate-arr-2-iife.expect.md | 8 +- ...ng-fun-alias-captured-mutate-arr-2-iife.js | 8 +- ...-fun-alias-captured-mutate-arr-2.expect.md | 4 +- ...pturing-fun-alias-captured-mutate-arr-2.js | 4 +- ...c-alias-captured-mutate-arr-iife.expect.md | 8 +- ...ing-func-alias-captured-mutate-arr-iife.js | 8 +- ...g-func-alias-captured-mutate-arr.expect.md | 4 +- ...apturing-func-alias-captured-mutate-arr.js | 4 +- ...-func-alias-captured-mutate-iife.expect.md | 10 +- ...pturing-func-alias-captured-mutate-iife.js | 10 +- ...uring-func-alias-captured-mutate.expect.md | 6 +- .../capturing-func-alias-captured-mutate.js | 6 +- ...-func-alias-computed-mutate-iife.expect.md | 8 +- ...pturing-func-alias-computed-mutate-iife.js | 8 +- ...uring-func-alias-computed-mutate.expect.md | 4 +- .../capturing-func-alias-computed-mutate.js | 4 +- ...capturing-func-alias-mutate-iife.expect.md | 6 +- .../capturing-func-alias-mutate-iife.js | 6 +- .../capturing-func-alias-mutate.expect.md | 2 +- .../compiler/capturing-func-alias-mutate.js | 2 +- ...as-receiver-computed-mutate-iife.expect.md | 8 +- ...unc-alias-receiver-computed-mutate-iife.js | 8 +- ...c-alias-receiver-computed-mutate.expect.md | 4 +- ...ing-func-alias-receiver-computed-mutate.js | 4 +- ...-func-alias-receiver-mutate-iife.expect.md | 6 +- ...pturing-func-alias-receiver-mutate-iife.js | 6 +- ...uring-func-alias-receiver-mutate.expect.md | 2 +- .../capturing-func-alias-receiver-mutate.js | 2 +- .../capturing-func-mutate-2.expect.md | 6 +- .../compiler/capturing-func-mutate-2.js | 6 +- .../capturing-func-mutate-3.expect.md | 8 +- .../compiler/capturing-func-mutate-3.js | 8 +- .../capturing-func-mutate-nested.expect.md | 6 +- .../compiler/capturing-func-mutate-nested.js | 6 +- .../compiler/capturing-func-mutate.expect.md | 8 +- .../compiler/capturing-func-mutate.js | 8 +- ...capturing-func-simple-alias-iife.expect.md | 6 +- .../capturing-func-simple-alias-iife.js | 6 +- .../capturing-func-simple-alias.expect.md | 2 +- .../compiler/capturing-func-simple-alias.js | 2 +- .../compiler/capturing-function-1.expect.md | 6 +- .../fixtures/compiler/capturing-function-1.js | 6 +- ...ction-alias-computed-load-2-iife.expect.md | 2 +- ...ing-function-alias-computed-load-2-iife.js | 2 +- ...g-function-alias-computed-load-2.expect.md | 2 +- ...apturing-function-alias-computed-load-2.js | 2 +- ...ction-alias-computed-load-4-iife.expect.md | 2 +- ...ing-function-alias-computed-load-4-iife.js | 2 +- ...g-function-alias-computed-load-4.expect.md | 2 +- ...apturing-function-alias-computed-load-4.js | 2 +- ...unction-alias-computed-load-iife.expect.md | 2 +- ...uring-function-alias-computed-load-iife.js | 2 +- ...ing-function-alias-computed-load.expect.md | 4 +- .../capturing-function-alias-computed-load.js | 4 +- ...nction-capture-ref-before-rename.expect.md | 6 +- ...ring-function-capture-ref-before-rename.js | 6 +- ...ction-conditional-capture-mutate.expect.md | 2 +- ...ing-function-conditional-capture-mutate.js | 2 +- .../capturing-function-decl.expect.md | 6 +- .../compiler/capturing-function-decl.js | 6 +- ...g-function-member-expr-arguments.expect.md | 2 +- ...apturing-function-member-expr-arguments.js | 2 +- ...turing-function-member-expr-call.expect.md | 2 +- .../capturing-function-member-expr-call.js | 2 +- .../capturing-function-renamed-ref.expect.md | 4 +- .../capturing-function-renamed-ref.js | 4 +- ...apturing-function-runs-inference.expect.md | 2 +- .../capturing-function-runs-inference.js | 2 +- ...pturing-function-shadow-captured.expect.md | 2 +- .../capturing-function-shadow-captured.js | 2 +- ...ring-function-skip-computed-path.expect.md | 8 +- .../capturing-function-skip-computed-path.js | 8 +- .../capturing-function-within-block.expect.md | 6 +- .../capturing-function-within-block.js | 6 +- .../compiler/capturing-member-expr.expect.md | 6 +- .../compiler/capturing-member-expr.js | 6 +- .../capturing-nested-member-call.expect.md | 6 +- .../compiler/capturing-nested-member-call.js | 6 +- ...ested-member-expr-in-nested-func.expect.md | 6 +- ...uring-nested-member-expr-in-nested-func.js | 6 +- .../capturing-nested-member-expr.expect.md | 6 +- .../compiler/capturing-nested-member-expr.js | 6 +- ...capturing-reference-changes-type.expect.md | 2 +- .../capturing-reference-changes-type.js | 2 +- ...pturing-variable-in-nested-block.expect.md | 6 +- .../capturing-variable-in-nested-block.js | 6 +- ...ring-variable-in-nested-function.expect.md | 6 +- .../capturing-variable-in-nested-function.js | 6 +- ...ined-assignment-context-variable.expect.md | 2 +- .../chained-assignment-context-variable.js | 2 +- .../chained-assignment-expressions.expect.md | 6 +- .../chained-assignment-expressions.js | 6 +- ...en-instrument-forget-gating-test.expect.md | 4 +- .../codegen-instrument-forget-gating-test.js | 4 +- .../codegen-instrument-forget-test.expect.md | 4 +- .../codegen-instrument-forget-test.js | 4 +- .../fixtures/compiler/complex-while.expect.md | 4 +- .../fixtures/compiler/complex-while.js | 4 +- ...nt-inner-function-with-many-args.expect.md | 4 +- ...omponent-inner-function-with-many-args.tsx | 4 +- .../fixtures/compiler/component.expect.md | 4 +- .../__tests__/fixtures/compiler/component.js | 4 +- .../computed-call-evaluation-order.expect.md | 10 +- .../computed-call-evaluation-order.js | 10 +- .../compiler/computed-store-alias.expect.md | 6 +- .../fixtures/compiler/computed-store-alias.js | 6 +- .../compiler/concise-arrow-expr.expect.md | 2 +- .../fixtures/compiler/concise-arrow-expr.js | 2 +- .../conditional-break-labeled.expect.md | 4 +- .../compiler/conditional-break-labeled.js | 4 +- .../conditional-early-return.expect.md | 2 +- .../compiler/conditional-early-return.js | 2 +- .../conditional-set-state-in-render.expect.md | 4 +- .../conditional-set-state-in-render.js | 4 +- ...conflicting-dollar-sign-variable.expect.md | 4 +- .../conflicting-dollar-sign-variable.js | 4 +- .../compiler/consecutive-use-memo.expect.md | 10 +- .../fixtures/compiler/consecutive-use-memo.ts | 10 +- .../compiler/console-readonly.expect.md | 4 +- .../fixtures/compiler/console-readonly.js | 4 +- .../const-propagation-phi-nodes.expect.md | 2 +- .../compiler/const-propagation-phi-nodes.ts | 2 +- .../compiler/constant-computed.expect.md | 8 +- .../fixtures/compiler/constant-computed.js | 8 +- ...ant-prop-across-objectmethod-def.expect.md | 2 +- .../constant-prop-across-objectmethod-def.js | 2 +- ...nstant-prop-colliding-identifier.expect.md | 4 +- .../constant-prop-colliding-identifier.js | 4 +- .../constant-prop-to-object-method.expect.md | 2 +- .../constant-prop-to-object-method.js | 2 +- ...t-propagate-global-phis-constant.expect.md | 8 +- ...constant-propagate-global-phis-constant.js | 8 +- .../constant-propagate-global-phis.expect.md | 8 +- .../constant-propagate-global-phis.js | 8 +- .../constant-propagation-bit-ops.expect.md | 2 +- .../compiler/constant-propagation-bit-ops.js | 2 +- .../constant-propagation-phi.expect.md | 4 +- .../compiler/constant-propagation-phi.js | 4 +- ...nstant-propagation-string-concat.expect.md | 4 +- .../constant-propagation-string-concat.js | 4 +- .../constant-propagation-unary.expect.md | 12 +- .../compiler/constant-propagation-unary.js | 12 +- .../compiler/constant-propagation.expect.md | 2 +- .../fixtures/compiler/constant-propagation.js | 2 +- ...text-variable-as-jsx-element-tag.expect.md | 6 +- .../context-variable-as-jsx-element-tag.js | 6 +- ...ext-variable-only-chained-assign.expect.md | 2 +- .../context-variable-only-chained-assign.js | 2 +- ...e-reactive-explicit-control-flow.expect.md | 8 +- ...variable-reactive-explicit-control-flow.js | 8 +- ...e-reactive-implicit-control-flow.expect.md | 8 +- ...variable-reactive-implicit-control-flow.js | 8 +- ...variable-reassigned-objectmethod.expect.md | 6 +- ...ontext-variable-reassigned-objectmethod.js | 6 +- ...ble-reassigned-outside-of-lambda.expect.md | 2 +- ...t-variable-reassigned-outside-of-lambda.js | 2 +- ...able-reassigned-reactive-capture.expect.md | 8 +- ...xt-variable-reassigned-reactive-capture.js | 8 +- ...-variable-reassigned-two-lambdas.expect.md | 12 +- ...context-variable-reassigned-two-lambdas.js | 12 +- .../compiler/controlled-input.expect.md | 4 +- .../fixtures/compiler/controlled-input.js | 4 +- .../compiler/createElement-freeze.expect.md | 8 +- .../fixtures/compiler/createElement-freeze.js | 8 +- .../fixtures/compiler/dce-loop.expect.md | 2 +- .../__tests__/fixtures/compiler/dce-loop.js | 2 +- .../compiler/dce-unused-const.expect.md | 2 +- .../fixtures/compiler/dce-unused-const.js | 2 +- .../dce-unused-postfix-update.expect.md | 2 +- .../compiler/dce-unused-postfix-update.js | 2 +- .../dce-unused-prefix-update.expect.md | 2 +- .../compiler/dce-unused-prefix-update.js | 2 +- .../compiler/debugger-memoized.expect.md | 4 +- .../fixtures/compiler/debugger-memoized.js | 4 +- .../fixtures/compiler/debugger.expect.md | 4 +- .../__tests__/fixtures/compiler/debugger.js | 4 +- ...are-reassign-variable-in-closure.expect.md | 4 +- .../declare-reassign-variable-in-closure.js | 4 +- ...ault-param-calls-global-function.expect.md | 4 +- .../default-param-calls-global-function.js | 4 +- ...-param-with-reorderable-callback.expect.md | 2 +- ...default-param-with-reorderable-callback.js | 2 +- .../delete-computed-property.expect.md | 8 +- .../compiler/delete-computed-property.js | 8 +- .../compiler/delete-property.expect.md | 6 +- .../fixtures/compiler/delete-property.js | 6 +- .../compiler/dependencies-outputs.expect.md | 4 +- .../fixtures/compiler/dependencies-outputs.js | 4 +- .../fixtures/compiler/dependencies.expect.md | 4 +- .../fixtures/compiler/dependencies.js | 4 +- ...-array-assignment-to-context-var.expect.md | 6 +- ...ructure-array-assignment-to-context-var.js | 6 +- ...array-declaration-to-context-var.expect.md | 6 +- ...ucture-array-declaration-to-context-var.js | 6 +- .../destructure-capture-global.expect.md | 4 +- .../compiler/destructure-capture-global.js | 4 +- ...ructure-default-array-with-unary.expect.md | 2 +- .../destructure-default-array-with-unary.js | 2 +- .../destructure-direct-reassignment.expect.md | 6 +- .../destructure-direct-reassignment.js | 6 +- .../destructure-in-branch-ssa.expect.md | 4 +- .../compiler/destructure-in-branch-ssa.ts | 4 +- ...ructure-mixed-property-key-types.expect.md | 6 +- .../destructure-mixed-property-key-types.js | 6 +- ...object-assignment-to-context-var.expect.md | 8 +- ...ucture-object-assignment-to-context-var.js | 8 +- ...bject-declaration-to-context-var.expect.md | 8 +- ...cture-object-declaration-to-context-var.js | 8 +- ...g-literal-key-invalid-identifier.expect.md | 4 +- ...m-string-literal-key-invalid-identifier.js | 4 +- ...ructure-param-string-literal-key.expect.md | 4 +- .../destructure-param-string-literal-key.js | 4 +- ...-invalid-identifier-property-key.expect.md | 2 +- ...literal-invalid-identifier-property-key.js | 2 +- ...ture-string-literal-property-key.expect.md | 2 +- ...destructure-string-literal-property-key.js | 2 +- .../destructuring-array-default.expect.md | 6 +- .../compiler/destructuring-array-default.js | 6 +- ...estructuring-array-param-default.expect.md | 4 +- .../destructuring-array-param-default.js | 4 +- ...cturing-assignment-array-default.expect.md | 6 +- .../destructuring-assignment-array-default.js | 6 +- .../destructuring-assignment.expect.md | 8 +- .../compiler/destructuring-assignment.js | 8 +- ...tructuring-default-at-array-hole.expect.md | 2 +- .../destructuring-default-at-array-hole.js | 2 +- ...cturing-default-at-explicit-null.expect.md | 2 +- .../destructuring-default-at-explicit-null.js | 2 +- ...ng-default-at-explicit-undefined.expect.md | 2 +- ...ructuring-default-at-explicit-undefined.js | 2 +- ...turing-default-past-end-of-array.expect.md | 2 +- ...destructuring-default-past-end-of-array.js | 2 +- ...and-local-variables-with-default.expect.md | 14 +- ...-scope-and-local-variables-with-default.js | 14 +- ...ed-scope-declarations-and-locals.expect.md | 4 +- ...ing-mixed-scope-declarations-and-locals.js | 4 +- .../destructuring-object-default.expect.md | 6 +- .../compiler/destructuring-object-default.js | 6 +- ...structuring-object-param-default.expect.md | 6 +- .../destructuring-object-param-default.js | 6 +- ...uring-object-pattern-within-rest.expect.md | 4 +- ...estructuring-object-pattern-within-rest.js | 4 +- ...destructuring-property-inference.expect.md | 2 +- .../destructuring-property-inference.js | 2 +- ...g-same-property-identifier-names.expect.md | 6 +- ...ucturing-same-property-identifier-names.js | 6 +- ...ith-conditional-as-default-value.expect.md | 2 +- ...uring-with-conditional-as-default-value.js | 2 +- .../fixtures/compiler/destructuring.expect.md | 6 +- .../fixtures/compiler/destructuring.js | 6 +- .../compiler/do-while-break.expect.md | 4 +- .../fixtures/compiler/do-while-break.js | 4 +- .../compiler/do-while-compound-test.expect.md | 4 +- .../compiler/do-while-compound-test.js | 4 +- .../fixtures/compiler/dominator.expect.md | 10 +- .../__tests__/fixtures/compiler/dominator.js | 10 +- ...er-declaration-of-previous-scope.expect.md | 14 +- ...-is-inner-declaration-of-previous-scope.js | 14 +- ...ng-scopes-store-const-used-later.expect.md | 4 +- ...erlapping-scopes-store-const-used-later.js | 4 +- ...s-with-intermediate-reassignment.expect.md | 4 +- ...g-scopes-with-intermediate-reassignment.js | 4 +- .../drop-methodcall-usecallback.expect.md | 4 +- .../compiler/drop-methodcall-usecallback.js | 4 +- .../drop-methodcall-usememo.expect.md | 4 +- .../compiler/drop-methodcall-usememo.js | 4 +- ...rly-return-within-reactive-scope.expect.md | 2 +- ...sted-early-return-within-reactive-scope.js | 2 +- ...tions-reassignments-dependencies.expect.md | 20 +- ...declarations-reassignments-dependencies.js | 20 +- ...rly-return-within-reactive-scope.expect.md | 18 +- .../early-return-within-reactive-scope.js | 18 +- .../fixtures/compiler/early-return.expect.md | 4 +- .../fixtures/compiler/early-return.js | 4 +- .../compiler/empty-catch-statement.expect.md | 2 +- .../compiler/empty-catch-statement.ts | 2 +- ...odo.computed-lval-in-destructure.expect.md | 6 +- ...rror._todo.computed-lval-in-destructure.js | 2 +- ...ut-on-suppression-of-custom-rule.expect.md | 4 +- ...r.bailout-on-suppression-of-custom-rule.js | 2 +- ...gen-error-on-conflicting-imports.expect.md | 2 +- ...or.codegen-error-on-conflicting-imports.js | 2 +- ...rror.dont-hoist-inline-reference.expect.md | 4 +- .../error.dont-hoist-inline-reference.js | 2 +- .../error.gating-use-before-decl.expect.md | 2 +- .../compiler/error.gating-use-before-decl.js | 2 +- ...ror.hoisted-function-declaration.expect.md | 4 +- .../error.hoisted-function-declaration.js | 2 +- ...or.hook-property-load-local-hook.expect.md | 2 +- .../error.hook-property-load-local-hook.js | 2 +- ...-callback-invoked-during-render-.expect.md | 8 +- ...-ref-in-callback-invoked-during-render-.js | 4 +- ...itional-call-aliased-hook-import.expect.md | 2 +- ...id-conditional-call-aliased-hook-import.js | 2 +- ...ditional-call-aliased-react-hook.expect.md | 2 +- ...lid-conditional-call-aliased-react-hook.js | 2 +- ...l-call-non-hook-imported-as-hook.expect.md | 2 +- ...ditional-call-non-hook-imported-as-hook.js | 2 +- ...destructure-assignment-to-global.expect.md | 4 +- ...nvalid-destructure-assignment-to-global.js | 2 +- ...pression-mutates-immutable-value.expect.md | 6 +- ...tion-expression-mutates-immutable-value.js | 4 +- ...lid-global-reassignment-indirect.expect.md | 2 +- ...or.invalid-global-reassignment-indirect.js | 2 +- ...-mutate-props-in-effect-fixpoint.expect.md | 2 +- ...invalid-mutate-props-in-effect-fixpoint.js | 2 +- ...rror.invalid-mutation-in-closure.expect.md | 4 +- .../error.invalid-mutation-in-closure.js | 2 +- ...d-ref-prop-in-render-destructure.expect.md | 4 +- ...lid-read-ref-prop-in-render-destructure.js | 2 +- ...ssign-local-in-hook-return-value.expect.md | 4 +- ...lid-reassign-local-in-hook-return-value.js | 2 +- ...local-variable-in-async-callback.expect.md | 2 +- ...assign-local-variable-in-async-callback.js | 2 +- ...eassign-local-variable-in-effect.expect.md | 18 +- ...valid-reassign-local-variable-in-effect.js | 14 +- ...-local-variable-in-hook-argument.expect.md | 20 +- ...eassign-local-variable-in-hook-argument.js | 16 +- ...n-local-variable-in-jsx-callback.expect.md | 14 +- ...reassign-local-variable-in-jsx-callback.js | 10 +- ...n-callback-invoked-during-render.expect.md | 8 +- ...d-ref-in-callback-invoked-during-render.js | 4 +- ...ef-nested-property-during-render.expect.md | 4 +- ...-read-ref-nested-property-during-render.js | 2 +- ....invalid-sketchy-code-use-forget.expect.md | 4 +- .../error.invalid-sketchy-code-use-forget.js | 2 +- ...alid-unclosed-eslint-suppression.expect.md | 4 +- ...ror.invalid-unclosed-eslint-suppression.js | 2 +- ...f-added-to-dep-without-type-info.expect.md | 10 +- ...-use-ref-added-to-dep-without-type-info.js | 6 +- ...valid-useEffect-dep-not-memoized.expect.md | 2 +- ...rror.invalid-useEffect-dep-not-memoized.js | 2 +- ...InsertionEffect-dep-not-memoized.expect.md | 2 +- ...lid-useInsertionEffect-dep-not-memoized.js | 2 +- ...useLayoutEffect-dep-not-memoized.expect.md | 2 +- ...nvalid-useLayoutEffect-dep-not-memoized.js | 2 +- ...or.invalid-useMemo-callback-args.expect.md | 6 +- .../error.invalid-useMemo-callback-args.js | 2 +- ...rite-but-dont-read-ref-in-render.expect.md | 2 +- ...valid-write-but-dont-read-ref-in-render.js | 2 +- .../compiler/error.modify-state-2.expect.md | 6 +- .../fixtures/compiler/error.modify-state-2.js | 4 +- .../compiler/error.modify-state.expect.md | 2 +- .../fixtures/compiler/error.modify-state.js | 2 +- .../error.modify-useReducer-state.expect.md | 6 +- .../compiler/error.modify-useReducer-state.js | 4 +- ...r.mutate-captured-arg-separately.expect.md | 4 +- .../error.mutate-captured-arg-separately.js | 2 +- .../error.mutate-function-property.expect.md | 8 +- .../error.mutate-function-property.js | 4 +- ...or.not-useEffect-external-mutate.expect.md | 2 +- .../error.not-useEffect-external-mutate.js | 2 +- .../error.ref-like-name-not-Ref.expect.md | 4 +- .../compiler/error.ref-like-name-not-Ref.js | 4 +- .../error.ref-like-name-not-a-ref.expect.md | 4 +- .../compiler/error.ref-like-name-not-a-ref.js | 4 +- .../error.todo-for-await-loops.expect.md | 4 +- .../compiler/error.todo-for-await-loops.js | 2 +- ...p-with-context-variable-iterator.expect.md | 4 +- ...-in-loop-with-context-variable-iterator.js | 4 +- ...p-with-context-variable-iterator.expect.md | 4 +- ...-of-loop-with-context-variable-iterator.js | 4 +- .../compiler/error.todo-kitchensink.expect.md | 12 +- .../compiler/error.todo-kitchensink.js | 10 +- ...wer-property-load-into-temporary.expect.md | 2 +- ...alls-lower-property-load-into-temporary.js | 2 +- ...or.todo-new-target-meta-property.expect.md | 2 +- .../error.todo-new-target-meta-property.js | 2 +- ...after-construction-sequence-expr.expect.md | 4 +- ...during-after-construction-sequence-expr.js | 4 +- ...dified-during-after-construction.expect.md | 4 +- ...-key-modified-during-after-construction.js | 4 +- ...te-key-while-constructing-object.expect.md | 4 +- ...ey-mutate-key-while-constructing-object.js | 4 +- ...odo-object-expression-get-syntax.expect.md | 8 +- ...error.todo-object-expression-get-syntax.js | 6 +- ...odo-object-expression-set-syntax.expect.md | 4 +- ...error.todo-object-expression-set-syntax.js | 4 +- ...ional-call-chain-in-logical-expr.expect.md | 8 +- ...odo-optional-call-chain-in-logical-expr.ts | 6 +- ...-optional-call-chain-in-optional.expect.md | 10 +- ...or.todo-optional-call-chain-in-optional.ts | 6 +- ...o-optional-call-chain-in-ternary.expect.md | 8 +- ...ror.todo-optional-call-chain-in-ternary.ts | 6 +- .../error.todo-reassign-const.expect.md | 10 +- .../compiler/error.todo-reassign-const.js | 4 +- ...ack-captured-in-context-variable.expect.md | 16 +- ...-callback-captured-in-context-variable.tsx | 16 +- ...ia-function-preserve-memoization.expect.md | 12 +- ...later-via-function-preserve-memoization.js | 6 +- ...ified-later-preserve-memoization.expect.md | 12 +- ...ref-modified-later-preserve-memoization.js | 6 +- ...-state-in-render-with-loop-throw.expect.md | 2 +- ...nal-set-state-in-render-with-loop-throw.js | 2 +- ...ror.useMemo-non-literal-depslist.expect.md | 12 +- .../error.useMemo-non-literal-depslist.ts | 10 +- ...ffect-deps-invalidated-dep-value.expect.md | 4 +- ...oized-effect-deps-invalidated-dep-value.js | 4 +- ...alidate-mutate-ref-arg-in-render.expect.md | 2 +- ...error.validate-mutate-ref-arg-in-render.js | 2 +- ...alysis-destructured-rest-element.expect.md | 6 +- ...cape-analysis-destructured-rest-element.js | 6 +- .../escape-analysis-jsx-child.expect.md | 4 +- .../compiler/escape-analysis-jsx-child.js | 4 +- .../escape-analysis-logical.expect.md | 4 +- .../compiler/escape-analysis-logical.js | 4 +- ...nterleaved-allocating-dependency.expect.md | 4 +- ...aping-interleaved-allocating-dependency.js | 4 +- ...ved-allocating-nested-dependency.expect.md | 4 +- ...nterleaved-allocating-nested-dependency.js | 4 +- ...interleaved-primitive-dependency.expect.md | 4 +- ...caping-interleaved-primitive-dependency.js | 4 +- ...pe-analysis-not-conditional-test.expect.md | 4 +- .../escape-analysis-not-conditional-test.js | 4 +- .../escape-analysis-not-if-test.expect.md | 4 +- .../compiler/escape-analysis-not-if-test.js | 4 +- .../escape-analysis-not-switch-case.expect.md | 4 +- .../escape-analysis-not-switch-case.js | 4 +- .../escape-analysis-not-switch-test.expect.md | 4 +- .../escape-analysis-not-switch-test.js | 4 +- .../existing-variables-with-c-name.expect.md | 4 +- .../existing-variables-with-c-name.js | 4 +- ...pression-with-assignment-dynamic.expect.md | 4 +- .../expression-with-assignment-dynamic.js | 4 +- .../compiler/extend-scopes-if.expect.md | 4 +- .../fixtures/compiler/extend-scopes-if.js | 4 +- ...-dont-refresh-const-changes-prod.expect.md | 6 +- ...refresh-dont-refresh-const-changes-prod.js | 6 +- ...esh-refresh-on-const-changes-dev.expect.md | 10 +- ...st-refresh-refresh-on-const-changes-dev.js | 6 +- .../compiler/fast-refresh-reloading.expect.md | 8 +- .../compiler/fast-refresh-reloading.js | 4 +- ...rror.todo-fbt-unknown-enum-value.expect.md | 12 +- .../fbt/error.todo-fbt-unknown-enum-value.js | 8 +- .../error.todo-locally-require-fbt.expect.md | 8 +- .../fbt/error.todo-locally-require-fbt.js | 4 +- .../compiler/fbt/fbs-params.expect.md | 9 +- .../fixtures/compiler/fbt/fbs-params.js | 9 +- .../fbt-call-complex-param-value.expect.md | 10 +- .../fbt/fbt-call-complex-param-value.js | 10 +- .../fixtures/compiler/fbt/fbt-call.expect.md | 8 +- .../fixtures/compiler/fbt/fbt-call.js | 8 +- ...no-whitespace-btw-text-and-param.expect.md | 6 +- .../fbt-no-whitespace-btw-text-and-param.tsx | 6 +- ...bt-param-with-leading-whitespace.expect.md | 24 +- .../fbt/fbt-param-with-leading-whitespace.js | 24 +- .../fbt/fbt-param-with-newline.expect.md | 11 +- .../compiler/fbt/fbt-param-with-newline.js | 11 +- .../fbt/fbt-param-with-quotes.expect.md | 6 +- .../compiler/fbt/fbt-param-with-quotes.js | 6 +- ...t-param-with-trailing-whitespace.expect.md | 24 +- .../fbt/fbt-param-with-trailing-whitespace.js | 24 +- .../fbt/fbt-param-with-unicode.expect.md | 6 +- .../compiler/fbt/fbt-param-with-unicode.js | 6 +- .../fbt-params-complex-param-value.expect.md | 4 +- .../fbt/fbt-params-complex-param-value.js | 4 +- .../compiler/fbt/fbt-params.expect.md | 10 +- .../fixtures/compiler/fbt/fbt-params.js | 10 +- .../fbt/fbt-preserve-jsxtext.expect.md | 10 +- .../compiler/fbt/fbt-preserve-jsxtext.js | 10 +- .../fbt/fbt-preserve-whitespace.expect.md | 6 +- .../compiler/fbt/fbt-preserve-whitespace.tsx | 6 +- ...-single-space-btw-param-and-text.expect.md | 6 +- .../fbt-single-space-btw-param-and-text.tsx | 6 +- .../fbt-template-string-same-scope.expect.md | 10 +- .../fbt/fbt-template-string-same-scope.js | 10 +- .../compiler/fbt/fbt-to-string.expect.md | 6 +- .../fixtures/compiler/fbt/fbt-to-string.js | 6 +- ...bt-whitespace-around-param-value.expect.md | 6 +- .../fbt/fbt-whitespace-around-param-value.tsx | 6 +- .../fbt/fbt-whitespace-within-text.expect.md | 6 +- .../fbt/fbt-whitespace-within-text.tsx | 6 +- ...xt-must-use-expression-container.expect.md | 4 +- ...aram-text-must-use-expression-container.js | 4 +- ...btparam-with-jsx-element-content.expect.md | 4 +- .../fbt/fbtparam-with-jsx-element-content.js | 4 +- ...fbtparam-with-jsx-fragment-value.expect.md | 4 +- .../fbt/fbtparam-with-jsx-fragment-value.js | 4 +- .../compiler/fbt/lambda-with-fbt.expect.md | 8 +- .../fixtures/compiler/fbt/lambda-with-fbt.js | 8 +- .../flag-enable-emit-hook-guards.expect.md | 10 +- .../compiler/flag-enable-emit-hook-guards.ts | 10 +- ...tten-scopes-with-methodcall-hook.expect.md | 2 +- .../flatten-scopes-with-methodcall-hook.js | 2 +- .../for-empty-update-with-continue.expect.md | 4 +- .../for-empty-update-with-continue.js | 4 +- .../compiler/for-empty-update.expect.md | 4 +- .../fixtures/compiler/for-empty-update.js | 4 +- ...in-statement-body-always-returns.expect.md | 2 +- .../for-in-statement-body-always-returns.js | 2 +- .../compiler/for-in-statement-break.expect.md | 6 +- .../compiler/for-in-statement-break.js | 6 +- .../for-in-statement-continue.expect.md | 22 +- .../compiler/for-in-statement-continue.js | 22 +- .../for-in-statement-empty-body.expect.md | 2 +- .../compiler/for-in-statement-empty-body.js | 2 +- .../for-in-statement-type-inference.expect.md | 6 +- .../for-in-statement-type-inference.js | 6 +- .../compiler/for-in-statement.expect.md | 6 +- .../fixtures/compiler/for-in-statement.js | 6 +- .../fixtures/compiler/for-logical.expect.md | 4 +- .../fixtures/compiler/for-logical.js | 4 +- .../for-loop-let-undefined-decl.expect.md | 4 +- .../compiler/for-loop-let-undefined-decl.js | 4 +- ...oop-with-value-block-initializer.expect.md | 24 +- .../for-loop-with-value-block-initializer.js | 24 +- ...able-declarations-in-initializer.expect.md | 2 +- ...le-variable-declarations-in-initializer.js | 2 +- ...utate-later-value-initially-null.expect.md | 2 +- ...ction-mutate-later-value-initially-null.js | 2 +- ...of-local-collection-mutate-later.expect.md | 2 +- ...e-item-of-local-collection-mutate-later.js | 2 +- .../compiler/for-of-destructure.expect.md | 4 +- .../fixtures/compiler/for-of-destructure.js | 4 +- .../for-of-immutable-collection.expect.md | 10 +- .../compiler/for-of-immutable-collection.js | 10 +- ...iterator-of-immutable-collection.expect.md | 10 +- ...for-of-iterator-of-immutable-collection.js | 10 +- ...-mutate-item-of-local-collection.expect.md | 2 +- .../for-of-mutate-item-of-local-collection.js | 2 +- .../fixtures/compiler/for-of-mutate.expect.md | 2 +- .../fixtures/compiler/for-of-mutate.tsx | 2 +- ...onmutating-loop-local-collection.expect.md | 14 +- ...or-of-nonmutating-loop-local-collection.js | 14 +- .../fixtures/compiler/for-return.expect.md | 4 +- .../__tests__/fixtures/compiler/for-return.js | 4 +- .../for-with-assignment-as-update.expect.md | 2 +- .../compiler/for-with-assignment-as-update.js | 2 +- .../function-declaration-simple.expect.md | 6 +- .../compiler/function-declaration-simple.js | 6 +- .../function-expr-directive.expect.md | 6 +- .../compiler/function-expr-directive.js | 6 +- ...-captures-value-later-frozen-jsx.expect.md | 2 +- ...ression-captures-value-later-frozen-jsx.js | 2 +- ...pression-prototype-call-mutating.expect.md | 12 +- ...tion-expression-prototype-call-mutating.js | 12 +- ...nction-expression-prototype-call.expect.md | 2 +- .../function-expression-prototype-call.js | 2 +- ...unction-param-assignment-pattern.expect.md | 6 +- .../function-param-assignment-pattern.js | 6 +- ...r\342\200\223conditional-access.expect.md" | 2 +- ...tionexpr\342\200\223conditional-access.js" | 2 +- ...ng-preserves-function-properties.expect.md | 4 +- .../gating-preserves-function-properties.tsx | 4 +- ...ing-test-export-default-function.expect.md | 4 +- .../gating-test-export-default-function.js | 4 +- ...test-export-function-and-default.expect.md | 4 +- ...gating-test-export-function-and-default.js | 4 +- .../gating-test-export-function.expect.md | 4 +- .../compiler/gating-test-export-function.js | 4 +- .../fixtures/compiler/gating-test.expect.md | 4 +- .../fixtures/compiler/gating-test.js | 4 +- .../compiler/globals-Boolean.expect.md | 4 +- .../fixtures/compiler/globals-Boolean.js | 4 +- .../compiler/globals-Number.expect.md | 4 +- .../fixtures/compiler/globals-Number.js | 4 +- .../compiler/globals-String.expect.md | 4 +- .../fixtures/compiler/globals-String.js | 4 +- ...bals-dont-resolve-local-useState.expect.md | 8 +- .../globals-dont-resolve-local-useState.js | 8 +- .../hoisted-declaration-with-scope.expect.md | 10 +- .../hoisted-declaration-with-scope.tsx | 10 +- ...sting-computed-member-expression.expect.md | 8 +- .../hoisting-computed-member-expression.js | 8 +- .../hoisting-member-expression.expect.md | 4 +- .../compiler/hoisting-member-expression.js | 4 +- ...hoisting-nested-block-statements.expect.md | 2 +- .../hoisting-nested-block-statements.js | 2 +- ...ing-recursive-call-within-lambda.expect.md | 4 +- .../hoisting-recursive-call-within-lambda.js | 4 +- .../hoisting-recursive-call.expect.md | 4 +- .../compiler/hoisting-recursive-call.ts | 4 +- .../compiler/holey-array-expr.expect.md | 4 +- .../fixtures/compiler/holey-array-expr.js | 4 +- .../holey-array-pattern-dce-2.expect.md | 4 +- .../compiler/holey-array-pattern-dce-2.js | 4 +- .../holey-array-pattern-dce.expect.md | 4 +- .../compiler/holey-array-pattern-dce.js | 4 +- .../fixtures/compiler/holey-array.expect.md | 4 +- .../fixtures/compiler/holey-array.js | 4 +- .../fixtures/compiler/hook-noAlias.expect.md | 6 +- .../fixtures/compiler/hook-noAlias.js | 6 +- .../compiler/hooks-with-prefix.expect.md | 6 +- .../fixtures/compiler/hooks-with-prefix.js | 6 +- .../compiler/ignore-use-no-forget.expect.md | 4 +- .../fixtures/compiler/ignore-use-no-forget.js | 4 +- .../iife-return-modified-later-phi.expect.md | 2 +- .../iife-return-modified-later-phi.js | 2 +- .../iife-return-modified-later.expect.md | 2 +- .../compiler/iife-return-modified-later.js | 2 +- ...rtent-mutability-readonly-lambda.expect.md | 2 +- .../inadvertent-mutability-readonly-lambda.js | 2 +- ...incompatible-destructuring-kinds.expect.md | 8 +- .../incompatible-destructuring-kinds.js | 8 +- ...endently-memoize-object-property.expect.md | 6 +- .../independently-memoize-object-property.js | 6 +- ...mpile-hooks-with-multiple-params.expect.md | 2 +- ...nfer-compile-hooks-with-multiple-params.js | 2 +- .../infer-function-React-memo.expect.md | 2 +- .../compiler/infer-function-React-memo.js | 2 +- .../infer-function-assignment.expect.md | 2 +- .../compiler/infer-function-assignment.js | 2 +- ...ion-expression-React-memo-gating.expect.md | 2 +- ...r-function-expression-React-memo-gating.js | 2 +- .../infer-function-forwardRef.expect.md | 2 +- .../compiler/infer-function-forwardRef.js | 2 +- .../compiler/infer-global-object.expect.md | 6 +- .../fixtures/compiler/infer-global-object.js | 6 +- .../infer-no-component-annot.expect.md | 2 +- .../compiler/infer-no-component-annot.ts | 2 +- .../infer-no-component-obj-return.expect.md | 2 +- .../compiler/infer-no-component-obj-return.js | 2 +- .../compiler/inverted-if-else.expect.md | 4 +- .../fixtures/compiler/inverted-if-else.js | 4 +- .../fixtures/compiler/inverted-if.expect.md | 4 +- .../fixtures/compiler/inverted-if.js | 4 +- .../fixtures/compiler/issue852.expect.md | 2 +- .../__tests__/fixtures/compiler/issue852.js | 2 +- ...ue933-disjoint-set-infinite-loop.expect.md | 4 +- .../issue933-disjoint-set-infinite-loop.js | 4 +- .../jsx-attribute-default-to-true.expect.md | 2 +- .../jsx-attribute-default-to-true.tsx | 2 +- ...attribute-with-jsx-element-value.expect.md | 15 +- .../jsx-attribute-with-jsx-element-value.js | 15 +- .../compiler/jsx-empty-expression.expect.md | 2 +- .../fixtures/compiler/jsx-empty-expression.js | 2 +- .../fixtures/compiler/jsx-fragment.expect.md | 6 +- .../fixtures/compiler/jsx-fragment.js | 6 +- .../fixtures/compiler/jsx-freeze.expect.md | 8 +- .../__tests__/fixtures/compiler/jsx-freeze.js | 8 +- ...local-memberexpr-tag-conditional.expect.md | 6 +- .../jsx-local-memberexpr-tag-conditional.js | 6 +- .../jsx-local-memberexpr-tag.expect.md | 2 +- .../compiler/jsx-local-memberexpr-tag.js | 2 +- .../jsx-local-tag-in-lambda.expect.md | 2 +- .../compiler/jsx-local-tag-in-lambda.js | 2 +- .../jsx-memberexpr-tag-in-lambda.expect.md | 2 +- .../compiler/jsx-memberexpr-tag-in-lambda.js | 2 +- .../compiler/jsx-namespaced-name.expect.md | 4 +- .../fixtures/compiler/jsx-namespaced-name.js | 4 +- .../jsx-preserve-whitespace.expect.md | 2 +- .../compiler/jsx-preserve-whitespace.tsx | 2 +- ...ctive-local-variable-member-expr.expect.md | 11 +- ...sx-reactive-local-variable-member-expr.tsx | 10 +- .../fixtures/compiler/jsx-spread.expect.md | 2 +- .../__tests__/fixtures/compiler/jsx-spread.js | 2 +- ...g-attribute-expression-container.expect.md | 14 +- ...x-string-attribute-expression-container.js | 14 +- .../jsx-string-attribute-non-ascii.expect.md | 2 +- .../jsx-string-attribute-non-ascii.js | 2 +- ...-tag-evaluation-order-non-global.expect.md | 4 +- .../jsx-tag-evaluation-order-non-global.js | 4 +- .../jsx-tag-evaluation-order.expect.md | 6 +- .../compiler/jsx-tag-evaluation-order.tsx | 6 +- .../jsx-ternary-local-variable.expect.md | 6 +- .../compiler/jsx-ternary-local-variable.tsx | 6 +- ...abeled-break-within-label-switch.expect.md | 2 +- .../labeled-break-within-label-switch.ts | 2 +- ...rray-access-member-expr-captured.expect.md | 4 +- ...ambda-array-access-member-expr-captured.ts | 4 +- ...a-array-access-member-expr-param.expect.md | 4 +- .../lambda-array-access-member-expr-param.ts | 4 +- .../lambda-capture-returned-alias.expect.md | 2 +- .../compiler/lambda-capture-returned-alias.js | 2 +- ...mutated-non-reactive-to-reactive.expect.md | 6 +- ...lambda-mutated-non-reactive-to-reactive.js | 6 +- .../lambda-mutated-ref-non-reactive.expect.md | 4 +- .../lambda-mutated-ref-non-reactive.js | 4 +- .../lambda-return-expression.expect.md | 2 +- .../compiler/lambda-return-expression.ts | 2 +- .../compiler/log-pruned-memoization.expect.md | 8 +- .../compiler/log-pruned-memoization.js | 4 +- .../logical-expression-object.expect.md | 6 +- .../compiler/logical-expression-object.js | 6 +- .../compiler/logical-expression.expect.md | 4 +- .../fixtures/compiler/logical-expression.js | 4 +- .../maybe-mutate-object-in-callback.expect.md | 6 +- .../maybe-mutate-object-in-callback.js | 6 +- ...s-dont-merge-with-different-deps.expect.md | 6 +- ...e-scopes-dont-merge-with-different-deps.js | 6 +- .../compiler/memoization-comments.expect.md | 4 +- .../fixtures/compiler/memoization-comments.js | 4 +- .../merge-consecutive-nested-scopes.expect.md | 6 +- .../merge-consecutive-nested-scopes.js | 6 +- ...tive-scopes-deps-subset-of-decls.expect.md | 2 +- ...consecutive-scopes-deps-subset-of-decls.js | 2 +- ...merge-consecutive-scopes-no-deps.expect.md | 4 +- .../merge-consecutive-scopes-no-deps.js | 4 +- ...merge-consecutive-scopes-objects.expect.md | 14 +- .../merge-consecutive-scopes-objects.js | 14 +- ...ge-consecutive-scopes-reordering.expect.md | 6 +- .../merge-consecutive-scopes-reordering.js | 6 +- .../merge-consecutive-scopes.expect.md | 6 +- .../compiler/merge-consecutive-scopes.js | 6 +- ...e-nested-scopes-with-same-inputs.expect.md | 4 +- .../merge-nested-scopes-with-same-inputs.js | 4 +- .../compiler/merge-scopes-callback.expect.md | 4 +- .../compiler/merge-scopes-callback.js | 4 +- ...ged-scopes-are-valid-effect-deps.expect.md | 4 +- .../merged-scopes-are-valid-effect-deps.js | 4 +- .../repro-cx-assigned-to-temporary.expect.md | 10 +- .../repro-cx-assigned-to-temporary.js | 10 +- ...-namespace-assigned-to-temporary.expect.md | 10 +- ...epro-cx-namespace-assigned-to-temporary.js | 10 +- .../repro-cx-namespace-nesting.expect.md | 8 +- .../meta-isms/repro-cx-namespace-nesting.js | 8 +- .../fixtures/compiler/method-call.expect.md | 4 +- .../fixtures/compiler/method-call.js | 4 +- .../compiler/module-scoped-bindings.expect.md | 4 +- .../compiler/module-scoped-bindings.js | 4 +- ...-expr-export-default-gating-test.expect.md | 2 +- ...i-arrow-expr-export-default-gating-test.js | 2 +- ...ti-arrow-expr-export-gating-test.expect.md | 2 +- .../multi-arrow-expr-export-gating-test.js | 2 +- .../multi-arrow-expr-gating-test.expect.md | 2 +- .../compiler/multi-arrow-expr-gating-test.js | 2 +- .../compiler/multi-directive.expect.md | 4 +- .../fixtures/compiler/multi-directive.js | 4 +- ...ted-callback-from-other-callback.expect.md | 4 +- ...to-hoisted-callback-from-other-callback.js | 4 +- .../compiler/mutable-lifetime-loops.expect.md | 6 +- .../compiler/mutable-lifetime-loops.js | 6 +- .../mutable-lifetime-with-aliasing.expect.md | 4 +- .../mutable-lifetime-with-aliasing.js | 4 +- ...e-outer-scope-within-value-block.expect.md | 8 +- .../mutate-outer-scope-within-value-block.ts | 8 +- ...mutation-during-jsx-construction.expect.md | 4 +- .../mutation-during-jsx-construction.js | 4 +- ...-within-capture-and-mutablerange.expect.md | 8 +- ...tation-within-capture-and-mutablerange.tsx | 8 +- .../mutation-within-jsx-and-break.expect.md | 10 +- .../mutation-within-jsx-and-break.tsx | 10 +- .../compiler/mutation-within-jsx.expect.md | 10 +- .../fixtures/compiler/mutation-within-jsx.tsx | 10 +- ...ed-function-shadowed-identifiers.expect.md | 8 +- .../nested-function-shadowed-identifiers.js | 8 +- ...opes-begin-same-instr-valueblock.expect.md | 15 +- ...sted-scopes-begin-same-instr-valueblock.ts | 15 +- .../new-does-not-mutate-class.expect.md | 6 +- .../compiler/new-does-not-mutate-class.ts | 6 +- .../noAlias-filter-on-array-prop.expect.md | 14 +- .../compiler/noAlias-filter-on-array-prop.js | 14 +- .../compiler/non-null-assertion.expect.md | 2 +- .../fixtures/compiler/non-null-assertion.ts | 2 +- ...pture-in-unsplittable-memo-block.expect.md | 14 +- ...ting-capture-in-unsplittable-memo-block.ts | 14 +- ...al-load-from-optional-memberexpr.expect.md | 4 +- ...noptional-load-from-optional-memberexpr.js | 4 +- ...-can-inline-into-consuming-scope.expect.md | 5 +- ...endency-can-inline-into-consuming-scope.js | 5 +- .../obj-literal-cached-in-if-else.expect.md | 4 +- .../compiler/obj-literal-cached-in-if-else.js | 4 +- ...bj-literal-mutated-after-if-else.expect.md | 4 +- .../obj-literal-mutated-after-if-else.js | 4 +- ...bject-computed-access-assignment.expect.md | 6 +- .../object-computed-access-assignment.js | 6 +- ...ion-computed-key-constant-number.expect.md | 4 +- ...expression-computed-key-constant-number.js | 4 +- ...ion-computed-key-constant-string.expect.md | 6 +- ...expression-computed-key-constant-string.js | 6 +- ...ession-computed-key-non-reactive.expect.md | 4 +- ...ct-expression-computed-key-non-reactive.js | 4 +- ...omputed-key-object-mutated-later.expect.md | 4 +- ...ssion-computed-key-object-mutated-later.js | 4 +- .../object-expression-computed-key.expect.md | 6 +- .../object-expression-computed-key.js | 6 +- ...ct-expression-string-literal-key.expect.md | 6 +- .../object-expression-string-literal-key.js | 6 +- ...eral-method-call-in-ternary-test.expect.md | 6 +- ...ect-literal-method-call-in-ternary-test.js | 6 +- ...od-derived-in-ternary-consequent.expect.md | 6 +- ...al-method-derived-in-ternary-consequent.js | 6 +- ...ral-method-in-ternary-consequent.expect.md | 6 +- ...ct-literal-method-in-ternary-consequent.js | 6 +- ...t-literal-method-in-ternary-test.expect.md | 10 +- .../object-literal-method-in-ternary-test.js | 10 +- .../object-literal-spread-element.expect.md | 6 +- .../compiler/object-literal-spread-element.js | 6 +- .../object-method-maybe-alias.expect.md | 6 +- .../compiler/object-method-maybe-alias.js | 6 +- .../object-method-shorthand-3.expect.md | 6 +- .../compiler/object-method-shorthand-3.js | 6 +- ...d-shorthand-aliased-mutate-after.expect.md | 8 +- ...t-method-shorthand-aliased-mutate-after.js | 8 +- ...t-method-shorthand-derived-value.expect.md | 8 +- .../object-method-shorthand-derived-value.js | 8 +- ...object-method-shorthand-hook-dep.expect.md | 4 +- .../object-method-shorthand-hook-dep.js | 4 +- ...t-method-shorthand-mutated-after.expect.md | 8 +- .../object-method-shorthand-mutated-after.js | 8 +- .../object-method-shorthand.expect.md | 2 +- .../compiler/object-method-shorthand.js | 2 +- ...consequent-alternate-both-return.expect.md | 4 +- ...ted-in-consequent-alternate-both-return.js | 4 +- .../compiler/object-pattern-params.expect.md | 12 +- .../compiler/object-pattern-params.js | 12 +- .../compiler/object-properties.expect.md | 2 +- .../fixtures/compiler/object-properties.js | 2 +- .../object-shorthand-method-1.expect.md | 6 +- .../compiler/object-shorthand-method-1.js | 6 +- .../object-shorthand-method-2.expect.md | 8 +- .../compiler/object-shorthand-method-2.js | 8 +- .../object-shorthand-method-nested.expect.md | 8 +- .../object-shorthand-method-nested.js | 8 +- ...n-enable-change-variable-codegen.expect.md | 2 +- .../option-enable-change-variable-codegen.js | 2 +- .../compiler/optional-call-logical.expect.md | 2 +- .../compiler/optional-call-logical.js | 2 +- ...optional-member-expression-chain.expect.md | 6 +- .../optional-member-expression-chain.js | 6 +- ...cal-expression-instruction-scope.expect.md | 4 +- ...ng-logical-expression-instruction-scope.ts | 4 +- ...g-hoisted-declaration-with-scope.expect.md | 10 +- .../bug-hoisted-declaration-with-scope.tsx | 10 +- ...pture-in-unsplittable-memo-block.expect.md | 14 +- ...ting-capture-in-unsplittable-memo-block.ts | 14 +- .../capture-ref-for-later-mutation.expect.md | 12 +- .../capture-ref-for-later-mutation.tsx | 12 +- ...ithin-nested-valueblock-in-array.expect.md | 10 +- ...opes-within-nested-valueblock-in-array.tsx | 10 +- ...e-outer-scope-within-value-block.expect.md | 8 +- .../mutate-outer-scope-within-value-block.ts | 8 +- ...-within-capture-and-mutablerange.expect.md | 8 +- ...tation-within-capture-and-mutablerange.tsx | 8 +- .../mutation-within-jsx-and-break.expect.md | 10 +- .../mutation-within-jsx-and-break.tsx | 10 +- .../mutation-within-jsx.expect.md | 10 +- .../mutation-within-jsx.tsx | 10 +- ...g-ternary-test-instruction-scope.expect.md | 6 +- ...locating-ternary-test-instruction-scope.ts | 6 +- .../outlined-destructured-params.expect.md | 6 +- .../compiler/outlined-destructured-params.js | 6 +- .../compiler/outlined-helper.expect.md | 6 +- .../fixtures/compiler/outlined-helper.js | 6 +- ...g-scopes-interleaved-by-terminal.expect.md | 4 +- ...rlapping-scopes-interleaved-by-terminal.js | 4 +- .../overlapping-scopes-interleaved.expect.md | 4 +- .../overlapping-scopes-interleaved.js | 4 +- .../overlapping-scopes-shadowed.expect.md | 4 +- .../compiler/overlapping-scopes-shadowed.js | 4 +- ...ng-scopes-shadowing-within-block.expect.md | 4 +- ...erlapping-scopes-shadowing-within-block.js | 4 +- .../overlapping-scopes-while.expect.md | 4 +- .../compiler/overlapping-scopes-while.js | 4 +- .../overlapping-scopes-within-block.expect.md | 4 +- .../overlapping-scopes-within-block.js | 4 +- ...rly-return-within-reactive-scope.expect.md | 2 +- ...tial-early-return-within-reactive-scope.js | 2 +- .../compiler/phi-reference-effects.expect.md | 6 +- .../compiler/phi-reference-effects.ts | 6 +- .../phi-type-inference-array-push.expect.md | 8 +- .../compiler/phi-type-inference-array-push.js | 8 +- ...hi-type-inference-property-store.expect.md | 4 +- .../phi-type-inference-property-store.js | 4 +- ...sxtext-stringliteral-distinction.expect.md | 2 +- ...serve-jsxtext-stringliteral-distinction.js | 2 +- ...sitive-useMemo-infer-mutate-deps.expect.md | 4 +- ...alse-positive-useMemo-infer-mutate-deps.ts | 4 +- ...back-captures-reassigned-context.expect.md | 4 +- ...useCallback-captures-reassigned-context.ts | 4 +- ...nvalid-useCallback-read-maybeRef.expect.md | 2 +- ...maybe-invalid-useCallback-read-maybeRef.ts | 2 +- ...be-invalid-useMemo-read-maybeRef.expect.md | 2 +- ...ror.maybe-invalid-useMemo-read-maybeRef.ts | 2 +- ...back-captures-invalidating-value.expect.md | 2 +- ...useCallback-captures-invalidating-value.ts | 2 +- ...lback-conditional-access-noAlloc.expect.md | 8 +- ....useCallback-conditional-access-noAlloc.ts | 6 +- ...less-specific-conditional-access.expect.md | 8 +- ...-infer-less-specific-conditional-access.ts | 6 +- ...or.useCallback-property-call-dep.expect.md | 6 +- .../error.useCallback-property-call-dep.ts | 4 +- ...error.useMemo-dep-not-recognized.expect.md | 6 +- .../error.useMemo-dep-not-recognized.ts | 6 +- ...less-specific-conditional-access.expect.md | 8 +- ...-infer-less-specific-conditional-access.ts | 6 +- ...specific-conditional-value-block.expect.md | 8 +- ...r-less-specific-conditional-value-block.ts | 6 +- ...emo-property-call-chained-object.expect.md | 6 +- ...or.useMemo-property-call-chained-object.ts | 4 +- .../error.useMemo-property-call-dep.expect.md | 6 +- .../error.useMemo-property-call-dep.ts | 4 +- ...o-unrelated-mutation-in-depslist.expect.md | 2 +- ....useMemo-unrelated-mutation-in-depslist.ts | 2 +- ...-useMemo-no-memoblock-sideeffect.expect.md | 6 +- ...invalid-useMemo-no-memoblock-sideeffect.ts | 6 +- ...-constant-prop-decls-get-removed.expect.md | 2 +- ...-ensure-constant-prop-decls-get-removed.ts | 2 +- ...Callback-alias-property-load-dep.expect.md | 8 +- .../useCallback-alias-property-load-dep.ts | 8 +- ...ures-reassigned-context-property.expect.md | 8 +- ...k-captures-reassigned-context-property.tsx | 8 +- ...back-captures-reassigned-context.expect.md | 4 +- ...useCallback-captures-reassigned-context.ts | 4 +- ...ack-conditional-access-own-scope.expect.md | 6 +- ...seCallback-conditional-access-own-scope.ts | 6 +- ...Callback-in-other-reactive-block.expect.md | 6 +- .../useCallback-in-other-reactive-block.ts | 6 +- ...ck-infer-conditional-value-block.expect.md | 6 +- ...eCallback-infer-conditional-value-block.ts | 6 +- .../useCallback-infer-fewer-deps.expect.md | 2 +- .../useCallback-infer-fewer-deps.ts | 2 +- .../useCallback-infer-more-specific.expect.md | 4 +- .../useCallback-infer-more-specific.ts | 4 +- .../useCallback-infer-read-dep.expect.md | 4 +- .../useCallback-infer-read-dep.ts | 4 +- .../useCallback-infer-scope-global.expect.md | 4 +- .../useCallback-infer-scope-global.ts | 4 +- ...invoked-callback-escaping-return.expect.md | 6 +- ...caping-invoked-callback-escaping-return.js | 6 +- .../useCallback-nonescaping.expect.md | 6 +- .../useCallback-nonescaping.js | 6 +- ...k-reordering-deplist-controlflow.expect.md | 14 +- ...allback-reordering-deplist-controlflow.tsx | 14 +- ...k-reordering-depslist-assignment.expect.md | 6 +- ...allback-reordering-depslist-assignment.tsx | 6 +- .../useCallback-with-no-depslist.expect.md | 6 +- .../useCallback-with-no-depslist.ts | 6 +- .../useMemo-alias-property-load-dep.expect.md | 8 +- .../useMemo-alias-property-load-dep.ts | 8 +- ...useMemo-conditional-access-alloc.expect.md | 8 +- .../useMemo-conditional-access-alloc.ts | 8 +- ...eMemo-conditional-access-noAlloc.expect.md | 6 +- .../useMemo-conditional-access-noAlloc.ts | 6 +- ...emo-conditional-access-own-scope.expect.md | 6 +- .../useMemo-conditional-access-own-scope.ts | 6 +- .../useMemo-constant-prop.expect.md | 4 +- .../useMemo-constant-prop.ts | 4 +- ...ropped-infer-always-invalidating.expect.md | 4 +- ...eMemo-dropped-infer-always-invalidating.ts | 4 +- .../useMemo-in-other-reactive-block.expect.md | 6 +- .../useMemo-in-other-reactive-block.ts | 6 +- .../useMemo-infer-fewer-deps.expect.md | 2 +- .../useMemo-infer-fewer-deps.ts | 2 +- .../useMemo-infer-more-specific.expect.md | 4 +- .../useMemo-infer-more-specific.ts | 4 +- .../useMemo-infer-nonallocating.expect.md | 2 +- .../useMemo-infer-nonallocating.ts | 2 +- .../useMemo-infer-scope-global.expect.md | 4 +- .../useMemo-infer-scope-global.ts | 4 +- .../useMemo-inner-decl.expect.md | 8 +- .../useMemo-inner-decl.ts | 8 +- .../useMemo-invoke-prop.expect.md | 6 +- .../useMemo-invoke-prop.ts | 6 +- ...o-reordering-depslist-assignment.expect.md | 4 +- .../useMemo-reordering-depslist-assignment.ts | 4 +- ...-reordering-depslist-controlflow.expect.md | 14 +- ...seMemo-reordering-depslist-controlflow.tsx | 14 +- .../useMemo-with-no-depslist.expect.md | 6 +- .../useMemo-with-no-depslist.ts | 6 +- .../compiler/primitive-alias-mutate.expect.md | 6 +- .../compiler/primitive-alias-mutate.js | 6 +- .../primitive-as-dep-nested-scope.expect.md | 12 +- .../compiler/primitive-as-dep-nested-scope.js | 12 +- ...signed-loop-force-scopes-enabled.expect.md | 12 +- ...ve-reassigned-loop-force-scopes-enabled.js | 12 +- .../prop-capturing-function-1.expect.md | 6 +- .../compiler/prop-capturing-function-1.js | 6 +- .../property-call-evaluation-order.expect.md | 8 +- .../property-call-evaluation-order.js | 8 +- ...opes-whose-deps-invalidate-array.expect.md | 4 +- ...rune-scopes-whose-deps-invalidate-array.js | 4 +- ...scopes-whose-deps-invalidate-jsx.expect.md | 4 +- .../prune-scopes-whose-deps-invalidate-jsx.js | 4 +- ...scopes-whose-deps-invalidate-new.expect.md | 8 +- .../prune-scopes-whose-deps-invalidate-new.js | 8 +- ...pes-whose-deps-invalidate-object.expect.md | 8 +- ...une-scopes-whose-deps-invalidate-object.js | 8 +- ...-whose-deps-may-invalidate-array.expect.md | 4 +- ...-scopes-whose-deps-may-invalidate-array.js | 4 +- .../compiler/react-namespace.expect.md | 4 +- .../fixtures/compiler/react-namespace.js | 4 +- ...rol-dependency-do-while-indirect.expect.md | 16 +- ...ve-control-dependency-do-while-indirect.js | 16 +- ...control-dependency-do-while-test.expect.md | 16 +- ...active-control-dependency-do-while-test.js | 16 +- ...tive-control-dependency-for-init.expect.md | 16 +- .../reactive-control-dependency-for-init.js | 16 +- ...tive-control-dependency-for-test.expect.md | 16 +- .../reactive-control-dependency-for-test.js | 16 +- ...ve-control-dependency-for-update.expect.md | 16 +- .../reactive-control-dependency-for-update.js | 16 +- ...trol-dependency-forin-collection.expect.md | 16 +- ...ive-control-dependency-forin-collection.js | 16 +- ...trol-dependency-forof-collection.expect.md | 16 +- ...ive-control-dependency-forof-collection.js | 16 +- ...-interleaved-reactivity-do-while.expect.md | 2 +- ...cy-from-interleaved-reactivity-do-while.js | 2 +- ...om-interleaved-reactivity-for-in.expect.md | 4 +- ...ency-from-interleaved-reactivity-for-in.js | 4 +- ...-interleaved-reactivity-for-init.expect.md | 2 +- ...cy-from-interleaved-reactivity-for-init.js | 2 +- ...om-interleaved-reactivity-for-of.expect.md | 2 +- ...ency-from-interleaved-reactivity-for-of.js | 2 +- ...-interleaved-reactivity-for-test.expect.md | 2 +- ...cy-from-interleaved-reactivity-for-test.js | 2 +- ...nterleaved-reactivity-for-update.expect.md | 2 +- ...-from-interleaved-reactivity-for-update.js | 2 +- ...y-from-interleaved-reactivity-if.expect.md | 2 +- ...pendency-from-interleaved-reactivity-if.js | 2 +- ...om-interleaved-reactivity-switch.expect.md | 2 +- ...ency-from-interleaved-reactivity-switch.js | 2 +- ...rom-interleaved-reactivity-while.expect.md | 2 +- ...dency-from-interleaved-reactivity-while.js | 2 +- .../reactive-control-dependency-if.expect.md | 16 +- .../reactive-control-dependency-if.js | 16 +- ...l-dependency-on-context-variable.expect.md | 18 +- ...-control-dependency-on-context-variable.js | 18 +- ...rol-dependency-phi-setState-type.expect.md | 30 +- ...ve-control-dependency-phi-setState-type.js | 30 +- ...pendency-reactive-after-fixpoint.expect.md | 16 +- ...trol-dependency-reactive-after-fixpoint.js | 16 +- ...trol-dependency-switch-case-test.expect.md | 16 +- ...ive-control-dependency-switch-case-test.js | 16 +- ...trol-dependency-switch-condition.expect.md | 18 +- ...ive-control-dependency-switch-condition.js | 18 +- ...ntrol-dependency-via-mutation-if.expect.md | 16 +- ...tive-control-dependency-via-mutation-if.js | 16 +- ...l-dependency-via-mutation-switch.expect.md | 16 +- ...-control-dependency-via-mutation-switch.js | 16 +- ...ve-control-dependency-while-test.expect.md | 16 +- .../reactive-control-dependency-while-test.js | 16 +- .../reactive-dependency-fixpoint.expect.md | 2 +- .../compiler/reactive-dependency-fixpoint.js | 2 +- ...nreactive-captured-with-reactive.expect.md | 2 +- ...ency-nonreactive-captured-with-reactive.js | 2 +- ...t-captured-with-reactive-mutated.expect.md | 4 +- ...y-object-captured-with-reactive-mutated.js | 4 +- .../compiler/reactive-scopes-if.expect.md | 4 +- .../fixtures/compiler/reactive-scopes-if.js | 4 +- .../compiler/reactive-scopes.expect.md | 4 +- .../fixtures/compiler/reactive-scopes.js | 4 +- ...-analysis-interleaved-reactivity.expect.md | 4 +- ...ctivity-analysis-interleaved-reactivity.js | 4 +- ...ve-via-mutation-of-computed-load.expect.md | 2 +- ...-reactive-via-mutation-of-computed-load.js | 2 +- ...ve-via-mutation-of-property-load.expect.md | 2 +- ...-reactive-via-mutation-of-property-load.js | 2 +- ...ivity-via-aliased-mutation-array.expect.md | 16 +- .../reactivity-via-aliased-mutation-array.js | 16 +- ...vity-via-aliased-mutation-lambda.expect.md | 18 +- .../reactivity-via-aliased-mutation-lambda.js | 18 +- ...d-mutation-through-property-load.expect.md | 16 +- ...-aliased-mutation-through-property-load.js | 16 +- ...-readonly-alias-of-mutable-value.expect.md | 16 +- ...ity-via-readonly-alias-of-mutable-value.js | 16 +- ...ject-method-calls-mutable-lambda.expect.md | 2 +- ...only-object-method-calls-mutable-lambda.js | 2 +- .../readonly-object-method-calls.expect.md | 2 +- .../compiler/readonly-object-method-calls.js | 2 +- ...reassign-in-while-loop-condition.expect.md | 2 +- .../reassign-in-while-loop-condition.js | 2 +- .../reassignment-separate-scopes.expect.md | 4 +- .../compiler/reassignment-separate-scopes.js | 4 +- ...eactive-cond-deps-break-in-scope.expect.md | 8 +- ...educe-reactive-cond-deps-break-in-scope.ts | 8 +- ...-cond-deps-cfg-nested-testifelse.expect.md | 12 +- ...eactive-cond-deps-cfg-nested-testifelse.ts | 12 +- ...active-cond-deps-return-in-scope.expect.md | 8 +- ...duce-reactive-cond-deps-return-in-scope.ts | 8 +- .../cfg-condexpr.expect.md | 4 +- .../reduce-reactive-deps/cfg-condexpr.js | 4 +- .../reduce-reactive-deps/cfg-ifelse.expect.md | 4 +- .../reduce-reactive-deps/cfg-ifelse.js | 4 +- .../cfg-nested-ifelse-missing.expect.md | 4 +- .../cfg-nested-ifelse-missing.js | 4 +- .../cfg-nested-ifelse.expect.md | 4 +- .../reduce-reactive-deps/cfg-nested-ifelse.js | 4 +- .../cfg-switch-exhaustive.expect.md | 4 +- .../cfg-switch-exhaustive.js | 4 +- .../cfg-switch-missing-case.expect.md | 4 +- .../cfg-switch-missing-case.js | 4 +- .../cfg-switch-missing-default.expect.md | 4 +- .../cfg-switch-missing-default.js | 4 +- .../reduce-reactive-deps/cond-scope.expect.md | 2 +- .../reduce-reactive-deps/cond-scope.js | 2 +- .../conditional-member-expr.expect.md | 2 +- .../conditional-member-expr.js | 2 +- .../join-uncond-scopes-cond-deps.expect.md | 4 +- .../join-uncond-scopes-cond-deps.js | 4 +- .../jump-poisoned/break-in-scope.expect.md | 14 +- .../jump-poisoned/break-in-scope.ts | 14 +- .../break-poisons-outer-scope.expect.md | 20 +- .../break-poisons-outer-scope.ts | 20 +- .../loop-break-in-scope.expect.md | 14 +- .../jump-poisoned/loop-break-in-scope.ts | 14 +- ...e-if-nonexhaustive-poisoned-deps.expect.md | 18 +- .../reduce-if-nonexhaustive-poisoned-deps.ts | 18 +- ...-if-nonexhaustive-poisoned-deps1.expect.md | 16 +- .../reduce-if-nonexhaustive-poisoned-deps1.ts | 16 +- .../jump-poisoned/return-in-scope.expect.md | 14 +- .../jump-poisoned/return-in-scope.ts | 14 +- .../return-poisons-outer-scope.expect.md | 20 +- .../return-poisons-outer-scope.ts | 20 +- .../else-branch-scope-unpoisoned.expect.md | 20 +- .../else-branch-scope-unpoisoned.ts | 20 +- .../jump-target-within-scope-label.expect.md | 18 +- .../jump-target-within-scope-label.ts | 18 +- ...p-target-within-scope-loop-break.expect.md | 16 +- .../jump-target-within-scope-loop-break.ts | 16 +- ...e-if-exhaustive-nonpoisoned-deps.expect.md | 6 +- .../reduce-if-exhaustive-nonpoisoned-deps.ts | 6 +- ...-if-exhaustive-nonpoisoned-deps1.expect.md | 16 +- .../reduce-if-exhaustive-nonpoisoned-deps1.ts | 16 +- .../return-before-scope-starts.expect.md | 22 +- .../return-before-scope-starts.ts | 22 +- .../throw-before-scope-starts.expect.md | 22 +- .../throw-before-scope-starts.ts | 22 +- .../memberexpr-join-optional-chain.expect.md | 2 +- .../memberexpr-join-optional-chain.ts | 2 +- .../memberexpr-join-optional-chain2.expect.md | 2 +- .../memberexpr-join-optional-chain2.ts | 2 +- .../reduce-reactive-deps/no-uncond.expect.md | 18 +- .../reduce-reactive-deps/no-uncond.js | 18 +- .../promote-uncond.expect.md | 4 +- .../reduce-reactive-deps/promote-uncond.js | 4 +- ...duce-if-exhaustive-poisoned-deps.expect.md | 6 +- .../reduce-if-exhaustive-poisoned-deps.ts | 6 +- .../subpath-order1.expect.md | 4 +- .../reduce-reactive-deps/subpath-order1.js | 4 +- .../subpath-order2.expect.md | 4 +- .../reduce-reactive-deps/subpath-order2.js | 4 +- .../superpath-order1.expect.md | 18 +- .../reduce-reactive-deps/superpath-order1.js | 18 +- .../superpath-order2.expect.md | 18 +- .../reduce-reactive-deps/superpath-order2.js | 18 +- .../uncond-nonoverlap-descendant.expect.md | 2 +- .../uncond-nonoverlap-descendant.js | 2 +- .../uncond-nonoverlap-direct.expect.md | 2 +- .../uncond-nonoverlap-direct.js | 2 +- .../uncond-overlap-descendant.expect.md | 2 +- .../uncond-overlap-descendant.js | 2 +- .../uncond-overlap-direct.expect.md | 2 +- .../uncond-overlap-direct.js | 2 +- .../uncond-subpath-order1.expect.md | 2 +- .../uncond-subpath-order1.js | 2 +- .../uncond-subpath-order2.expect.md | 2 +- .../uncond-subpath-order2.js | 2 +- .../uncond-subpath-order3.expect.md | 2 +- .../uncond-subpath-order3.js | 2 +- ...rrent-aliased-not-added-to-dep-2.expect.md | 4 +- .../ref-current-aliased-not-added-to-dep-2.js | 4 +- ...ent-field-write-not-added-to-dep.expect.md | 6 +- ...ef-current-field-write-not-added-to-dep.js | 6 +- .../ref-current-not-added-to-dep-2.expect.md | 4 +- .../ref-current-not-added-to-dep-2.js | 4 +- .../fixtures/compiler/ref-in-effect.expect.md | 2 +- .../fixtures/compiler/ref-in-effect.js | 2 +- .../ref-like-name-in-effect.expect.md | 4 +- .../compiler/ref-like-name-in-effect.js | 4 +- .../ref-like-name-in-useCallback-2.expect.md | 4 +- .../ref-like-name-in-useCallback-2.js | 4 +- .../ref-like-name-in-useCallback.expect.md | 4 +- .../compiler/ref-like-name-in-useCallback.js | 4 +- .../ref-parameter-mutate-in-effect.expect.md | 4 +- .../ref-parameter-mutate-in-effect.js | 4 +- ...source-variables-nested-function.expect.md | 12 +- ...rename-source-variables-nested-function.js | 12 +- ...e-variables-nested-object-method.expect.md | 12 +- ...e-source-variables-nested-object-method.js | 12 +- .../rename-source-variables.expect.md | 12 +- .../compiler/rename-source-variables.ts | 12 +- .../reordering-across-blocks.expect.md | 8 +- .../compiler/reordering-across-blocks.js | 8 +- ...g-ternary-test-instruction-scope.expect.md | 6 +- ...locating-ternary-test-instruction-scope.ts | 6 +- .../repro-dce-circular-reference.expect.md | 10 +- .../compiler/repro-dce-circular-reference.js | 10 +- ...ay-with-capturing-map-after-hook.expect.md | 10 +- ...ize-array-with-capturing-map-after-hook.js | 10 +- ...rray-with-mutable-map-after-hook.expect.md | 10 +- ...moize-array-with-mutable-map-after-hook.js | 10 +- ...repro-duplicate-import-specifier.expect.md | 6 +- .../repro-duplicate-import-specifier.ts | 6 +- ...on-from-merge-consecutive-scopes.expect.md | 4 +- ...struction-from-merge-consecutive-scopes.js | 4 +- .../repro-duplicate-type-import.expect.md | 2 +- .../compiler/repro-duplicate-type-import.tsx | 2 +- ...epro-hoisting-variable-collision.expect.md | 4 +- .../repro-hoisting-variable-collision.js | 4 +- .../compiler/repro-hoisting.expect.md | 4 +- .../fixtures/compiler/repro-hoisting.js | 4 +- ...ed-property-load-for-method-call.expect.md | 6 +- ...-memoized-property-load-for-method-call.js | 6 +- ...ion-part-of-already-closed-scope.expect.md | 6 +- ...nstruction-part-of-already-closed-scope.js | 6 +- ...uned-scope-leaks-value-via-alias.expect.md | 17 +- ...alid-pruned-scope-leaks-value-via-alias.ts | 17 +- ...invalid-pruned-scope-leaks-value.expect.md | 17 +- .../repro-invalid-pruned-scope-leaks-value.ts | 17 +- ...o-invalid-reactivity-value-block.expect.md | 4 +- .../repro-invalid-reactivity-value-block.ts | 4 +- ...valid-scope-merging-value-blocks.expect.md | 2 +- ...epro-invalid-scope-merging-value-blocks.ts | 2 +- ...ay-with-immutable-map-after-hook.expect.md | 6 +- ...ize-array-with-immutable-map-after-hook.js | 6 +- ...ssing-dependency-if-within-while.expect.md | 20 +- ...epro-missing-dependency-if-within-while.js | 20 +- ...ble-range-extending-into-ternary.expect.md | 22 +- ...ro-mutable-range-extending-into-ternary.js | 22 +- ...mport-without-compiled-functions.expect.md | 2 +- ...ating-import-without-compiled-functions.js | 2 +- ...reactive-scope-with-early-return.expect.md | 8 +- ...porary-reactive-scope-with-early-return.js | 8 +- ...repro-non-identifier-object-keys.expect.md | 10 +- .../repro-non-identifier-object-keys.ts | 10 +- .../compiler/repro-object-pattern.expect.md | 6 +- .../fixtures/compiler/repro-object-pattern.js | 6 +- ...fined-try-catch-return-primitive.expect.md | 4 +- ...ds-undefined-try-catch-return-primitive.js | 4 +- .../repro-ref-mutable-range.expect.md | 4 +- .../compiler/repro-ref-mutable-range.tsx | 4 +- ...repro-renaming-conflicting-decls.expect.md | 9 +- .../repro-renaming-conflicting-decls.js | 9 +- ...repro-retain-source-when-bailout.expect.md | 4 +- .../repro-retain-source-when-bailout.js | 4 +- ...epro-scope-missing-mutable-range.expect.md | 2 +- .../repro-scope-missing-mutable-range.js | 2 +- .../repro-separate-scopes-for-divs.expect.md | 20 +- .../repro-separate-scopes-for-divs.js | 20 +- ...epro-slow-validate-preserve-memo.expect.md | 14 +- .../repro-slow-validate-preserve-memo.ts | 14 +- ...ession-of-jsxexpressioncontainer.expect.md | 12 +- ...ed-expression-of-jsxexpressioncontainer.js | 12 +- ...erge-overlapping-reactive-scopes.expect.md | 14 +- ...-call-merge-overlapping-reactive-scopes.js | 14 +- ...ble-code-early-return-in-useMemo.expect.md | 26 +- ...nreachable-code-early-return-in-useMemo.js | 26 +- .../fixtures/compiler/repro.expect.md | 4 +- .../src/__tests__/fixtures/compiler/repro.js | 4 +- ...react-hooks-based-on-import-name.expect.md | 4 +- ...esolve-react-hooks-based-on-import-name.js | 4 +- .../rest-param-with-array-pattern.expect.md | 2 +- .../compiler/rest-param-with-array-pattern.js | 2 +- .../rest-param-with-identifier.expect.md | 2 +- .../compiler/rest-param-with-identifier.js | 2 +- ...param-with-object-spread-pattern.expect.md | 4 +- .../rest-param-with-object-spread-pattern.js | 4 +- .../compiler/return-conditional.expect.md | 4 +- .../fixtures/compiler/return-conditional.js | 4 +- .../compiler/return-undefined.expect.md | 4 +- .../fixtures/compiler/return-undefined.js | 4 +- .../compiler/reverse-postorder.expect.md | 4 +- .../fixtures/compiler/reverse-postorder.js | 4 +- .../allow-locals-named-like-hooks.expect.md | 2 +- .../allow-locals-named-like-hooks.js | 2 +- .../allow-props-named-like-hooks.expect.md | 6 +- .../allow-props-named-like-hooks.js | 6 +- ...bail.rules-of-hooks-8503ca76d6f8.expect.md | 4 +- .../error.bail.rules-of-hooks-8503ca76d6f8.js | 2 +- ...nally-call-local-named-like-hook.expect.md | 2 +- ...onditionally-call-local-named-like-hook.js | 2 +- ...onally-call-prop-named-like-hook.expect.md | 4 +- ...conditionally-call-prop-named-like-hook.js | 2 +- ...dcall-hooklike-property-of-local.expect.md | 2 +- ...y-methodcall-hooklike-property-of-local.js | 2 +- ...-call-hooklike-property-of-local.expect.md | 2 +- ...ionally-call-hooklike-property-of-local.js | 2 +- .../error.invalid-hook-as-prop.expect.md | 4 +- .../error.invalid-hook-as-prop.js | 2 +- ...or.invalid-hook-from-hook-return.expect.md | 4 +- .../error.invalid-hook-from-hook-return.js | 2 +- ...hook-from-property-of-other-hook.expect.md | 4 +- ...nvalid-hook-from-property-of-other-hook.js | 2 +- ...ion-expression-object-expression.expect.md | 2 +- ...d-function-expression-object-expression.js | 2 +- ...lid-hook-in-nested-object-method.expect.md | 2 +- ...or.invalid-hook-in-nested-object-method.js | 2 +- ...invalid-hook-optional-methodcall.expect.md | 6 +- .../error.invalid-hook-optional-methodcall.js | 2 +- ...r.invalid-hook-optional-property.expect.md | 6 +- .../error.invalid-hook-optional-property.js | 2 +- .../error.invalid-hook-optionalcall.expect.md | 6 +- .../error.invalid-hook-optionalcall.js | 2 +- ...alid-rules-of-hooks-9718e30b856c.expect.md | 6 +- ...ror.invalid-rules-of-hooks-9718e30b856c.js | 4 +- ...alid-rules-of-hooks-f3d6c5e9c83d.expect.md | 4 +- ...ror.invalid-rules-of-hooks-f3d6c5e9c83d.js | 4 +- ...alid-rules-of-hooks-f69800950ff0.expect.md | 4 +- ...ror.invalid-rules-of-hooks-f69800950ff0.js | 2 +- .../rules-of-hooks-0592bd574811.expect.md | 2 +- .../rules-of-hooks-0592bd574811.js | 2 +- .../rules-of-hooks-0e2214abc294.expect.md | 2 +- .../rules-of-hooks-0e2214abc294.js | 2 +- .../rules-of-hooks-69521d94fa03.expect.md | 2 +- .../rules-of-hooks-69521d94fa03.js | 2 +- ...bail.rules-of-hooks-28a78701970c.expect.md | 2 +- .../todo.bail.rules-of-hooks-28a78701970c.js | 2 +- ...alid-rules-of-hooks-28a7111f56a7.expect.md | 4 +- ...lid.invalid-rules-of-hooks-28a7111f56a7.js | 4 +- ...s-dep-and-redeclare-maybe-frozen.expect.md | 4 +- ...iable-as-dep-and-redeclare-maybe-frozen.js | 4 +- ...me-variable-as-dep-and-redeclare.expect.md | 4 +- .../same-variable-as-dep-and-redeclare.js | 4 +- ...assignment-to-scope-declarations.expect.md | 12 +- ...turing-assignment-to-scope-declarations.js | 12 +- ...ixed-local-and-scope-declaration.expect.md | 12 +- ...-both-mixed-local-and-scope-declaration.js | 12 +- ...-progagatable-if-test-conditions.expect.md | 8 +- ...onstant-progagatable-if-test-conditions.js | 8 +- ...hout-compilation-annotation-mode.expect.md | 6 +- ...out-without-compilation-annotation-mode.js | 6 +- ...t-without-compilation-infer-mode.expect.md | 4 +- ...-bailout-without-compilation-infer-mode.js | 4 +- .../fixtures/compiler/simple-scope.expect.md | 4 +- .../fixtures/compiler/simple-scope.js | 4 +- .../compiler/skip-useMemoCache.expect.md | 4 +- .../fixtures/compiler/skip-useMemoCache.js | 4 +- .../compiler/ssa-arrayexpression.expect.md | 4 +- .../fixtures/compiler/ssa-arrayexpression.js | 4 +- .../ssa-cascading-eliminated-phis.expect.md | 4 +- .../compiler/ssa-cascading-eliminated-phis.js | 4 +- .../fixtures/compiler/ssa-for-of.expect.md | 4 +- .../__tests__/fixtures/compiler/ssa-for-of.js | 4 +- .../compiler/ssa-multiple-phis.expect.md | 4 +- .../fixtures/compiler/ssa-multiple-phis.js | 4 +- .../ssa-nested-loops-no-reassign.expect.md | 4 +- .../compiler/ssa-nested-loops-no-reassign.js | 4 +- .../compiler/ssa-nested-partial-phi.expect.md | 4 +- .../compiler/ssa-nested-partial-phi.js | 4 +- .../ssa-nested-partial-reassignment.expect.md | 4 +- .../ssa-nested-partial-reassignment.js | 4 +- .../ssa-non-empty-initializer.expect.md | 4 +- .../compiler/ssa-non-empty-initializer.js | 4 +- .../ssa-objectexpression-phi.expect.md | 2 +- .../compiler/ssa-objectexpression-phi.js | 2 +- .../compiler/ssa-objectexpression.expect.md | 6 +- .../fixtures/compiler/ssa-objectexpression.js | 6 +- .../compiler/ssa-property-alias-if.expect.md | 4 +- .../compiler/ssa-property-alias-if.js | 4 +- .../compiler/ssa-property-call.expect.md | 2 +- .../fixtures/compiler/ssa-property-call.js | 2 +- .../fixtures/compiler/ssa-reassign.expect.md | 4 +- .../fixtures/compiler/ssa-reassign.js | 4 +- ...ernary-destruction-with-mutation.expect.md | 2 +- ...aming-ternary-destruction-with-mutation.js | 2 +- ...ssa-renaming-ternary-destruction.expect.md | 6 +- .../ssa-renaming-ternary-destruction.js | 6 +- .../compiler/ssa-renaming-ternary.expect.md | 4 +- .../fixtures/compiler/ssa-renaming-ternary.js | 4 +- ...onditional-ternary-with-mutation.expect.md | 10 +- ...ing-unconditional-ternary-with-mutation.js | 10 +- ...a-renaming-unconditional-ternary.expect.md | 4 +- .../ssa-renaming-unconditional-ternary.js | 4 +- ...-via-destructuring-with-mutation.expect.md | 6 +- ...enaming-via-destructuring-with-mutation.js | 6 +- .../ssa-renaming-via-destructuring.expect.md | 10 +- .../ssa-renaming-via-destructuring.js | 10 +- .../fixtures/compiler/ssa-renaming.expect.md | 4 +- .../fixtures/compiler/ssa-renaming.js | 4 +- .../fixtures/compiler/ssa-shadowing.expect.md | 6 +- .../fixtures/compiler/ssa-shadowing.js | 6 +- .../compiler/ssa-sibling-phis.expect.md | 4 +- .../fixtures/compiler/ssa-sibling-phis.js | 4 +- .../switch-with-fallthrough.expect.md | 4 +- .../compiler/switch-with-fallthrough.js | 4 +- .../switch-with-only-default.expect.md | 6 +- .../compiler/switch-with-only-default.js | 6 +- .../ternary-assignment-expression.expect.md | 4 +- .../compiler/ternary-assignment-expression.js | 4 +- .../compiler/ternary-expression.expect.md | 4 +- .../fixtures/compiler/ternary-expression.js | 4 +- ...sion-captures-value-later-frozen.expect.md | 2 +- ...-expression-captures-value-later-frozen.js | 2 +- ...rror.object-pattern-computed-key.expect.md | 10 +- .../todo.error.object-pattern-computed-key.js | 6 +- ...eassign-local-variable-in-effect.expect.md | 14 +- ...ction-reassign-local-variable-in-effect.js | 14 +- ...o.unnecessary-lambda-memoization.expect.md | 2 +- .../todo.unnecessary-lambda-memoization.js | 2 +- .../transitive-freeze-array.expect.md | 2 +- .../compiler/transitive-freeze-array.js | 2 +- ...tive-freeze-function-expressions.expect.md | 4 +- .../transitive-freeze-function-expressions.js | 4 +- .../fixtures/compiler/trivial.expect.md | 4 +- .../__tests__/fixtures/compiler/trivial.js | 4 +- .../try-catch-alias-try-values.expect.md | 2 +- .../compiler/try-catch-alias-try-values.js | 2 +- .../compiler/try-catch-empty-try.expect.md | 2 +- .../fixtures/compiler/try-catch-empty-try.js | 2 +- .../try-catch-in-nested-scope.expect.md | 20 +- .../compiler/try-catch-in-nested-scope.ts | 20 +- .../try-catch-mutate-outer-value.expect.md | 8 +- .../compiler/try-catch-mutate-outer-value.js | 8 +- ...ry-catch-try-immediately-returns.expect.md | 2 +- .../try-catch-try-immediately-returns.js | 2 +- ...hrows-after-constant-propagation.expect.md | 2 +- ...ately-throws-after-constant-propagation.js | 2 +- ...value-modified-in-catch-escaping.expect.md | 4 +- ...ch-try-value-modified-in-catch-escaping.js | 4 +- ...atch-try-value-modified-in-catch.expect.md | 4 +- .../try-catch-try-value-modified-in-catch.js | 4 +- .../try-catch-with-catch-param.expect.md | 2 +- .../compiler/try-catch-with-catch-param.js | 2 +- .../compiler/try-catch-with-return.expect.md | 2 +- .../compiler/try-catch-with-return.js | 2 +- ...-expression-returns-caught-value.expect.md | 4 +- ...unction-expression-returns-caught-value.js | 4 +- .../try-catch-within-mutable-range.expect.md | 4 +- .../try-catch-within-mutable-range.js | 4 +- ...ject-method-returns-caught-value.expect.md | 4 +- ...thin-object-method-returns-caught-value.js | 4 +- .../fixtures/compiler/try-catch.expect.md | 4 +- .../__tests__/fixtures/compiler/try-catch.js | 4 +- .../compiler/type-alias-declaration.expect.md | 6 +- .../compiler/type-alias-declaration.ts | 6 +- .../type-alias-used-as-annotation.expect.md | 2 +- .../compiler/type-alias-used-as-annotation.ts | 2 +- ...lias-used-as-variable-annotation.expect.md | 4 +- .../type-alias-used-as-variable-annotation.ts | 4 +- .../todo_type-annotations-props.expect.md | 2 +- .../todo_type-annotations-props.ts | 2 +- .../type-annotation-as-array.expect.md | 4 +- .../type-annotation-as-array.ts | 4 +- .../type-annotation-as-number.expect.md | 6 +- .../type-annotation-as-number.ts | 6 +- .../type-annotation-var-array.expect.md | 4 +- .../type-annotation-var-array.ts | 4 +- .../type-args-test-binary-operator.expect.md | 4 +- .../type-args-test-binary-operator.js | 4 +- .../compiler/type-field-load.expect.md | 2 +- .../fixtures/compiler/type-field-load.js | 2 +- .../type-test-field-load-binary-op.expect.md | 2 +- .../type-test-field-load-binary-op.js | 2 +- .../fixtures/compiler/unary-expr.expect.md | 8 +- .../__tests__/fixtures/compiler/unary-expr.js | 8 +- .../unconditional-break-label.expect.md | 4 +- .../compiler/unconditional-break-label.js | 4 +- ...abeled-break-within-label-switch.expect.md | 2 +- .../unlabeled-break-within-label-switch.ts | 2 +- ...pendency-is-pruned-as-dependency.expect.md | 4 +- ...tive-dependency-is-pruned-as-dependency.js | 4 +- .../unused-array-middle-element.expect.md | 4 +- .../compiler/unused-array-middle-element.js | 4 +- .../unused-array-rest-element.expect.md | 4 +- .../compiler/unused-array-rest-element.js | 4 +- .../compiler/unused-conditional.expect.md | 4 +- .../fixtures/compiler/unused-conditional.js | 4 +- .../compiler/unused-logical.expect.md | 4 +- .../fixtures/compiler/unused-logical.js | 4 +- .../unused-object-element-with-rest.expect.md | 6 +- .../unused-object-element-with-rest.js | 6 +- .../compiler/unused-object-element.expect.md | 6 +- .../compiler/unused-object-element.js | 6 +- ...-expression-constant-propagation.expect.md | 2 +- .../update-expression-constant-propagation.js | 2 +- .../update-expression-in-sequence.expect.md | 2 +- .../compiler/update-expression-in-sequence.js | 2 +- ...pression-on-function-parameter-1.expect.md | 4 +- ...date-expression-on-function-parameter-1.js | 4 +- ...pression-on-function-parameter-3.expect.md | 4 +- ...date-expression-on-function-parameter-3.js | 4 +- .../compiler/update-expression.expect.md | 6 +- .../fixtures/compiler/update-expression.ts | 6 +- .../compiler/use-memo-simple.expect.md | 4 +- .../fixtures/compiler/use-memo-simple.js | 4 +- .../use-no-forget-module-level.expect.md | 2 +- .../compiler/use-no-forget-module-level.js | 2 +- ...multiple-with-eslint-suppression.expect.md | 8 +- ...forget-multiple-with-eslint-suppression.js | 8 +- ...o-forget-with-eslint-suppression.expect.md | 6 +- .../use-no-forget-with-eslint-suppression.js | 6 +- .../use-no-memo-module-level.expect.md | 2 +- .../compiler/use-no-memo-module-level.js | 2 +- .../compiler/use-no-memo-simple.expect.md | 4 +- .../fixtures/compiler/use-no-memo-simple.js | 4 +- .../use-operator-call-expression.expect.md | 24 +- .../compiler/use-operator-call-expression.js | 24 +- .../use-operator-conditional.expect.md | 22 +- .../compiler/use-operator-conditional.js | 22 +- .../use-operator-method-call.expect.md | 26 +- .../compiler/use-operator-method-call.js | 26 +- ...patch-considered-as-non-reactive.expect.md | 2 +- ...ate-dispatch-considered-as-non-reactive.js | 2 +- ...-value-dont-preserve-memoization.expect.md | 4 +- ...mutable-value-dont-preserve-memoization.js | 4 +- ...table-value-preserve-memoization.expect.md | 4 +- ...aybe-mutable-value-preserve-memoization.js | 4 +- ...t-preserve-memoization-guarantee.expect.md | 11 +- ...ble-dont-preserve-memoization-guarantee.js | 11 +- ...e-preserve-memoization-guarantee.expect.md | 11 +- ...variable-preserve-memoization-guarantee.js | 11 +- ...ng-same-ref-preserve-memoization.expect.md | 6 +- ...modifying-same-ref-preserve-memoization.js | 6 +- ...operty-dont-preserve-memoization.expect.md | 6 +- ...sted-property-dont-preserve-memoization.js | 6 +- ...ed-property-preserve-memoization.expect.md | 6 +- ...ef-nested-property-preserve-memoization.js | 6 +- ...Callback-set-ref-nested-property.expect.md | 6 +- .../useCallback-set-ref-nested-property.js | 6 +- ...-value-dont-preserve-memoization.expect.md | 4 +- ...set-ref-value-dont-preserve-memoization.js | 4 +- ...t-ref-value-preserve-memoization.expect.md | 4 +- ...back-set-ref-value-preserve-memoization.js | 4 +- ...maybe-mutate-context-in-callback.expect.md | 10 +- ...ontext-maybe-mutate-context-in-callback.js | 10 +- ...context-in-callback-if-condition.expect.md | 6 +- ...t-read-context-in-callback-if-condition.js | 6 +- ...Context-read-context-in-callback.expect.md | 6 +- .../useContext-read-context-in-callback.js | 6 +- .../compiler/useEffect-arg-memoized.expect.md | 2 +- .../compiler/useEffect-arg-memoized.js | 2 +- .../useEffect-external-mutate.expect.md | 4 +- .../compiler/useEffect-external-mutate.js | 4 +- .../useEffect-global-pruned.expect.md | 2 +- .../compiler/useEffect-global-pruned.js | 2 +- .../useEffect-namespace-pruned.expect.md | 2 +- .../compiler/useEffect-namespace-pruned.js | 2 +- .../useEffect-nested-lambdas.expect.md | 2 +- .../compiler/useEffect-nested-lambdas.js | 2 +- .../compiler/useEffect-snap-test.expect.md | 6 +- .../fixtures/compiler/useEffect-snap-test.js | 6 +- .../useMemo-inlining-block-return.expect.md | 6 +- .../compiler/useMemo-inlining-block-return.js | 6 +- .../compiler/useMemo-inverted-if.expect.md | 4 +- .../fixtures/compiler/useMemo-inverted-if.js | 4 +- ...d-statement-unconditional-return.expect.md | 4 +- ...-labeled-statement-unconditional-return.js | 4 +- .../compiler/useMemo-logical.expect.md | 4 +- .../fixtures/compiler/useMemo-logical.js | 4 +- ...-preserve-memoization-guarantees.expect.md | 11 +- ...le-dont-preserve-memoization-guarantees.js | 11 +- ...-preserve-memoization-guarantees.expect.md | 11 +- ...ariable-preserve-memoization-guarantees.js | 11 +- ...-preserve-memoization-guarantees.expect.md | 4 +- ...er-dont-preserve-memoization-guarantees.js | 4 +- ...-preserve-memoization-guarantees.expect.md | 4 +- ...d-later-preserve-memoization-guarantees.js | 4 +- .../useMemo-multiple-if-else.expect.md | 4 +- .../compiler/useMemo-multiple-if-else.js | 4 +- .../compiler/useMemo-named-function.expect.md | 4 +- .../compiler/useMemo-named-function.ts | 4 +- .../compiler/useMemo-nested-ifs.expect.md | 4 +- .../fixtures/compiler/useMemo-nested-ifs.js | 4 +- .../useMemo-simple-preserved-nomemo.expect.md | 6 +- .../useMemo-simple-preserved-nomemo.js | 6 +- .../useMemo-simple-preserved.expect.md | 6 +- .../compiler/useMemo-simple-preserved.js | 6 +- .../useMemo-switch-no-fallthrough.expect.md | 6 +- .../compiler/useMemo-switch-no-fallthrough.js | 6 +- .../compiler/useMemo-switch-return.expect.md | 12 +- .../compiler/useMemo-switch-return.js | 12 +- ...urned-dispatcher-is-non-reactive.expect.md | 2 +- ...cer-returned-dispatcher-is-non-reactive.js | 2 +- ...d-other-hook-unpruned-dependency.expect.md | 4 +- ...tate-and-other-hook-unpruned-dependency.js | 4 +- ...-pruned-dependency-change-detect.expect.md | 2 +- ...seState-pruned-dependency-change-detect.js | 2 +- .../useState-unpruned-dependency.expect.md | 4 +- .../compiler/useState-unpruned-dependency.js | 4 +- .../userspace-use-memo-cache.expect.md | 3 +- .../compiler/userspace-use-memo-cache.js | 3 +- ...tion-with-mutable-range-is-valid.expect.md | 8 +- ...ed-function-with-mutable-range-is-valid.js | 8 +- ...hich-conditionally-sets-state-ok.expect.md | 4 +- ...ambda-which-conditionally-sets-state-ok.js | 4 +- .../value-block-mutates-outer-value.expect.md | 8 +- .../value-block-mutates-outer-value.ts | 8 +- .../fixtures/compiler/while-break.expect.md | 4 +- .../fixtures/compiler/while-break.js | 4 +- .../while-conditional-continue.expect.md | 4 +- .../compiler/while-conditional-continue.js | 4 +- .../fixtures/compiler/while-logical.expect.md | 4 +- .../fixtures/compiler/while-logical.js | 4 +- .../compiler/while-property.expect.md | 4 +- .../fixtures/compiler/while-property.js | 4 +- .../src/__tests__/parseConfigPragma-test.ts | 8 +- .../test-utils/validateNoUseBeforeDefine.ts | 24 +- .../babel-plugin-react-compiler/src/index.ts | 12 +- .../__tests__/ReactCompilerRule-test.ts | 48 +- .../ReactCompilerRuleTypescript-test.ts | 24 +- .../babel.config.js | 8 +- .../rollup.config.js | 38 +- .../eslint-plugin-react-compiler/src/index.ts | 4 +- .../src/rules/ReactCompilerRule.ts | 84 +- .../make-read-only-util/jest.config.js | 4 +- .../src/__tests__/makeReadOnly-test.ts | 136 +- .../make-read-only-util/src/makeReadOnly.ts | 48 +- .../rollup.config.js | 48 +- .../src/checks/libraryCompat.ts | 4 +- .../src/checks/reactCompiler.ts | 48 +- .../src/checks/strictMode.ts | 6 +- .../react-compiler-healthcheck/src/config.ts | 2 +- .../react-compiler-healthcheck/src/index.ts | 42 +- .../react-compiler-runtime/rollup.config.js | 30 +- .../react-compiler-runtime/src/index.ts | 136 +- .../packages/snap/src/SproutTodoFilter.ts | 898 ++++----- compiler/packages/snap/src/compiler.ts | 240 ++- compiler/packages/snap/src/constants.ts | 34 +- compiler/packages/snap/src/fixture-utils.ts | 76 +- compiler/packages/snap/src/main.ts | 28 +- compiler/packages/snap/src/reporter.ts | 70 +- compiler/packages/snap/src/runner-watch.ts | 72 +- compiler/packages/snap/src/runner-worker.ts | 52 +- compiler/packages/snap/src/runner.ts | 112 +- .../packages/snap/src/sprout/evaluator.ts | 100 +- compiler/packages/snap/src/sprout/index.ts | 32 +- .../snap/src/sprout/shared-runtime.ts | 64 +- compiler/scripts/copyright.js | 28 +- compiler/scripts/release/prompt-for-otp.js | 6 +- compiler/scripts/release/publish-manual.js | 90 +- compiler/scripts/update-commit-message.js | 52 +- scripts/shared/pathsByLanguageVersion.js | 6 - 1898 files changed, 12439 insertions(+), 12665 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index 5f3e78b0b83d2..aa54cbae1f9f8 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,10 +1,6 @@ 'use strict'; -const { - compilerPaths, - esNextPaths, - typescriptPaths, -} = require('./scripts/shared/pathsByLanguageVersion'); +const {esNextPaths} = require('./scripts/shared/pathsByLanguageVersion'); module.exports = { bracketSpacing: false, @@ -28,25 +24,11 @@ module.exports = { }, }, { - files: typescriptPaths, + files: ['*.ts', '*.tsx'], options: { trailingComma: 'all', parser: 'typescript', }, }, - { - files: compilerPaths, - options: { - requirePragma: false, - parser: 'babel-ts', - semi: true, - singleQuote: false, - trailingComma: 'es5', - bracketSpacing: true, - bracketSameLine: false, - printWidth: 80, - arrowParens: 'always', - }, - }, ], }; diff --git a/compiler/apps/playground/__tests__/e2e/page.spec.ts b/compiler/apps/playground/__tests__/e2e/page.spec.ts index 3bb6637f95419..bc93352a0992a 100644 --- a/compiler/apps/playground/__tests__/e2e/page.spec.ts +++ b/compiler/apps/playground/__tests__/e2e/page.spec.ts @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import { expect, test } from "@playwright/test"; -import { encodeStore, type Store } from "../../lib/stores"; +import {expect, test} from '@playwright/test'; +import {encodeStore, type Store} from '../../lib/stores'; const STORE: Store = { source: `export default function TestComponent({ x }) { @@ -17,33 +17,33 @@ const STORE: Store = { const HASH = encodeStore(STORE); function concat(data: Array): string { - return data.join(""); + return data.join(''); } -test("editor should compile successfully", async ({ page }) => { - await page.goto(`/#${HASH}`, { waitUntil: "networkidle" }); +test('editor should compile successfully', async ({page}) => { + await page.goto(`/#${HASH}`, {waitUntil: 'networkidle'}); await page.screenshot({ fullPage: true, - path: "test-results/00-on-networkidle.png", + path: 'test-results/00-on-networkidle.png', }); // User input from hash compiles await page.screenshot({ fullPage: true, - path: "test-results/01-show-js-before.png", + path: 'test-results/01-show-js-before.png', }); const userInput = - (await page.locator(".monaco-editor").nth(2).allInnerTexts()) ?? []; - expect(concat(userInput)).toMatchSnapshot("user-input.txt"); + (await page.locator('.monaco-editor').nth(2).allInnerTexts()) ?? []; + expect(concat(userInput)).toMatchSnapshot('user-input.txt'); // Reset button works - page.on("dialog", (dialog) => dialog.accept()); - await page.getByRole("button", { name: "Reset" }).click(); + page.on('dialog', dialog => dialog.accept()); + await page.getByRole('button', {name: 'Reset'}).click(); await page.screenshot({ fullPage: true, - path: "test-results/02-show-js-after.png", + path: 'test-results/02-show-js-after.png', }); const defaultInput = - (await page.locator(".monaco-editor").nth(2).allInnerTexts()) ?? []; - expect(concat(defaultInput)).toMatchSnapshot("default-input.txt"); + (await page.locator('.monaco-editor').nth(2).allInnerTexts()) ?? []; + expect(concat(defaultInput)).toMatchSnapshot('default-input.txt'); }); diff --git a/compiler/apps/playground/app/index.tsx b/compiler/apps/playground/app/index.tsx index 75411cd36ef8d..3bbf2e9b5558c 100644 --- a/compiler/apps/playground/app/index.tsx +++ b/compiler/apps/playground/app/index.tsx @@ -5,25 +5,24 @@ * LICENSE file in the root directory of this source tree. */ -import type { NextPage } from "next"; -import Head from "next/head"; -import { SnackbarProvider } from "notistack"; -import { Editor, Header, StoreProvider } from "../components"; -import MessageSnackbar from "../components/Message"; +import type {NextPage} from 'next'; +import Head from 'next/head'; +import {SnackbarProvider} from 'notistack'; +import {Editor, Header, StoreProvider} from '../components'; +import MessageSnackbar from '../components/Message'; const Home: NextPage = () => { return (
- {process.env.NODE_ENV === "development" - ? "[DEV] React Compiler Playground" - : "React Compiler Playground"} + {process.env.NODE_ENV === 'development' + ? '[DEV] React Compiler Playground' + : 'React Compiler Playground'} + content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> { + Components={{message: MessageSnackbar}}>
diff --git a/compiler/apps/playground/app/layout.tsx b/compiler/apps/playground/app/layout.tsx index be0d04e932d90..3e888ae955a89 100644 --- a/compiler/apps/playground/app/layout.tsx +++ b/compiler/apps/playground/app/layout.tsx @@ -5,26 +5,21 @@ * LICENSE file in the root directory of this source tree. */ -import "../styles/globals.css"; +import '../styles/globals.css'; -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { - "use no memo"; +export default function RootLayout({children}: {children: React.ReactNode}) { + 'use no memo'; return ( - {process.env.NODE_ENV === "development" - ? "[DEV] React Compiler Playground" - : "React Compiler Playground"} + {process.env.NODE_ENV === 'development' + ? '[DEV] React Compiler Playground' + : 'React Compiler Playground'} + content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> + Components={{message: MessageSnackbar}}>
diff --git a/compiler/apps/playground/babel.config.js b/compiler/apps/playground/babel.config.js index 900b52dd3028c..0edf2e9b72d70 100644 --- a/compiler/apps/playground/babel.config.js +++ b/compiler/apps/playground/babel.config.js @@ -8,12 +8,12 @@ module.exports = function (api) { api.cache(true); return { - presets: ["next/babel"], + presets: ['next/babel'], plugins: [ [ - "babel-plugin-react-compiler", + 'babel-plugin-react-compiler', { - runtimeModule: "react-compiler-runtime", + runtimeModule: 'react-compiler-runtime', }, ], ], diff --git a/compiler/apps/playground/colors.js b/compiler/apps/playground/colors.js index 7259e1f32bc8f..bd5f1426f5ed7 100644 --- a/compiler/apps/playground/colors.js +++ b/compiler/apps/playground/colors.js @@ -11,86 +11,86 @@ module.exports = { // Text colors - primary: "#23272F", // gray-90 - "primary-dark": "#F6F7F9", // gray-5 - secondary: "#404756", // gray-70 - "secondary-dark": "#EBECF0", // gray-10 - link: "#087EA4", // blue-50 - "link-dark": "#149ECA", // blue-40 - syntax: "#EBECF0", // gray-10 - wash: "#FFFFFF", - "wash-dark": "#23272F", // gray-90 - card: "#F6F7F9", // gray-05 - "card-dark": "#343A46", // gray-80 - highlight: "#E6F7FF", // blue-10 - "highlight-dark": "rgba(88,175,223,.1)", - border: "#EBECF0", // gray-10 - "border-dark": "#343A46", // gray-80 - "secondary-button": "#EBECF0", // gray-10 - "secondary-button-dark": "#404756", // gray-70 + primary: '#23272F', // gray-90 + 'primary-dark': '#F6F7F9', // gray-5 + secondary: '#404756', // gray-70 + 'secondary-dark': '#EBECF0', // gray-10 + link: '#087EA4', // blue-50 + 'link-dark': '#149ECA', // blue-40 + syntax: '#EBECF0', // gray-10 + wash: '#FFFFFF', + 'wash-dark': '#23272F', // gray-90 + card: '#F6F7F9', // gray-05 + 'card-dark': '#343A46', // gray-80 + highlight: '#E6F7FF', // blue-10 + 'highlight-dark': 'rgba(88,175,223,.1)', + border: '#EBECF0', // gray-10 + 'border-dark': '#343A46', // gray-80 + 'secondary-button': '#EBECF0', // gray-10 + 'secondary-button-dark': '#404756', // gray-70 // Gray - "gray-95": "#16181D", - "gray-90": "#23272F", - "gray-80": "#343A46", - "gray-70": "#404756", - "gray-60": "#4E5769", - "gray-50": "#5E687E", // unused - "gray-40": "#78839B", - "gray-30": "#99A1B3", - "gray-20": "#BCC1CD", - "gray-10": "#EBECF0", - "gray-5": "#F6F7F9", + 'gray-95': '#16181D', + 'gray-90': '#23272F', + 'gray-80': '#343A46', + 'gray-70': '#404756', + 'gray-60': '#4E5769', + 'gray-50': '#5E687E', // unused + 'gray-40': '#78839B', + 'gray-30': '#99A1B3', + 'gray-20': '#BCC1CD', + 'gray-10': '#EBECF0', + 'gray-5': '#F6F7F9', // Blue - "blue-60": "#045975", - "blue-50": "#087EA4", - "blue-40": "#149ECA", // Brand Blue - "blue-30": "#58C4DC", // unused - "blue-20": "#ABE2ED", - "blue-10": "#E6F7FF", // todo: doesn't match illustrations - "blue-5": "#E6F6FA", + 'blue-60': '#045975', + 'blue-50': '#087EA4', + 'blue-40': '#149ECA', // Brand Blue + 'blue-30': '#58C4DC', // unused + 'blue-20': '#ABE2ED', + 'blue-10': '#E6F7FF', // todo: doesn't match illustrations + 'blue-5': '#E6F6FA', // Yellow - "yellow-60": "#B65700", - "yellow-50": "#C76A15", - "yellow-40": "#DB7D27", // unused - "yellow-30": "#FABD62", // unused - "yellow-20": "#FCDEB0", // unused - "yellow-10": "#FDE7C7", - "yellow-5": "#FEF5E7", + 'yellow-60': '#B65700', + 'yellow-50': '#C76A15', + 'yellow-40': '#DB7D27', // unused + 'yellow-30': '#FABD62', // unused + 'yellow-20': '#FCDEB0', // unused + 'yellow-10': '#FDE7C7', + 'yellow-5': '#FEF5E7', // Purple - "purple-60": "#2B3491", // unused - "purple-50": "#575FB7", - "purple-40": "#6B75DB", - "purple-30": "#8891EC", - "purple-20": "#C3C8F5", // unused - "purple-10": "#E7E9FB", - "purple-5": "#F3F4FD", + 'purple-60': '#2B3491', // unused + 'purple-50': '#575FB7', + 'purple-40': '#6B75DB', + 'purple-30': '#8891EC', + 'purple-20': '#C3C8F5', // unused + 'purple-10': '#E7E9FB', + 'purple-5': '#F3F4FD', // Green - "green-60": "#2B6E62", - "green-50": "#388F7F", - "green-40": "#44AC99", - "green-30": "#7FCCBF", - "green-20": "#ABDED5", - "green-10": "#E5F5F2", - "green-5": "#F4FBF9", + 'green-60': '#2B6E62', + 'green-50': '#388F7F', + 'green-40': '#44AC99', + 'green-30': '#7FCCBF', + 'green-20': '#ABDED5', + 'green-10': '#E5F5F2', + 'green-5': '#F4FBF9', // RED - "red-60": "#712D28", - "red-50": "#A6423A", // unused - "red-40": "#C1554D", - "red-30": "#D07D77", - "red-20": "#E5B7B3", // unused - "red-10": "#F2DBD9", // unused - "red-5": "#FAF1F0", + 'red-60': '#712D28', + 'red-50': '#A6423A', // unused + 'red-40': '#C1554D', + 'red-30': '#D07D77', + 'red-20': '#E5B7B3', // unused + 'red-10': '#F2DBD9', // unused + 'red-5': '#FAF1F0', // MISC - "code-block": "#99a1b30f", // gray-30 @ 6% - "gradient-blue": "#58C4DC", // Only used for the landing gradient for now. + 'code-block': '#99a1b30f', // gray-30 @ 6% + 'gradient-blue': '#58C4DC', // Only used for the landing gradient for now. github: { - highlight: "#fffbdd", + highlight: '#fffbdd', }, }; diff --git a/compiler/apps/playground/components/Editor/EditorImpl.tsx b/compiler/apps/playground/components/Editor/EditorImpl.tsx index a96672194b0f2..ebac65dc4b9f2 100644 --- a/compiler/apps/playground/components/Editor/EditorImpl.tsx +++ b/compiler/apps/playground/components/Editor/EditorImpl.tsx @@ -5,10 +5,10 @@ * LICENSE file in the root directory of this source tree. */ -import { parse as babelParse, ParserPlugin } from "@babel/parser"; -import * as HermesParser from "hermes-parser"; -import traverse, { NodePath } from "@babel/traverse"; -import * as t from "@babel/types"; +import {parse as babelParse, ParserPlugin} from '@babel/parser'; +import * as HermesParser from 'hermes-parser'; +import traverse, {NodePath} from '@babel/traverse'; +import * as t from '@babel/types'; import { CompilerError, CompilerErrorDetail, @@ -20,51 +20,51 @@ import { run, ValueKind, type Hook, -} from "babel-plugin-react-compiler/src"; -import { type ReactFunctionType } from "babel-plugin-react-compiler/src/HIR/Environment"; -import clsx from "clsx"; -import invariant from "invariant"; -import { useSnackbar } from "notistack"; -import { useDeferredValue, useMemo } from "react"; -import { useMountEffect } from "../../hooks"; -import { defaultStore } from "../../lib/defaultStore"; +} from 'babel-plugin-react-compiler/src'; +import {type ReactFunctionType} from 'babel-plugin-react-compiler/src/HIR/Environment'; +import clsx from 'clsx'; +import invariant from 'invariant'; +import {useSnackbar} from 'notistack'; +import {useDeferredValue, useMemo} from 'react'; +import {useMountEffect} from '../../hooks'; +import {defaultStore} from '../../lib/defaultStore'; import { createMessage, initStoreFromUrlOrLocalStorage, MessageLevel, MessageSource, type Store, -} from "../../lib/stores"; -import { useStore, useStoreDispatch } from "../StoreContext"; -import Input from "./Input"; +} from '../../lib/stores'; +import {useStore, useStoreDispatch} from '../StoreContext'; +import Input from './Input'; import { CompilerOutput, default as Output, PrintedCompilerPipelineValue, -} from "./Output"; -import { printFunctionWithOutlined } from "babel-plugin-react-compiler/src/HIR/PrintHIR"; -import { printReactiveFunctionWithOutlined } from "babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction"; +} from './Output'; +import {printFunctionWithOutlined} from 'babel-plugin-react-compiler/src/HIR/PrintHIR'; +import {printReactiveFunctionWithOutlined} from 'babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction'; -function parseInput(input: string, language: "flow" | "typescript") { +function parseInput(input: string, language: 'flow' | 'typescript') { // Extract the first line to quickly check for custom test directives - if (language === "flow") { + if (language === 'flow') { return HermesParser.parse(input, { babel: true, - flow: "all", - sourceType: "module", + flow: 'all', + sourceType: 'module', enableExperimentalComponentSyntax: true, }); } else { return babelParse(input, { - plugins: ["typescript", "jsx"], - sourceType: "module", + plugins: ['typescript', 'jsx'], + sourceType: 'module', }); } } function parseFunctions( source: string, - language: "flow" | "typescript" + language: 'flow' | 'typescript', ): Array< NodePath< t.FunctionDeclaration | t.ArrowFunctionExpression | t.FunctionExpression @@ -105,7 +105,7 @@ function parseFunctions( const COMMON_HOOKS: Array<[string, Hook]> = [ [ - "useFragment", + 'useFragment', { valueKind: ValueKind.Frozen, effectKind: Effect.Freeze, @@ -114,7 +114,7 @@ const COMMON_HOOKS: Array<[string, Hook]> = [ }, ], [ - "usePaginationFragment", + 'usePaginationFragment', { valueKind: ValueKind.Frozen, effectKind: Effect.Freeze, @@ -123,7 +123,7 @@ const COMMON_HOOKS: Array<[string, Hook]> = [ }, ], [ - "useRefetchableFragment", + 'useRefetchableFragment', { valueKind: ValueKind.Frozen, effectKind: Effect.Freeze, @@ -132,7 +132,7 @@ const COMMON_HOOKS: Array<[string, Hook]> = [ }, ], [ - "useLazyLoadQuery", + 'useLazyLoadQuery', { valueKind: ValueKind.Frozen, effectKind: Effect.Freeze, @@ -141,7 +141,7 @@ const COMMON_HOOKS: Array<[string, Hook]> = [ }, ], [ - "usePreloadedQuery", + 'usePreloadedQuery', { valueKind: ValueKind.Frozen, effectKind: Effect.Freeze, @@ -156,22 +156,22 @@ function isHookName(s: string): boolean { } function getReactFunctionType( - id: NodePath + id: NodePath, ): ReactFunctionType { if (id && id.node && id.isIdentifier()) { if (isHookName(id.node.name)) { - return "Hook"; + return 'Hook'; } const isPascalCaseNameSpace = /^[A-Z].*/; if (isPascalCaseNameSpace.test(id.node.name)) { - return "Component"; + return 'Component'; } } - return "Other"; + return 'Other'; } -function compile(source: string): [CompilerOutput, "flow" | "typescript"] { +function compile(source: string): [CompilerOutput, 'flow' | 'typescript'] { const results = new Map(); const error = new CompilerError(); const upsert = (result: PrintedCompilerPipelineValue) => { @@ -182,15 +182,15 @@ function compile(source: string): [CompilerOutput, "flow" | "typescript"] { results.set(result.name, [result]); } }; - let language: "flow" | "typescript"; + let language: 'flow' | 'typescript'; if (source.match(/\@flow/)) { - language = "flow"; + language = 'flow'; } else { - language = "typescript"; + language = 'typescript'; } try { // Extract the first line to quickly check for custom test directives - const pragma = source.substring(0, source.indexOf("\n")); + const pragma = source.substring(0, source.indexOf('\n')); const config = parseConfigPragma(pragma); for (const fn of parseFunctions(source, language)) { @@ -199,16 +199,16 @@ function compile(source: string): [CompilerOutput, "flow" | "typescript"] { new CompilerErrorDetail({ reason: `Unexpected function type ${fn.node.type}`, description: - "Playground only supports parsing function declarations", + 'Playground only supports parsing function declarations', severity: ErrorSeverity.Todo, loc: fn.node.loc ?? null, suggestions: null, - }) + }), ); continue; } - const id = fn.get("id"); + const id = fn.get('id'); for (const result of run( fn, { @@ -216,20 +216,20 @@ function compile(source: string): [CompilerOutput, "flow" | "typescript"] { customHooks: new Map([...COMMON_HOOKS]), }, getReactFunctionType(id), - "_c", + '_c', + null, null, null, - null )) { const fnName = fn.node.id?.name ?? null; switch (result.kind) { - case "ast": { + case 'ast': { upsert({ - kind: "ast", + kind: 'ast', fnName, name: result.name, value: { - type: "FunctionDeclaration", + type: 'FunctionDeclaration', id: result.value.id, async: result.value.async, generator: result.value.generator, @@ -239,27 +239,27 @@ function compile(source: string): [CompilerOutput, "flow" | "typescript"] { }); break; } - case "hir": { + case 'hir': { upsert({ - kind: "hir", + kind: 'hir', fnName, name: result.name, value: printFunctionWithOutlined(result.value), }); break; } - case "reactive": { + case 'reactive': { upsert({ - kind: "reactive", + kind: 'reactive', fnName, name: result.name, value: printReactiveFunctionWithOutlined(result.value), }); break; } - case "debug": { + case 'debug': { upsert({ - kind: "debug", + kind: 'debug', fnName, name: result.name, value: result.value, @@ -288,24 +288,24 @@ function compile(source: string): [CompilerOutput, "flow" | "typescript"] { reason: `Unexpected failure when transforming input! ${err}`, loc: null, suggestions: null, - }) + }), ); } } if (error.hasErrors()) { - return [{ kind: "err", results, error: error }, language]; + return [{kind: 'err', results, error: error}, language]; } - return [{ kind: "ok", results }, language]; + return [{kind: 'ok', results}, language]; } export default function Editor() { const store = useStore(); const deferredStore = useDeferredValue(store); const dispatchStore = useStoreDispatch(); - const { enqueueSnackbar } = useSnackbar(); + const {enqueueSnackbar} = useSnackbar(); const [compilerOutput, language] = useMemo( () => compile(deferredStore.source), - [deferredStore.source] + [deferredStore.source], ); useMountEffect(() => { @@ -313,35 +313,35 @@ export default function Editor() { try { mountStore = initStoreFromUrlOrLocalStorage(); } catch (e) { - invariant(e instanceof Error, "Only Error may be caught."); + invariant(e instanceof Error, 'Only Error may be caught.'); enqueueSnackbar(e.message, { - variant: "message", + variant: 'message', ...createMessage( - "Bad URL - fell back to the default Playground.", + 'Bad URL - fell back to the default Playground.', MessageLevel.Info, - MessageSource.Playground + MessageSource.Playground, ), }); mountStore = defaultStore; } dispatchStore({ - type: "setStore", - payload: { store: mountStore }, + type: 'setStore', + payload: {store: mountStore}, }); }); return ( <>
-
+
-
+
diff --git a/compiler/apps/playground/components/Editor/Input.tsx b/compiler/apps/playground/components/Editor/Input.tsx index 219f13ba239f8..c2ce8efc70d3f 100644 --- a/compiler/apps/playground/components/Editor/Input.tsx +++ b/compiler/apps/playground/components/Editor/Input.tsx @@ -5,28 +5,28 @@ * LICENSE file in the root directory of this source tree. */ -import MonacoEditor, { loader, type Monaco } from "@monaco-editor/react"; -import { CompilerErrorDetail } from "babel-plugin-react-compiler/src"; -import invariant from "invariant"; -import type { editor } from "monaco-editor"; -import * as monaco from "monaco-editor"; -import { Resizable } from "re-resizable"; -import { useEffect, useState } from "react"; -import { renderReactCompilerMarkers } from "../../lib/reactCompilerMonacoDiagnostics"; -import { useStore, useStoreDispatch } from "../StoreContext"; -import { monacoOptions } from "./monacoOptions"; +import MonacoEditor, {loader, type Monaco} from '@monaco-editor/react'; +import {CompilerErrorDetail} from 'babel-plugin-react-compiler/src'; +import invariant from 'invariant'; +import type {editor} from 'monaco-editor'; +import * as monaco from 'monaco-editor'; +import {Resizable} from 're-resizable'; +import {useEffect, useState} from 'react'; +import {renderReactCompilerMarkers} from '../../lib/reactCompilerMonacoDiagnostics'; +import {useStore, useStoreDispatch} from '../StoreContext'; +import {monacoOptions} from './monacoOptions'; // TODO: Make TS recognize .d.ts files, in addition to loading them with webpack. // @ts-ignore -import React$Types from "../../node_modules/@types/react/index.d.ts"; +import React$Types from '../../node_modules/@types/react/index.d.ts'; -loader.config({ monaco }); +loader.config({monaco}); type Props = { errors: CompilerErrorDetail[]; - language: "flow" | "typescript"; + language: 'flow' | 'typescript'; }; -export default function Input({ errors, language }: Props) { +export default function Input({errors, language}: Props) { const [monaco, setMonaco] = useState(null); const store = useStore(); const dispatchStore = useStoreDispatch(); @@ -36,11 +36,11 @@ export default function Input({ errors, language }: Props) { if (!monaco) return; const uri = monaco.Uri.parse(`file:///index.js`); const model = monaco.editor.getModel(uri); - invariant(model, "Model must exist for the selected input file."); - renderReactCompilerMarkers({ monaco, model, details: errors }); + invariant(model, 'Model must exist for the selected input file.'); + renderReactCompilerMarkers({monaco, model, details: errors}); // N.B. that `tabSize` is a model property, not an editor property. // So, the tab size has to be set per model. - model.updateOptions({ tabSize: 2 }); + model.updateOptions({tabSize: 2}); }, [monaco, errors]); const flowDiagnosticDisable = [ @@ -64,11 +64,11 @@ export default function Input({ errors, language }: Props) { 8011, 8012, 8013, - ...(language === "flow" ? flowDiagnosticDisable : []), + ...(language === 'flow' ? flowDiagnosticDisable : []), ], noSemanticValidation: true, // Monaco can't validate Flow component syntax - noSyntaxValidation: language === "flow", + noSyntaxValidation: language === 'flow', }); }, [monaco, language]); @@ -76,7 +76,7 @@ export default function Input({ errors, language }: Props) { if (!value) return; dispatchStore({ - type: "updateFile", + type: 'updateFile', payload: { source: value, }, @@ -91,11 +91,11 @@ export default function Input({ errors, language }: Props) { target: monaco.languages.typescript.ScriptTarget.ES2015, moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs, jsx: monaco.languages.typescript.JsxEmit.Preserve, - typeRoots: ["node_modules/@types"], + typeRoots: ['node_modules/@types'], allowSyntheticDefaultImports: true, }; monaco.languages.typescript.javascriptDefaults.setCompilerOptions( - tscOptions + tscOptions, ); monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ ...tscOptions, @@ -106,7 +106,7 @@ export default function Input({ errors, language }: Props) { // Add React type declarations to Monaco const reactLib = [ React$Types, - "file:///node_modules/@types/react/index.d.ts", + 'file:///node_modules/@types/react/index.d.ts', ] as [any, string]; monaco.languages.typescript.javascriptDefaults.addExtraLib(...reactLib); monaco.languages.typescript.typescriptDefaults.addExtraLib(...reactLib); @@ -124,17 +124,16 @@ export default function Input({ errors, language }: Props) {
+ className="!h-[calc(100vh_-_3.5rem)]"> } + | {kind: 'ok'; results: Map} | { - kind: "err"; + kind: 'err'; results: Map; error: CompilerError; }; @@ -63,7 +63,7 @@ async function tabify(source: string, compilerOutput: CompilerOutput) { for (const [passName, results] of compilerOutput.results) { for (const result of results) { switch (result.kind) { - case "hir": { + case 'hir': { const prev = concattedResults.get(result.name); const next = result.value; const identName = `function ${result.fnName}`; @@ -74,7 +74,7 @@ async function tabify(source: string, compilerOutput: CompilerOutput) { } break; } - case "reactive": { + case 'reactive': { const prev = concattedResults.get(passName); const next = result.value; if (prev != null) { @@ -84,30 +84,29 @@ async function tabify(source: string, compilerOutput: CompilerOutput) { } break; } - case "ast": + case 'ast': topLevelFnDecls.push(result.value); break; - case "debug": { + case 'debug': { concattedResults.set(passName, result.value); break; } default: { const _: never = result; - throw new Error("Unexpected result kind"); + throw new Error('Unexpected result kind'); } } } } let lastPassOutput: string | null = null; - let nonDiffPasses = ["HIR", "BuildReactiveFunction", "EnvironmentConfig"]; + let nonDiffPasses = ['HIR', 'BuildReactiveFunction', 'EnvironmentConfig']; for (const [passName, text] of concattedResults) { tabs.set( passName, + showInfoPanel={!nonDiffPasses.includes(passName)}>, ); lastPassOutput = text; } @@ -116,25 +115,24 @@ async function tabify(source: string, compilerOutput: CompilerOutput) { // Make a synthetic Program so we can have a single AST with all the top level // FunctionDeclarations const ast = t.program(topLevelFnDecls); - const { code, sourceMapUrl } = await codegen(ast, source); + const {code, sourceMapUrl} = await codegen(ast, source); reorderedTabs.set( - "JS", + 'JS', + showInfoPanel={false}>, ); if (sourceMapUrl) { reorderedTabs.set( - "SourceMap", + 'SourceMap', <>