Skip to content

Commit b5cca18

Browse files
salazarmrickhanlonii
authored andcommitted
Clean up Selective Hydration / Event Replay flag (#24156)
* clean up selective hydration / replay flag * dont export return_targetInst
1 parent d18ec7d commit b5cca18

19 files changed

+72
-565
lines changed

packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js

+11-80
Original file line numberDiff line numberDiff line change
@@ -2418,18 +2418,8 @@ describe('ReactDOMServerPartialHydration', () => {
24182418
await promise;
24192419
});
24202420

2421-
if (
2422-
gate(
2423-
flags =>
2424-
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
2425-
)
2426-
) {
2427-
expect(clicks).toBe(0);
2428-
expect(container.textContent).toBe('Click meHello');
2429-
} else {
2430-
expect(clicks).toBe(1);
2431-
expect(container.textContent).toBe('Hello');
2432-
}
2421+
expect(clicks).toBe(0);
2422+
expect(container.textContent).toBe('Click meHello');
24332423
document.body.removeChild(container);
24342424
});
24352425

@@ -2511,17 +2501,7 @@ describe('ReactDOMServerPartialHydration', () => {
25112501
await promise;
25122502
});
25132503

2514-
if (
2515-
gate(
2516-
flags =>
2517-
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
2518-
)
2519-
) {
2520-
expect(onEvent).toHaveBeenCalledTimes(0);
2521-
} else {
2522-
expect(onEvent).toHaveBeenCalledTimes(2);
2523-
}
2524-
2504+
expect(onEvent).toHaveBeenCalledTimes(0);
25252505
document.body.removeChild(container);
25262506
});
25272507

@@ -2601,16 +2581,7 @@ describe('ReactDOMServerPartialHydration', () => {
26012581
await promise;
26022582
});
26032583

2604-
if (
2605-
gate(
2606-
flags =>
2607-
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
2608-
)
2609-
) {
2610-
expect(clicks).toBe(0);
2611-
} else {
2612-
expect(clicks).toBe(2);
2613-
}
2584+
expect(clicks).toBe(0);
26142585

26152586
document.body.removeChild(container);
26162587
});
@@ -2695,17 +2666,7 @@ describe('ReactDOMServerPartialHydration', () => {
26952666
resolve();
26962667
await promise;
26972668
});
2698-
if (
2699-
gate(
2700-
flags =>
2701-
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
2702-
)
2703-
) {
2704-
expect(onEvent).toHaveBeenCalledTimes(0);
2705-
} else {
2706-
expect(onEvent).toHaveBeenCalledTimes(2);
2707-
}
2708-
2669+
expect(onEvent).toHaveBeenCalledTimes(0);
27092670
document.body.removeChild(container);
27102671
});
27112672

@@ -2776,19 +2737,8 @@ describe('ReactDOMServerPartialHydration', () => {
27762737
await promise;
27772738
});
27782739

2779-
if (
2780-
gate(
2781-
flags =>
2782-
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
2783-
)
2784-
) {
2785-
expect(clicksOnChild).toBe(0);
2786-
expect(clicksOnParent).toBe(0);
2787-
} else {
2788-
expect(clicksOnChild).toBe(1);
2789-
// This will be zero due to the stopPropagation.
2790-
expect(clicksOnParent).toBe(0);
2791-
}
2740+
expect(clicksOnChild).toBe(0);
2741+
expect(clicksOnParent).toBe(0);
27922742

27932743
document.body.removeChild(container);
27942744
});
@@ -2864,16 +2814,7 @@ describe('ReactDOMServerPartialHydration', () => {
28642814
});
28652815

28662816
// We're now full hydrated.
2867-
if (
2868-
gate(
2869-
flags =>
2870-
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
2871-
)
2872-
) {
2873-
expect(clicks).toBe(0);
2874-
} else {
2875-
expect(clicks).toBe(1);
2876-
}
2817+
expect(clicks).toBe(0);
28772818

28782819
document.body.removeChild(parentContainer);
28792820
});
@@ -3142,19 +3083,9 @@ describe('ReactDOMServerPartialHydration', () => {
31423083
await promise;
31433084
});
31443085

3145-
if (
3146-
gate(
3147-
flags =>
3148-
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
3149-
)
3150-
) {
3151-
// discrete event not replayed
3152-
expect(submits).toBe(0);
3153-
expect(container.textContent).toBe('Click meHello');
3154-
} else {
3155-
expect(submits).toBe(1);
3156-
expect(container.textContent).toBe('Hello');
3157-
}
3086+
// discrete event not replayed
3087+
expect(submits).toBe(0);
3088+
expect(container.textContent).toBe('Click meHello');
31583089

31593090
document.body.removeChild(container);
31603091
});

0 commit comments

Comments
 (0)