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

Document deprecation of event shorthands like jQuery.fn.click() #1205

Closed
MateoWartelle opened this issue Jun 12, 2022 · 1 comment · Fixed by #1223
Closed

Document deprecation of event shorthands like jQuery.fn.click() #1205

MateoWartelle opened this issue Jun 12, 2022 · 1 comment · Fixed by #1223
Assignees
Milestone

Comments

@MateoWartelle
Copy link

MateoWartelle commented Jun 12, 2022

The shorthand .click / .change is missing from

https://api.jquery.com/category/deprecated/

https://github.com/jquery/api.jquery.com/blob/main/entries/click.xml#L26

@mgol mgol changed the title jQuery.fn.click() event shorthand is deprecated Document deprecation of event shorthands like jQuery.fn.click() Jun 27, 2022
@mgol
Copy link
Member

mgol commented Jun 27, 2022

Thanks for the report. We know about it and it's mentioned in #972 but a dedicated issue just for this won't hurt so I'll keep it.

The discussion at #972 describes what needs to be done.

@mgol mgol mentioned this issue Jun 27, 2022
7 tasks
@mgol mgol added this to the 3.0.0 milestone Jun 27, 2022
mgol added a commit to mgol/api.jquery.com that referenced this issue Apr 16, 2023

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
@mgol mgol added the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Apr 16, 2023
@mgol mgol self-assigned this Apr 16, 2023
mgol added a commit to mgol/api.jquery.com that referenced this issue Apr 17, 2023

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
mgol added a commit to mgol/api.jquery.com that referenced this issue Apr 23, 2023

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
mgol added a commit that referenced this issue Apr 24, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Mark all event shorthands as deprecated, including the AJAX ones. Create
separate pages for deprecated shorthands, for example:
* `/click/` describes the `click` event and how to use it with `.on()` or
  `.trigger()`
* `/click-shorthand/` describes the deprecated `.click()` method
* `/ajaxStart/` describes the `ajaxStart` event and how to use it with `.on()`
* `/ajaxStart-shorthand/` describes the deprecated `.ajaxStart()` method

The reason for such an approach is that event pages often contained useful
information about those specific events and we didn't want to lose that. Also,
the new shorthand pages all look the same and mostly redirect to the event
pages so we didn't want to treat them as the primary page to go to when
searching for an event.

To make it less confusing, both the event page & its associated shorthand
method page link to each other.

Separate shorthand pages have also been created for `.load()`, `.unload()`
and `.error()` methods. Those methods have already been removed in jQuery 3.0
but they also contained useful info about the associated events so it made
sense to treat them like other event shorthands.

Because there's no way to include both `.on()` & `.trigger()` usage in a single
entry, event pages (except for AJAX ones) now have two entries each. This
required wrapping the previous single `<entry>` with the new `<entries>`. To
maintain Git history, the inner `<entry>` tags are left de-indented.

Usage of deprecated event shorthand methods have been removed across all
API entries.

Fixes gh-1205
Closes gh-1223
mgol added a commit that referenced this issue Apr 24, 2023

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
Previously, they've been incorrectly marked as deprecated in 3.3.

Ref gh-1205
Ref gh-1223
@mgol mgol removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants