Skip to content

Report 18: JavaScript Bootstrap 5 API Audit

Date: 2026-02-27 Scope: src/www/wwwroot/Scripts/*.js (56 files) Status: COMPLETE -- stickyNav fixed (commit 7ae1735), jQuery tooltip deferred to BS5 compat layer

Summary

56 JavaScript files scanned for Bootstrap 4 patterns. The codebase is largely BS5-compliant already. Previous agent work (commit 08e9a5d) updated progressCore.js and stickyNav.js.

Key finding: 1 HTML/JS mismatch bug discovered (stickyNav), 1 jQuery tooltip call that will need migration when dropping the jQuery Bootstrap plugin.

Findings

Data Attribute References

File Line Pattern Status Notes
progressCore.js 253 $('[data-bs-toggle="tooltip"]').tooltip() Already BS5 selector jQuery .tooltip() call needs BS5 API later
stickyNav.js 17 $('[data-bs-toggle="sticky-onscroll"]') Already BS5 selector Custom attribute, not Bootstrap
gridSliderConfig.js 25-26 data-slides-to-show, data-slides-to-scroll N/A Slick carousel attributes, not Bootstrap

No remaining BS4 data-toggle, data-target, data-dismiss, data-parent, data-slide, or data-ride references found in any JS file.

jQuery Bootstrap Plugin Calls

File Line Call Priority Migration Path
progressCore.js 253 .tooltip() P2 Replace with new bootstrap.Tooltip(el) per element, or use Tooltip.getOrCreateInstance()

No other jQuery Bootstrap plugin calls found (.modal(), .dropdown(), .collapse(), .carousel(), .popover(), .tab() -- all zero hits).

Bootstrap Event Listeners (Already BS5-compatible)

These files use BS5-namespaced events (show.bs.tab, shown.bs.collapse, etc.) which are correct:

File Lines Events Used
progressCore.js 297, 307, 333, 337, 342, 350, 357, 397 shown.bs.collapse, hidden.bs.collapse, show.bs.collapse, shown.bs.tab
calculatorInput.js 96 show.bs.tab
calculatorInputSmall.js 98, 131 show.bs.tab
calculatorInputVarRate.js 117 show.bs.tab
tabs.js 3 shown.bs.collapse

All event names are already BS5-compatible (BS5 uses the same event namespace).

jQuery .active Class Manipulation (No Change Needed)

File Lines Usage
progressCore.js 260-261 Nav item active toggle
progressCore.js 402, 408 Tab nav active state
slideform.js 149, 240 Slide active state
gridSlider.js 160 Lazy image .show class

These are standard jQuery class manipulation, not Bootstrap plugin calls. No migration needed.

BUG FOUND AND FIXED: stickyNav HTML/JS Mismatch

Severity: P1 -- sticky navigation was broken Status: FIXED in commit 7ae1735

The JS (stickyNav.js:17) selects [data-bs-toggle="sticky-onscroll"] but the HTML (stickyNav.cshtml:23) was using data-toggle="sticky-onscroll". The selector could not find the element, so sticky nav functionality was broken.

Fix applied: Updated stickyNav.cshtml:23 to use data-bs-toggle="sticky-onscroll" for consistency with the BS5 attribute convention.

Migration Plan (Future)

When removing the jQuery Bootstrap compatibility layer:

  1. progressCore.js:253 -- Replace jQuery tooltip init:

    // Before (jQuery plugin)
    $('[data-bs-toggle="tooltip"]').tooltip();
    
    // After (BS5 vanilla JS)
    document.querySelectorAll('[data-bs-toggle="tooltip"]')
      .forEach(el => new bootstrap.Tooltip(el));
    

  2. All other JS is already compatible with BS5 -- no further changes needed.

Recommendation

Defer jQuery plugin migration. The single .tooltip() call works today because BS5's bundle includes a jQuery compatibility layer. There is no urgency to convert it to vanilla JS API. When the project eventually drops jQuery entirely, convert that one call to new bootstrap.Tooltip(el). All other JS is already BS5-native.

Files With Zero BS4 Patterns (50 of 56)

The remaining 50 JS files have no Bootstrap-related patterns at all. They contain calculator logic, form handling, map integrations, cookie consent, and other application-specific code with no Bootstrap dependencies.

Migration documentation by Double for Progress Credit Union