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

All: Mark event aliases as deprecated #1223

Merged
merged 33 commits into from
Apr 24, 2023
Merged

Conversation

mgol
Copy link
Member

@mgol mgol commented Apr 16, 2023

This feeds on the ideas from @dmethvin from gh-972 to reuse existing event pages as they sometimes contain valuable info specific to those events but to instead use the on & trigger signatures there, leaving the shorthand ones as deprecated.

One difficulty with this approach is we cannot have both on & trigger under a single signature, so I had to split them. In order to avoid rewriting the pages too much, I just left the trigger signature linking to the on one. If we see fit, we can always split the sections better later.

I'll post the screenshots of what this PR proposes below; for the current state, you can just check https://api.jquery.com/blur/.

Fixes gh-1205

TODO:

  • Migrate other event shorthands
  • Migrate AJAX event shorthands (there's just on there, no trigger)
  • Drop the Additional Notes section (and the corresponding XSLT node, I think)
  • Make sure https://api.jquery.com/category/deprecated/deprecated-3.3/ doesn't show something confusing wrt. event shorthands

@mgol mgol added Needs review Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Apr 16, 2023
@mgol mgol requested review from dmethvin, timmywil and gibson042 April 16, 2023 22:32
@mgol
Copy link
Member Author

mgol commented Apr 16, 2023

Preview of this PR (v1)

jq-api-blur-deprecated

@mgol
Copy link
Member Author

mgol commented Apr 16, 2023

BTW, that remark about blur not bubbling in IE is quite outdated - it does not bubble anywhere. 😉

@mgol
Copy link
Member Author

mgol commented Apr 16, 2023

I also need to remove the "Additional Notes" section.

@mgol mgol self-assigned this Apr 16, 2023
@mgol mgol added this to the 3.0.0 milestone Apr 16, 2023
entries/blur.xml Outdated Show resolved Hide resolved
entries/blur.xml Outdated Show resolved Hide resolved
@mgol
Copy link
Member Author

mgol commented Apr 17, 2023

New version pushed. Changes:

  1. The "Additional Notes" section removed (for all shorthands).
  2. The alias properly marked as deprecated now.
  3. The deprecated API description updated and marked as yellow. It now also links to non-deprecated aliases.

The screenshot of the content below:

Preview of this PR (v2)

jq-api-blur-deprecated-v2

Copy link
Member

@timmywil timmywil left a comment

Choose a reason for hiding this comment

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

Thanks, that looks better

@mgol mgol force-pushed the deprecate-event-aliases branch from 06c7c0a to 8afd090 Compare April 17, 2023 22:46
@mgol
Copy link
Member Author

mgol commented Apr 17, 2023

Since there are some differences in how ajax events work (e.g. no manual trigger), I also migrated ajaxStart, here's the result:

Preview of `ajaxStart` in this PR

jq-api-ajaxStart-deprecated

@mgol mgol force-pushed the deprecate-event-aliases branch from 6abafeb to b1acff3 Compare April 17, 2023 23:07
@mgol
Copy link
Member Author

mgol commented Apr 18, 2023

@timmywil in the end, I had to separate shorthand pages (I pushed blur & focus for now) as it seems categories are only picked up from the first entry on multi-entry pages so they wouldn't show up on https://api.jquery.com/category/deprecated/deprecated-3.3/.

The new pages for deprecated APIs are named blur-shorthand & focus-shorthand. That way, the main event-focused content keeps history.

I also added the version/1.0 category back to on( "blur", ... ) entries even though on only arrived in 1.7 so that the blur event page shows up on https://api.jquery.com/category/version/1.0/, the same for other events.

@mgol mgol force-pushed the deprecate-event-aliases branch from 4f9faf8 to ad91aea Compare April 20, 2023 00:24
@mgol mgol force-pushed the deprecate-event-aliases branch from 910eeb6 to 027012f Compare April 23, 2023 02:00
@mgol
Copy link
Member Author

mgol commented Apr 23, 2023

I migrated everything now, this is ready for final review.

@mgol mgol marked this pull request as ready for review April 23, 2023 03:01
@mgol mgol requested a review from timmywil April 23, 2023 03:01
Copy link
Member

@dmethvin dmethvin left a comment

Choose a reason for hiding this comment

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

Thanks! This seems like a good way to approach things.

@mgol
Copy link
Member Author

mgol commented Apr 24, 2023

Up to date screenshots:

The /blur/ page

Screen Shot 2023-04-24 at 18 16 13

The /blur-shorthand/ page

Screen Shot 2023-04-24 at 18 16 23

@mgol
Copy link
Member Author

mgol commented Apr 24, 2023

Also, an up to date example for ajaxStart as AJAX events are a bit different, not having the .trigger() part:

The /ajaxStart/ page

Screen Shot 2023-04-24 at 18 24 36

The /ajaxStart-shorthand/ page

Screen Shot 2023-04-24 at 18 19 25

@mgol mgol merged commit c149300 into jquery:main Apr 24, 2023
@mgol mgol deleted the deprecate-event-aliases branch April 24, 2023 16:43
mgol added a commit that referenced this pull request Apr 24, 2023
Previously, they've been incorrectly marked as deprecated in 3.3.

Ref gh-1205
Ref gh-1223
@mgol mgol mentioned this pull request Apr 24, 2023
21 tasks
@mgol mgol removed Needs review Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Apr 24, 2023
mgol pushed a commit that referenced this pull request May 4, 2023
Multiple selectors erroneously used `selector)` instead of `selector`.
This has been fixed.

The typos were accidentally introduced during
a mass-replace in gh-1223.

Fixes gh-1228
Closes gh-1229
Ref gh-1223
Ref gh-1226
Ref gh-1227
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Document deprecation of event shorthands like jQuery.fn.click()
3 participants