Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync hydrate discrete events in capture phase and dont replay discrete events #22448

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use gate function in tests instead
  • Loading branch information
salazarm committed Oct 1, 2021
commit 714509b20f3f3ed8e4eb9601d0715f24a9f31d87
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,10 @@ describe('ReactDOMServerPartialHydration', () => {
});

if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
expect(clicks).toBe(0);
expect(container.textContent).toBe('Click meHello');
Expand Down Expand Up @@ -1998,7 +2001,10 @@ describe('ReactDOMServerPartialHydration', () => {
});

if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
expect(onEvent).toHaveBeenCalledTimes(0);
} else {
Expand Down Expand Up @@ -2086,7 +2092,10 @@ describe('ReactDOMServerPartialHydration', () => {
});

if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
expect(clicks).toBe(0);
} else {
Expand Down Expand Up @@ -2178,7 +2187,10 @@ describe('ReactDOMServerPartialHydration', () => {
await promise;
});
if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
expect(onEvent).toHaveBeenCalledTimes(0);
} else {
Expand Down Expand Up @@ -2257,7 +2269,10 @@ describe('ReactDOMServerPartialHydration', () => {
});

if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
expect(clicksOnChild).toBe(0);
expect(clicksOnParent).toBe(0);
Expand Down Expand Up @@ -2343,7 +2358,10 @@ describe('ReactDOMServerPartialHydration', () => {

// We're now full hydrated.
if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
expect(clicks).toBe(0);
} else {
Expand Down Expand Up @@ -2619,7 +2637,10 @@ describe('ReactDOMServerPartialHydration', () => {
});

if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
// discrete event not replayed
expect(submits).toBe(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,10 @@ describe('DOMPluginEventSystem', () => {
// We're now full hydrated.

if (
ReactFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
gate(
flags =>
flags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
)
) {
expect(clicks).toBe(0);
} else {
Expand Down