Skip to content

Upgrade the admin UI to jQuery 4.1.0 and drop jQuery from the Gaurav theme - #348

Open
mraible wants to merge 6 commits into
masterfrom
jquery-4.1.0
Open

mraible wants to merge 6 commits into
masterfrom
jquery-4.1.0

Conversation

@mraible

@mraible mraible commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

jQuery 4.1.0 and 3.8.0 came out on 2026-11-17 with a fix for slow selector matching: a long chain of escapes followed by an invalid character could hang the page.

  • The admin UI moves from the jQuery 4.0.0 webjar to 4.1.0.
  • The Gaurav theme no longer loads jQuery or Bootstrap's JavaScript. Bootstrap 3's JavaScript refuses to run with jQuery 4, and the theme used it only for the navbar's collapse button and Categories dropdown. A small script, js/navbar.js, now toggles the same Bootstrap 3 CSS classes and aria-expanded, and keeps the dropdown behaviour Bootstrap had: a click or Space opens it and focuses the toggle, Arrow Up/Down open it and move between its links, Escape closes it and returns focus to the toggle, and an outside click or the collapse button closes it. Keys typed in a form field are left alone. The theme keeps Bootstrap 3.4.1's CSS, so it looks the same.
  • With that, the admin UI's jQuery 4.1.0 is the only jQuery left in Roller.
  • The Basic Mobile search form's empty-search check called jQuery Mobile's popup, which no weblog page loads any more, so the check threw and the empty search was submitted. It now shows the alert through the theme's :target rule without adding history entries, focuses its OK link, and returns focus to the search field on OK. A customized template that still loads jQuery Mobile keeps using its popup.
  • LICENSE, the binary LICENSE and CHANGES are updated. CHANGES lists the Gaurav change under the behaviour changes: a weblog on the shared theme whose own templates load the theme's js/jquery.js or js/bootstrap.js now gets errors for those files. Weblogs that customized the theme keep their own copies of the old files.

BasicMobileThemeRenderingTest renders the real search macro and checks the theme's :target rule. The new-user journey UI test previews the new weblog in the Gaurav theme and drives the Categories menu from the keyboard and after a click. I also checked the menu and the Basic Mobile alert in Chromium and WebKit.

The 6.1.x changes are in #349 and #350.

jQuery 4.1.0 and 3.8.0, released on 2026-11-17, fix a ReDoS in selector identifier matching, where a long chain of escapes followed by an invalid character could hang the page.

The admin UI moves from the jQuery 4.0.0 webjar to 4.1.0. The Gaurav theme's bundled jquery.js moves from 3.7.1 to 3.8.0, the unmodified jquery.min.js from the npm package (integrity checked), so the theme's Bootstrap 3 plugins keep the 3.x API. LICENSE, the binary LICENSE and CHANGES name the new versions.
@mraible
mraible requested a review from snoopdave November 18, 2026 14:14
Bootstrap 3's JavaScript refuses to run with jQuery 4, and the theme used it only for the navbar's collapse button and Categories dropdown. A small script, js/navbar.js, now toggles the same Bootstrap 3 CSS classes (in and open) and aria-expanded, closes the dropdown on an outside click or Escape, and needs no library. jquery.js and bootstrap.js are removed from the theme, its theme.xml and the LICENSE files, so the admin UI's jQuery 4.1.0 is the only jQuery left in Roller. The theme keeps Bootstrap 3.4.1's CSS, so it looks the same.

Weblogs that customized the theme keep their own copies of the old files.
@mraible mraible changed the title Upgrade jQuery to 4.1.0 and the Gaurav theme's jQuery to 3.8.0 Upgrade the admin UI to jQuery 4.1.0 and drop jQuery from the Gaurav theme Nov 18, 2026
@mraible mraible added the 7.0.0 label Nov 19, 2026

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of 102fd74cd: The dependency update and Gaurav asset references are consistent. Two behavior gaps remain: keyboard navigation in the replacement dropdown and a mobile search change present in #350 but absent here. This was a read-only review; no build was run.

The Gaurav theme's Categories dropdown again handles the keys Bootstrap 3's dropdown did: Arrow Up/Down on the toggle opens the menu and then moves between its links, and Escape closes it and returns focus to the toggle instead of leaving it on a hidden link. The new-user journey UI test previews the new weblog in the Gaurav theme and drives the menu from the keyboard.

The mobile search form's empty-search check called jQuery Mobile's popup API, but no weblog page loads jQuery, so the check threw and the empty search was submitted. As on 6.1.x, it now opens the alert by setting the URL fragment, which the Basic Mobile theme's :target rule displays. BasicMobileThemeRenderingTest renders the real macro and checks it.
Opening the Gaurav theme's Categories menu with a click now focuses its toggle, as Bootstrap 3 did, so Arrow Up/Down work afterwards in browsers that don't focus a clicked link, such as Safari. Space on the toggle opens the menu again.

The script also handles a few more cases the way Bootstrap did: the navbar's collapse button closes an open dropdown, arrow keys and Space typed in a form field inside a dropdown are left to the field, and a collapse button with an empty or unusable data-target does nothing instead of throwing. Click and keyboard handling now find the dropdown the same way. The new-user journey UI test checks Space and a click followed by Arrow Down.
A customized mobile template that still loads jQuery Mobile showed nothing on an empty search, because the check no longer called its popup. The check uses the popup again when jQuery Mobile is on the page, and the theme's :target alert otherwise.

The :target alert now replaces the URL fragment instead of adding history entries, so Back doesn't open it again. It focuses the alert's OK link, and OK hides the alert and returns focus to the search field, as jQuery Mobile's popup did.

BasicMobileThemeRenderingTest uses the standard ASF license header and also checks that the Basic Mobile stylesheet has the :target rule that shows the alert.
A weblog on the shared Gaurav theme whose own templates load the theme's js/jquery.js or js/bootstrap.js gets errors for those files after upgrading, so the entry moves from Build and packaging to the behaviour changes and says so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants