@samitouri / QOS-React / commits / 7943da1e81

Set accurate value for alwaysThrottleRetries on www (#32684)

This flag value was updated in https://github.com/facebook/react/pull/28965 (seemingly unrelated, maybe as part of unit testing). But its still controlled by a dynamic flag in www. Let's update this to VARIANT to accurately represent the state of the rollout. Before: <img width="1340" alt="Screenshot 2025-03-20 at 10 45 30 AM" src="https://github.com/user-attachments/assets/d0405a36-eb71-4108-9e23-8d462cc68fb4" /> After: <img width="1351" alt="Screenshot 2025-03-20 at 10 45 11 AM" src="https://github.com/user-attachments/assets/459d260d-7a25-430b-95a6-d6a91d958417" />

Jack Pope committed Mar 20, 2025 at 14:28 UTC 7943da1e81bb8730db78db99af5f967bdf213a75
2 files changed +52 -49
packages/react-dom/src/__tests__/ReactDOMFloat-test.js
+51 -48
@@ -3360,27 +3360,29 @@ body {
3360 });
3361 await waitForAll([]);
3362
3363 - // Although the commit suspended, a preload was inserted.
3364 - expect(getMeaningfulChildren(document)).toEqual(
3365 - <html>
3366 - <head>
3367 - <link rel="preload" href="foo" as="style" />
3368 - </head>
3369 - <body>loading...</body>
3370 - </html>,
3371 - );
3363 + if (gate(flags => flags.alwaysThrottleRetries)) {
3364 + // Although the commit suspended, a preload was inserted.
3365 + expect(getMeaningfulChildren(document)).toEqual(
3366 + <html>
3367 + <head>
3368 + <link rel="preload" href="foo" as="style" />
3369 + </head>
3370 + <body>loading...</body>
3371 + </html>,
3372 + );
3373
3373 - loadPreloads(['foo']);
3374 - assertLog(['load preload: foo']);
3375 - expect(getMeaningfulChildren(document)).toEqual(
3376 - <html>
3377 - <head>
3378 - <link rel="stylesheet" href="foo" data-precedence="default" />
3379 - <link rel="preload" href="foo" as="style" />
3380 - </head>
3381 - <body>loading...</body>
3382 - </html>,
3383 - );
3374 + loadPreloads(['foo']);
3375 + assertLog(['load preload: foo']);
3376 + expect(getMeaningfulChildren(document)).toEqual(
3377 + <html>
3378 + <head>
3379 + <link rel="stylesheet" href="foo" data-precedence="default" />
3380 + <link rel="preload" href="foo" as="style" />
3381 + </head>
3382 + <body>loading...</body>
3383 + </html>,
3384 + );
3385 + }
3386
3387 loadStylesheets(['foo']);
3388 assertLog(['load stylesheet: foo']);
@@ -3410,35 +3412,36 @@ body {
3412 );
3413 });
3414 await waitForAll([]);
3413 - expect(getMeaningfulChildren(document)).toEqual(
3414 - <html>
3415 - <head>
3416 - <link rel="stylesheet" href="foo" data-precedence="default" />
3417 - <link rel="preload" href="foo" as="style" />
3418 - <link rel="preload" href="bar" as="style" />
3419 - </head>
3420 - <body>
3421 - <div style="display: none;">hello</div>loading...
3422 - </body>
3423 - </html>,
3424 - );
3425 -
3426 - loadPreloads(['bar']);
3427 - assertLog(['load preload: bar']);
3428 - expect(getMeaningfulChildren(document)).toEqual(
3429 - <html>
3430 - <head>
3431 - <link rel="stylesheet" href="foo" data-precedence="default" />
3432 - <link rel="stylesheet" href="bar" data-precedence="default" />
3433 - <link rel="preload" href="foo" as="style" />
3434 - <link rel="preload" href="bar" as="style" />
3435 - </head>
3436 - <body>
3437 - <div style="display: none;">hello</div>loading...
3438 - </body>
3439 - </html>,
3440 - );
3415 + if (gate(flags => flags.alwaysThrottleRetries)) {
3416 + expect(getMeaningfulChildren(document)).toEqual(
3417 + <html>
3418 + <head>
3419 + <link rel="stylesheet" href="foo" data-precedence="default" />
3420 + <link rel="preload" href="foo" as="style" />
3421 + <link rel="preload" href="bar" as="style" />
3422 + </head>
3423 + <body>
3424 + <div style="display: none;">hello</div>loading...
3425 + </body>
3426 + </html>,
3427 + );
3428
3429 + loadPreloads(['bar']);
3430 + assertLog(['load preload: bar']);
3431 + expect(getMeaningfulChildren(document)).toEqual(
3432 + <html>
3433 + <head>
3434 + <link rel="stylesheet" href="foo" data-precedence="default" />
3435 + <link rel="stylesheet" href="bar" data-precedence="default" />
3436 + <link rel="preload" href="foo" as="style" />
3437 + <link rel="preload" href="bar" as="style" />
3438 + </head>
3439 + <body>
3440 + <div style="display: none;">hello</div>loading...
3441 + </body>
3442 + </html>,
3443 + );
3444 + }
3445 loadStylesheets(['bar']);
3446 assertLog(['load stylesheet: bar']);
3447 expect(getMeaningfulChildren(document)).toEqual(
packages/shared/forks/ReactFeatureFlags.www-dynamic.js
+1 -1
@@ -13,7 +13,7 @@
13 // Use __VARIANT__ to simulate a GK. The tests will be run twice: once
14 // with the __VARIANT__ set to `true`, and once set to `false`.
15
16 -export const alwaysThrottleRetries = true;
16 +export const alwaysThrottleRetries = __VARIANT__;
17 export const disableDefaultPropsExceptForClasses = __VARIANT__;
18 export const disableLegacyContextForFunctionComponents = __VARIANT__;
19 export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;