@samitouri / QOS-React-1 / commits / 09d122a20e

[be] Remove @enableMergeConsecutiveScopes flag, feature is stable

Continuing on my quest to clean up our feature flags, the logic for merging consecutive feature flags is stable. Let's remove `@enableMergeConsecutiveScopes` since this is enabled everywhere.

Joe Savona committed Feb 14, 2024 at 15:13 UTC 09d122a20e0fc416a4056e43549241a0d2d7e1c6
10 files changed +8 -23
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts
+6 -8
@@ -305,14 +305,12 @@ function* runWithEnvironment(
305 value: reactiveFunction,
306 });
307
308 - if (env.config.enableMergeConsecutiveScopes) {
309 - mergeReactiveScopesThatInvalidateTogether(reactiveFunction);
310 - yield log({
311 - kind: "reactive",
312 - name: "MergeReactiveScopesThatInvalidateTogether",
313 - value: reactiveFunction,
314 - });
315 - }
308 + mergeReactiveScopesThatInvalidateTogether(reactiveFunction);
309 + yield log({
310 + kind: "reactive",
311 + name: "MergeReactiveScopesThatInvalidateTogether",
312 + value: reactiveFunction,
313 + });
314
315 promoteUsedTemporaries(reactiveFunction);
316 yield log({
compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts
-3
@@ -271,9 +271,6 @@ const EnvironmentConfigSchema = z.object({
271 */
272 enableEmitInstrumentForget: ExternalFunctionSchema.nullish(),
273
274 - // Enable merging consecutive scopes that invalidate together.
275 - enableMergeConsecutiveScopes: z.boolean().default(true),
276 -
274 /**
275 * Enable support for reactive scopes that contain an early return.
276 * This is relatively infrequent, as reactive scopes generally span
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/merge-consecutive-scopes-objects.expect.md
-2
@@ -5,7 +5,6 @@
5 import { useState } from "react";
6 import { Stringify } from "shared-runtime";
7
8 -// @enableMergeConsecutiveScopes
8 // This is a translation of the original merge-consecutive-scopes which uses plain objects
9 // to describe the UI instead of JSX. The JSXText elements in that fixture happen to
10 // prevent scome scopes from merging, which concealed a bug with the merging logic.
@@ -39,7 +38,6 @@ export const FIXTURE_ENTRYPOINT = {
38 import { useState, unstable_useMemoCache as useMemoCache } from "react";
39 import { Stringify } from "shared-runtime";
40
42 -// @enableMergeConsecutiveScopes
41 // This is a translation of the original merge-consecutive-scopes which uses plain objects
42 // to describe the UI instead of JSX. The JSXText elements in that fixture happen to
43 // prevent scome scopes from merging, which concealed a bug with the merging logic.
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/merge-consecutive-scopes-objects.js
-1
@@ -1,7 +1,6 @@
1 import { useState } from "react";
2 import { Stringify } from "shared-runtime";
3
4 -// @enableMergeConsecutiveScopes
4 // This is a translation of the original merge-consecutive-scopes which uses plain objects
5 // to describe the UI instead of JSX. The JSXText elements in that fixture happen to
6 // prevent scome scopes from merging, which concealed a bug with the merging logic.
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/merge-consecutive-scopes.expect.md
-2
@@ -5,7 +5,6 @@
5 import { useState } from "react";
6 import { Stringify } from "shared-runtime";
7
8 -// @enableMergeConsecutiveScopes
8 function Component() {
9 let [state, setState] = useState(0);
10 return (
@@ -32,7 +31,6 @@ export const FIXTURE_ENTRYPOINT = {
31 import { useState, unstable_useMemoCache as useMemoCache } from "react";
32 import { Stringify } from "shared-runtime";
33
35 -// @enableMergeConsecutiveScopes
34 function Component() {
35 const $ = useMemoCache(8);
36 const [state, setState] = useState(0);
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/merge-consecutive-scopes.js
-1
@@ -1,7 +1,6 @@
1 import { useState } from "react";
2 import { Stringify } from "shared-runtime";
3
4 -// @enableMergeConsecutiveScopes
4 function Component() {
5 let [state, setState] = useState(0);
6 return (
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/merge-nested-scopes-with-same-inputs.expect.md
+1 -2
@@ -2,7 +2,6 @@
2 ## Input
3
4 ```javascript
5 -// @enableMergeConsecutiveScopes
5 import { setProperty } from "shared-runtime";
6
7 function Component(props) {
@@ -31,7 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 ## Code
31
32 ```javascript
34 -import { unstable_useMemoCache as useMemoCache } from "react"; // @enableMergeConsecutiveScopes
33 +import { unstable_useMemoCache as useMemoCache } from "react";
34 import { setProperty } from "shared-runtime";
35
36 function Component(props) {
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/merge-nested-scopes-with-same-inputs.js
-1
@@ -1,4 +1,3 @@
1 -// @enableMergeConsecutiveScopes
1 import { setProperty } from "shared-runtime";
2
3 function Component(props) {
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/repro-duplicate-instruction-from-merge-consecutive-scopes.expect.md
+1 -2
@@ -2,7 +2,6 @@
2 ## Input
3
4 ```javascript
5 -// @enableMergeConsecutiveScopes
5 import { Stringify } from "shared-runtime";
6
7 function Component({ id }) {
@@ -26,7 +25,7 @@ export const FIXTURE_ENTRYPOINT = {
25 ## Code
26
27 ```javascript
29 -import { unstable_useMemoCache as useMemoCache } from "react"; // @enableMergeConsecutiveScopes
28 +import { unstable_useMemoCache as useMemoCache } from "react";
29 import { Stringify } from "shared-runtime";
30
31 function Component(t23) {
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/repro-duplicate-instruction-from-merge-consecutive-scopes.js
-1
@@ -1,4 +1,3 @@
1 -// @enableMergeConsecutiveScopes
1 import { Stringify } from "shared-runtime";
2
3 function Component({ id }) {