BoxLang 🚀 A New JVM Dynamic Language Learn More...
A Preside CMS extension that replaces legacy jQuery and Bootstrap JavaScript with modern, lightweight alternatives while maintaining full API compatibility.
Preside's admin interface relies on jQuery 2.x and Bootstrap 3.x. This extension provides drop-in replacements using Preside's Sticker asset management system:
| Legacy Library | Replacement | Description |
|---|---|---|
| jQuery 2.2.5 | JQNext | jQuery 2.x API compatible, modern ES6+ internals |
| Bootstrap 3 JS | SandalJS | Bootstrap 3 API compatible, powered by JQNext |
Preside uses Sticker for asset management where each asset has a unique ID. This extension registers assets using the same IDs as core Preside:
/js/admin/lib/jquery/ → JQNext (replaces jQuery)/js/admin/lib/bootstrap/ → SandalJS (replaces Bootstrap JS)When loaded, Sticker's override mechanism ensures the modern libraries are used throughout the admin interface. All existing Preside JavaScript continues to work without modification.
Both libraries leverage native browser APIs, resulting in significantly smaller file sizes.
window.presideJQuery automatically setNo legacy IE polyfills, ES6+ classes, native Promises, tree-shakeable modules.
JQNext enables Preside developers to gradually adopt modern JavaScript patterns while maintaining full compatibility with existing jQuery-based code. This means you can:
Mix Modern and Legacy Patterns
// Legacy jQuery patterns continue to work
$('.widget').on('click', function() {
$(this).fadeIn();
});
// Modern patterns work alongside
$('.widget').on('click', async function() {
const response = await fetch('/api/data');
const data = await response.json();
$(this).html(data.content);
});
Use Native Promises with jQuery AJAX
// JQNext's $.ajax() returns a native Promise-compatible object
const data = await $.getJSON('/api/endpoint');
// Or use Fetch directly alongside jQuery DOM manipulation
const response = await fetch('/api/endpoint');
$('.container').html(await response.text());
Leverage Modern APIs in Existing Code
// JQNext uses WeakMap internally, preventing memory leaks in long-running SPAs
$('.dynamic-content').data('instance', complexObject);
// No need to manually clean up - garbage collected automatically
// Animation uses Web Animation API for better performance
$('.element').animate({ opacity: 0.5 }, 300);
// Runs on compositor thread, won't block main thread
Incremental Migration Path
box install preside-ext-jsmodern
Full jQuery 2.x API compatibility:
:visible, :hidden,
:eq(n), etc.fadeIn(), slideUp(),
animate(), etc.$.ajax(), $.get(), $.post()
$.extend(), $.Deferred(), etc.Bootstrap 3 JavaScript components:
Modern browsers with ES6+ support. Legacy IE is intentionally not supported.
MIT
https://github.com/pixl8/JQNext
https://github.com/pixl8/SandalJS
$
box install preside-ext-jsmodern