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

Alter event replaying strategy for target only events #19300

Closed
wants to merge 1 commit into from

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Jul 9, 2020

This PR removes four events from being included in event replaying. These events are:

  • submit
  • reset
  • close
  • cancel

submit and reset are both form events, and they also natively bubble on the browser. However, in React, we instead attach these to target element. We could change this in #19285, but as mentioned in that PR, there are quite a few codesites internally that rely on these events not being delegated, yet we need delegation to make event replaying work.

close and cancel are related to using <dialog> elements and don't natively bubble. The only way to make these work is to use the capture phase (which React's event system used to do), and emulate the bubbling. These events are rarely used and so these probably aren't too big of a deal.

In both cases, we can re-add these events for event replaying in the future. @sebmarkbage has some ideas around how we can re-use the capture phase for event replaying, which will avoid the issues outlined above. However, for now, I feel we can get away with removing these events for replaying, to unblock the other streams of work (#19278).

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 9, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5360811:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Jul 9, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 5360811

@sizebot
Copy link

sizebot commented Jul 9, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 5360811

@trueadm trueadm force-pushed the alter-event-replaying branch 2 times, most recently from 12000e2 to c48b292 Compare July 9, 2020 19:52
Fix test

Fix test

Fix test

Fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants