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

refactor(core): Add a new EventDispatcher class. #55837

Closed
wants to merge 4 commits into from

Conversation

tbondwilkinson
Copy link
Contributor

EventDispatcher emulates the browser's event dispatch (mostly). It supports:

  • Bubbling and stopPropagation/stopImmediatePropagation.
  • currentTarget during dispatch.
  • Throwing errors for preventDefault if the event is being dispatched in replay.
  • Throwing errors for composedPath() if event is being dispatched in replay.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

@tbondwilkinson
Copy link
Contributor Author

TESTED=TGP

@tbondwilkinson tbondwilkinson marked this pull request as ready for review May 17, 2024 19:16
@pullapprove pullapprove bot added the requires: TGP This PR requires a passing TGP before merging is allowed label May 17, 2024
@tbondwilkinson tbondwilkinson requested review from rahatarmanahmed and removed request for mturco May 17, 2024 19:17
@tbondwilkinson tbondwilkinson added area: core Issues related to the framework runtime core: event dispatch labels May 17, 2024
@ngbot ngbot bot modified the milestone: Backlog May 17, 2024
@tbondwilkinson tbondwilkinson added action: review The PR is still awaiting reviews from at least one requested reviewer target: rc This PR is targeted for the next release-candidate labels May 17, 2024
@tbondwilkinson tbondwilkinson requested review from iteriani and removed request for rahatarmanahmed May 17, 2024 21:24
`EventDispatcher` emulates the browser's event dispatch (mostly).
It supports:
 - Bubbling and `stopPropagation`/`stopImmediatePropagation`.
 - `currentTarget` during dispatch.
 - Throwing errors for `preventDefault` if the event is being dispatched
   in replay.
 - Throwing errors for `composedPath()` if event is being dispatched in
   replay.
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbondwilkinson thanks for creating the patchEventInstance function and documenting the context (it's very helpful!) 👍

@tbondwilkinson tbondwilkinson added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 22, 2024
@tbondwilkinson
Copy link
Contributor Author

Caretaker note: The mergeability presubmits appear stuck

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels May 22, 2024
@dylhunn dylhunn added target: patch This PR is targeted for the next patch release and removed target: rc This PR is targeted for the next release-candidate labels May 22, 2024
@dylhunn
Copy link
Contributor

dylhunn commented May 22, 2024

@tbondwilkinson I think it got stuck because we just released v18, so the rc branch no longer exists. Weird edge case bug.

@dylhunn
Copy link
Contributor

dylhunn commented May 22, 2024

This PR was merged into the repository by commit fdd59c4.

@dylhunn dylhunn closed this in fdd59c4 May 22, 2024
dylhunn pushed a commit that referenced this pull request May 22, 2024
`EventDispatcher` emulates the browser's event dispatch (mostly).
It supports:
 - Bubbling and `stopPropagation`/`stopImmediatePropagation`.
 - `currentTarget` during dispatch.
 - Throwing errors for `preventDefault` if the event is being dispatched
   in replay.
 - Throwing errors for `composedPath()` if event is being dispatched in
   replay.

PR Close #55837
@tbondwilkinson tbondwilkinson deleted the jsaction-bubbling branch May 23, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime core: event dispatch merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note requires: TGP This PR requires a passing TGP before merging is allowed target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants