-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Upgrade from woefully outdated jQuery version #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
Conversation
You will most likely have to follow this guidance, in particular using 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 |
3f3ec70
to
cb66948
Compare
hey @dscho , on |
db70fe3
to
a98da04
Compare
That's excellent information, which dearly wants to go into the commit message. |
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.
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?) |
Okay, after mulling it over a bit and |
a98da04
to
c88f696
Compare
c88f696
to
cf473bf
Compare
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.
This looks already a lot better, but there is still stuff to do.
@@ -1,5 +1,5 @@ | |||
--- | |||
name: "giggle" | |||
name: "giggle (no longer under active development)" |
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.
What does this change do in the PR to "Refactor/update/jquery"? (Which, by the way, is a much improvable description for what you are trying to accomplish.)
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.
hey @dscho ,
commit 9381210304dcaa02f1a3836134beb9683e12fff9
Author: Jonathan Ballet <[email protected]>
Date: Sat Jun 21 18:58:42 2025 +0200
GUI: giggle is not longer in active development
The website points to https://gitlab.gnome.org/Archive/giggle, which is marked as "archived" ; [latest tag 0.7 is 12 years old](https://gitlab.gnome.org/Archive/giggle/-/tags) now.
I'm not the one who sneaked that commit in
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.
@RafaelJohn9 you may have rebased it, it has you as committer on record:

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.
ooh, yea, my bad,
Hey @dscho , I used Jquery Migrate plugin, though I removed it after updating the deprecated parts, would you recommend, leaving it inside the repo even after the upgrade ? |
I would not recommend leaving it inside, but I would strongly suggest to start documenting what was done. If you use jQuery Migrate, for example, I would have expected an initial commit to add it, to describe in its commit message what that plugin does (with a helpful link to the website) and why it was used in the first place. I would have expected the next commits to do a good job describing what problems the plugin showed and how they were resolved. The final commit I would have expected to be the one to remove the jQuery Migrate Plugin, stating that its job is done now and the migration is complete. That would also have prevented forcing any reader to guess as to what has been done and having to pry vital information e.g. about the plugin and its use in a subsequent conversation. If I would not have asked, the details about how this PR came about would be lost. That story should have been written down in the commit messages to begin with, though. If it wasn't written down, it's as if it had never happened. |
c233c14
to
76644af
Compare
This branch comes from git#2022. Signed-off-by: Johannes Schindelin <[email protected]>
layouts/partials/footer.html
Outdated
|
||
<script src="{{ relURL "js/jquery-1.7.1.min.js" }}"></script> | ||
<script src="{{ relURL "js/jquery-ui-1.8.18.custom.min.js" }}"></script> | ||
<script src="https://code.jquery.com/jquery-migrate-3.4.1.min.js"></script> |
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.
Shouldn't this be v1.4.1 first, to upgrade across the jQuery v1.9.x boundary?
And, as per the documentation:
In your web page, load this plugin after the script for jQuery: [...]
That problem is highly likely to be the root cause of:

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.
@RafaelJohn9 Please integrate dscho@631599f.
Also, please split this change apart: Adding jQuery Migrate is, logically speaking, a very very different kind of change than upgrading the jQuery version.
Also document (in the commit message) that the guidance is to upgrade in two steps, first cross the v1.9 boundary, then the v3 boundary.
Then cross them in that order, via two separate commits.
Also, please do use the opportunity to switch away from the self-hosted jquery*.js
files to the CDN ones as recommended by the jQuery project itself.
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.
Oh, and the commit at the end that removes jQuery Migrate again is missing...
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.
I'll first add the v1.9 migrate then, methodically move to v3 boundary
I'll also add the last commit to remove the jQuery Migrate 🤝
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.
Good!
Once that's done, could you reword the PR title so that it reads a bit easier? Something like "Upgrade from woefully outdated jQuery version".
To elaborate on what motivates this change, the "Context" in the PR description should not be left empty but say something about potentially wanting to use newer jQuery features, benefit from bug fixes and support for newer browsers, apart from it just being poor workmanship to neglect central components for years.
There is also enough room in that empty space to describe when jQuery was last updated, and how frequently it was updated before that time.
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.
My bad, forgot about that 😅 ,
thank you for your patience
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.
Thank you for your persistence and stamina! I know I ask a lot.
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.
@RafaelJohn9 please ping me when it's done, I will then use it as part of the merge commit message.
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.
@dscho , improved the PR description 🤝
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.
Thank you! It's now part of the (immutable) commit history: f847b39
This branch comes from git#2022. Signed-off-by: Johannes Schindelin <[email protected]>
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.
Great work on 76644af!
layouts/partials/footer.html
Outdated
|
||
<script src="{{ relURL "js/jquery-1.7.1.min.js" }}"></script> | ||
<script src="{{ relURL "js/jquery-ui-1.8.18.custom.min.js" }}"></script> | ||
<script src="https://code.jquery.com/jquery-migrate-3.4.1.min.js"></script> |
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.
@RafaelJohn9 Please integrate dscho@631599f.
Also, please split this change apart: Adding jQuery Migrate is, logically speaking, a very very different kind of change than upgrading the jQuery version.
Also document (in the commit message) that the guidance is to upgrade in two steps, first cross the v1.9 boundary, then the v3 boundary.
Then cross them in that order, via two separate commits.
Also, please do use the opportunity to switch away from the self-hosted jquery*.js
files to the CDN ones as recommended by the jQuery project itself.
assets/js/application.js
Outdated
//= 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 |
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.
The first line of the commit message talks about adding two files. That's not the only change this commit makes, though, is it? It upgrades at the same time.
Let's just stop vendoring in the jQuery .js
files. There are perfectly fine CDN versions of them; As a bonus, browsers can rely on the same .js
files across sites, they don't need to cache a separate copy just for git-scm.com.
Upgrade jQuery from 1.7.1 to 1.9.1 and jQuery UI from 1.8.18 to 1.9.1 to bridge toward a modern codebase. While 1.9.1 is still outdated by today's standards, it introduces critical deprecation warnings and improves compatibility with newer APIs, serving as a necessary intermediate step before a full jump to jQuery 3.x. Importantly, this commit adds jQuery Migrate 1.2.1 from the official CDN to detect and log deprecated usage patterns that would otherwise break silently during future upgrades. Migrate will surface issues like: - Calls to deprecated methods (.live(), .bind() in certain contexts) These warnings are essential for identifying technical debt in our existing JavaScript (e.g., in application.js) and planning safe refactors. This is Step 1 of a phased migration strategy: 1. Upgrade to jQuery 1.9.1 + Migrate → current commit 2. Audit console warnings and modernize code 3. Upgrade to jQuery 3.7.1 with jquery-migrate-3.4.1 4. Remove Migrate once all deprecations are resolved The use of CDN-hosted assets simplifies version management and ensures we’re not bundling outdated copies. Note: Source map 404s may appear (jquery.min.map) — these are harmless and expected for older jQuery versions. We will address them in a later upgrade when moving to modern, actively supported releases.
…ethods Replace all instances of direct event binding methods (.click(), .focus(), .bind(), .blur(), etc.) with the modern .on() API across the codebase. The jQuery .on() method has been the recommended way to attach event handlers since jQuery 1.7 (2011), superseding: - .bind() - .live() (removed in 1.9) - .delegate() - shorthand methods (.click(), .hover()) when delegation or cleanup is needed While the shorthand methods still work, using .on() consistently provides: - A single, unified pattern for event attachment - Clear intent for both direct and delegated events - Better compatibility with future jQuery versions - Easier event namespace management and removal (.off()) This change touches multiple modules: - GitTurns20: popstate handling and tagline click counter - Search: focus, blur, keydown, and result interaction - Dropdowns: toggle activation via click - Forms: input selection - Downloads: OS filter navigation - DarkMode: toggle button interaction - ScrollToTop: scroll monitoring and click behavior Notable improvements: - $(window).bind('popstate', ...) → $(window).on('popstate', ...): aligns with current best practices - $("#tagline").click(...) → .on('click', ...): enables future delegation if needed - $(document).keydown(...) → .on('keydown', ...): consistent event model - $('#scrollToTop').click(...) → .on('click', ...): unified pattern across UI components Additionally: - Fixed event trigger in keyboard shortcut handler: now uses .trigger('focus') instead of direct .focus() to ensure consistent event flow - Preserved event argument (e) and logic (e.preventDefault(), timeStamp checks) — no behavioral changes - All selectors and functionality remain intact; this is a syntactic and maintainability upgrade This refactor was guided by warnings from jQuery Migrate and is part of the larger migration plan: 1. Add jQuery Migrate → done 2. Fix deprecated patterns (like .bind(), .click()) → this commit 3. Upgrade to jQuery 3.7.1 4. Remove Migrate when clean The code remains functionally identical, but is now more maintainable, consistent, and future-proof. No regressions expected. See: https://api.jquery.com/on/ See: https://github.com/jquery/jquery-migrate#readme
…rate Move to the latest stable jQuery (3.7.1) and jQuery UI (1.14.1), replacing outdated 1.9.1 versions. This continues our incremental modernization path. Update jQuery Migrate to 3.4.1 to match, ensuring accurate deprecation warnings during development. The new Migrate version supports the latest APIs and provides better debugging feedback. All existing behavior is preserved. Warnings in the console should now reflect any remaining legacy patterns that need cleanup. Part of the migration sequence: - Previous: refactor .bind()/.click() → .on() - This: upgrade core libraries - Next: remove Migrate once clean
Update the search input's binding to use instead of the deprecated shorthand , aligning with our consistent event binding pattern. This change keeps the codebase uniform with recent refactors (e.g., click, focus, keydown) and prepares for safe compatibility with jQuery 3.x now that we've upgraded. No behavioral changes event logic and timing remain identical. Part of ongoing effort to eliminate legacy jQuery patterns ahead of removing jQuery Migrate.
Remove jQuery Migrate 3.4.1 as it is no longer needed. The codebase has been fully updated to use modern jQuery patterns (e.g., .on() instead of .bind()), and no deprecation warnings have appeared in the console. This marks the completion of our migration: 1. Added Migrate to detect issues 2. Refactored legacy event bindings 3. Upgraded to jQuery 3.7.1 4. Removed Migrate — now
Clean up obsolete comments in application.js that referenced old, externally loaded jQuery files: - //= require jquery-1.7.1.min - //= require jquery-ui-1.8.18.custom.min These files are no longer part of the asset pipeline and are instead loaded directly via CDN in the layout. Leaving these directives was misleading and could cause confusion for future contributors. This change aligns the comments with the current architecture: jQuery is now a standalone dependency (3.7.1 via CDN), not a compiled asset. No functional impact — this is purely a documentation and hygiene improvement.
76644af
to
79b6413
Compare
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.
The commits are now in a great shape!
This branch comes from git#2022. Signed-off-by: Johannes Schindelin <[email protected]>
@RafaelJohn9 @dscho Awesome job! Thank you so much! |
Changes
Context
jQuery has not been meaningfully updated in over a decade. The previous version in use , jQuery 1.7.1 (released in 2011) , predates widespread support for modern JavaScript APIs. It was last updated in this project around 2013, and since then, no further upgrades were made despite over 50 releases and critical improvements in the jQuery ecosystem.
This long-standing neglect created growing technical debt:
.bind()
,.click()
)While the site continued to function thanks to jQuery Migrate and browser backward compatibility, this was not sustainable maintenance .
Why Upgrade Now?
We are modernizing the JavaScript foundation to:
.on()
, better event delegation)jQuery 3.x dropped support for legacy browsers (IE 6–8), which we no longer need to support. This allows us to benefit from a leaner, faster, and more predictable codebase.
Migration Strategy
This upgrade was done incrementally to ensure stability:
.click()
→.on()
,.bind()
→.on()
)application.js
All changes preserve existing behavior. The result is a safer, more maintainable JavaScript foundation.
This work closes a long-overdue maintenance gap and sets the stage for more confident, modern front-end development.