-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(core): drop support for plural event/gesture names #10539
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
farfromrefug
requested changes
May 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shirakaba shouldn't the regexp for names be removed now ?
The rest looks good
4ad7108
to
b2b207e
Compare
farfromrefug
previously approved these changes
May 5, 2024
0624eb7
to
00a3608
Compare
# Conflicts: # packages/core/ui/core/view/view-common.ts
00a3608
to
c469a40
Compare
NathanWalker
approved these changes
May 7, 2024
apburgess
pushed a commit
to apburgess/NativeScript
that referenced
this pull request
May 15, 2024
apburgess
pushed a commit
to apburgess/NativeScript
that referenced
this pull request
May 15, 2024
apburgess
pushed a commit
to apburgess/NativeScript
that referenced
this pull request
May 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is based onto the following PRs that are in review:
I'd suggest reviewing this by just selecting the commits from this PR, excluding the commits from those prior two PRs. As per the screenshot, you'd scroll to the bottom of the commits (most recent at the bottom), and select the same commits as I've indicated in blue. In other words, the first included commit should be
chore(core): drop support for plural events
.PR Checklist
What is the current behavior?
Currently, it is possible to listen for plural events by passing a comma-delimited series of event names (which may optionally be surrounded by whitespace):
It is also possible to observe plural gestures, but due to bugs in the implementation, it is only possible via a plural enum and not a plural string.
What is the new behavior?
We now interpret event names as-is, corresponding to a singular event listener or observer. So we no longer trim event names, nor split on commas. As this PR is based on #10537, we only accept string names, so don't support enums at all (so avoid having to special-case plural enums).
Benefits
Breaking changes
This PR drops support for listening for:
" propertyChange "
"propertyChange,loaded"
GestureTypes.tap & GestureTypes.doubleTap
(though support for this form should be removed in fix(core): stop accepting GestureTypes enum as an eventName #10537, and the string form "tap,doubleTap" was never working to begin with).Impact
From TSC discussions, it doesn't seem that this feature is commonly, if ever, used, so impact may be low in practice. Certainly, it wasn't used anywhere within Core except in some test cases (which I've updated accordingly).
Migration steps
Any plugins or userland code using plural event/gesture names should instead split them into singular names and listen for them individually.