Skip to content

Refactor/update/jquery #2022

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

Open
wants to merge 4 commits into
base: gh-pages
Choose a base branch
from

Conversation

RafaelJohn9
Copy link
Contributor

@dscho
Copy link
Member

dscho commented Jul 3, 2025

You will most likely have to follow this guidance, in particular using jquery-migrate.

Also, the structure of these commits is chronological, in dear need of becoming logical instead. Keep an eye on reviewability. Hiding the change that drops jquery.defaultvalue in a different commit is no good, in particular when the commit message does not even explain nor provide references justifying this drop.

@RafaelJohn9 RafaelJohn9 force-pushed the refactor/update/jquery branch from b997769 to 3f3ec70 Compare July 3, 2025 20:04
@RafaelJohn9 RafaelJohn9 force-pushed the refactor/update/jquery branch from 3f3ec70 to cb66948 Compare July 3, 2025 20:49
@RafaelJohn9
Copy link
Contributor Author

hey @dscho ,

on jquery.defaultValue its seems that it hasn't been maintained for a while: https://github.com/cloudchen/jquery.defaultValue

@RafaelJohn9 RafaelJohn9 force-pushed the refactor/update/jquery branch from db70fe3 to a98da04 Compare July 4, 2025 10:03
@RafaelJohn9 RafaelJohn9 marked this pull request as ready for review July 4, 2025 10:06
@dscho
Copy link
Member

dscho commented Jul 6, 2025

on jquery.defaultValue its seems that it hasn't been maintained for a while: https://github.com/cloudchen/jquery.defaultValue

That's excellent information, which dearly wants to go into the commit message.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

I am still convinced that you will most likely have to follow this guidance, in particular using jquery-migrate.

Either you did (but didn't talk about it in the commit messages, which you should, though), or you didn't (but you should).

Speaking of commit messages: For something as consequential as a JQuery update from an ancient version to a current one, you definitely need to up your commit message writing fu.
Please follow the guidance in https://github.blog/2022-06-30-write-better-commits-build-better-projects/ to improve it, in particular with a strong focus on this part:

  What you’re doing Why you’re doing it
High-level (strategic) Intent (what does this accomplish?) Context (why does the code do what it does now?)
Low-level (tactical) Implementation (what did you do to accomplish your goal?) Justification (why is this change being made?)

Comment on lines -568 to +567
onPopState(function() {
onPopState(function () {
Copy link
Member

Choose a reason for hiding this comment

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

That's not updating a deprecated function call, but it changes the code style to disagree with the remainder of the file.

return $(window).bind('popstate', function(event) {
var section;
return $(window).on('popstate', function () {
Copy link
Member

Choose a reason for hiding this comment

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

Can you find some documentation about this? If so, that would be good information for the commit message.

Also: Does this new call work with the outdated JQuery version that git-scm.com currently has? If so, this commit needs to come before the upgrade to the newer JQuery.

Comment on lines -783 to +787
$(window).scroll(function() {
$(window).on('scroll', function () {
$(this).scrollTop() > 150
? $('#scrollToTop').fadeIn()
: $('#scrollToTop').fadeOut();
});
$('#scrollToTop').click(function(e) {
$('#scrollToTop').on('click', function (e) {
Copy link
Member

Choose a reason for hiding this comment

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

I see a lot of $(...).<something>(...) -> $(...).on('<something>, ...) changes here. Do they all belong to the same class of deprecation, logically? If so, it's fine to cluster them in one large commit. Otherwise it makes reviewing easier (and hence bug catching, too, which is what reviewing is all about) to split the changes up by logical topic (which would then need to be described in the commit message, accompanied by references you can find).

Comment on lines -13 to +14
//= require jquery-1.7.1.min
//= require jquery-ui-1.8.18.custom.min
//= require jquery-3.7.1.min
//= require jquery-ui-1.14.1.min
Copy link
Member

Choose a reason for hiding this comment

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

It does not make much sense to split the JQuery version updates in application.js from the ones in the header.

I am glad that you dropped the unrelated change from this commit where jquery.defaultvalue was dropped. But it seems you no longer drop this altogether? Is it still supported? Does it support the newest JQuery version?

@dscho
Copy link
Member

dscho commented Jul 6, 2025

on jquery.defaultValue its seems that it hasn't been maintained for a while: https://github.com/cloudchen/jquery.defaultValue

That's excellent information, which dearly wants to go into the commit message.

Okay, after mulling it over a bit and git grep -i defaultvalue-ing, I come to a totally different conclusion: jquery.defaultValue has not been updated in quite a while. But that's because it is perfect, not because it isn't maintained. It does its job as it's supposed to do, and before you remove anything like that, you need to make sure that it is not used (otherwise your PR needs to be rejected out of hand). And it is used...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update woefully outdated jQuery
2 participants