Releases: palcarazm/bootstrap5-toggle
Release list
v5.4.1
ℹ️ What's Changed
✅ Fixed
-
Side effects configuration for tree-shaking - Updated
sideEffectsin package.json to explicitly include CSS and JS files, preventing them from being dropped by bundlers during optimization.- fixes #334 by @palcarazm in 9d34717
-
Global constants exposure in non-module environments - Exposed
Events,Methods,StateValue, andStateStatusas properties on the globalwindow.BootstrapToggleobject for easy access in script-tag usage. Maintains CommonJS backward compatibility.- by @palcarazm in 2c69775
-
Type safety for DOM toggle integration - Replaced unsafe type assertions with proper TypeScript patterns using
querySelectorAll<HTMLInputElement>generics and extended interface declarations for correct inheritance, eliminatingasassertions where possible.- by @palcarazm in 3dca15b
🆙 Dependencies, CI/CD, and Others
- CI/CD improvements:
- Updated Sonar coverage exclusions to include config files for more accurate test coverage reporting.
- by @palcarazm in 6b17e4e
- Updated Sonar coverage exclusions to include config files for more accurate test coverage reporting.
Full Changelog: https://github.com/palcarazm/bootstrap-toggle/compare/v5.4.0...v5.4.1
v5.4.0
ℹ️ What's Changed
🔁 Changed
-
Preserve instance identity in Toggle.rerender() - Replaces destroy+recreate with in-place rebuild that preserves the same object reference, making external references to
this.element.bsTogglesafe.- implements #318 by @palcarazm in
c02fcfc
- implements #318 by @palcarazm in
-
Replace Grunt with npm scripts and modern tooling - Removes Grunt and 4 Grunt plugins, replacing with tsc, rollup, postcss, and rimraf. Build artifacts now isolated to
dist/tmp/. Adds parallel watch mode with concurrently.- BREAKING CHANGE: TypeScript declaration output moved from
src/main/@typestodist/tmp/@types(affects developers building from source only) - implements #330 by @palcarazm in
7e30d3c
- BREAKING CHANGE: TypeScript declaration output moved from
-
Upgrade TypeScript target to ES2016 - Changes target from ES5 to ES2016 across all tsconfig files, adding explicit type roots and noEmit flags. Normalizes configuration consistency.
- by @dependabot[bot] and @palcarazm in
d9b6318
- by @dependabot[bot] and @palcarazm in
-
Export published CSS and JS assets - Ensures built assets are properly exported for package consumers.
- by @xianzuyang9-blip in
242c7f4
- by @xianzuyang9-blip in
-
Fix Cypress configuration file naming - Renames Cypress config file to use
.cjsextension.- by @palcarazm in
f428911
- by @palcarazm in
🆙 Dependencies, CI/CD, and Others
-
Dependency updates:
@commitlint/clifrom20.5.3to21.0.2@commitlint/config-conventionalfrom20.5.3to21.0.2commitlintfrom20.5.3to21.0.2typescriptfrom5.9.3to6.0.2@types/jqueryfrom3.5.34to4.0.0@rollup/plugin-terserfrom0.4.4to1.0.0cypress-plugin-tabfrom1.0.5to2.0.0
-
GitHub Actions updates:
cypress-io/github-actionfrom7.1.2to7.4.0SonarSource/sonarqube-scan-actionfrom7.0.0to8.0.0actions/upload-pages-artifactfrom4to5actions/download-artifactfrom7to8actions/deploy-pagesfrom4to5actions/upload-artifactfrom6to7actions/configure-pagesfrom5to6
-
CI/CD improvements:
- Update Dependabot configuration for better dependency management
- Add Dependabot to docs package monitoring
- Move docs to main branch
- Update README documentation
- Upgrade
bs-darkmode-togglefrom1.0.0-rc1to1.0.0in docs, switching from cookies to local storage for theme preference
Full Changelog: v5.3.3...v5.4.0
v5.3.3
ℹ️ What's Changed
✅ Fixed
- Expose library constants on global BootstrapToggle object - Events, Methods, StateValue, and StateStatus are now available at
window.BootstrapTogglefor easy access in non-module environments. Type aliases (Options, Style, Size, State, EventDetail) added for cleaner public API with full TypeScript support.- by @palcarazm in 2c69775
Full Changelog: v5.3.2...v5.3.3
v5.3.2
ℹ️ What's Changed
✅ Fixed
- Improve type safety for DOM toggle integration - Replaced unsafe type assertions with proper TypeScript patterns including generic DOM selection and correct interface inheritance. This eliminates
asassertions where possible and ensures type consistency between exported interfaces and global declarations.- by @palcarazm in 3dca15b
Full Changelog: v5.3.1...v5.3.2
v5.3.1
ℹ️ What's Changed
✅ Fixed
- Standardize rerender method name to lowercase - The
rerendermethod now correctly uses lowercase naming, matching the documented API. Method name matching is now case-insensitive to prevent confusion.- fixes #313 by @palcarazm in 37e3e53
🔁 Changed
- Migrate type system to isolated declaration files - Type definitions have been refactored for better maintainability. Global augmentation interfaces are now exported from separate files, allowing consumers to import types without side effects. Jest and Sonar coverage exclusions updated to correctly ignore entry point files.
- by @palcarazm in 8e69ad7
Full Changelog: v5.3.0...v5.3.1
v5.3.0
ℹ️ What's Changed
🆕 Added
- Bootstrap tooltip support – adds comprehensive tooltip functionality with title configuration via data attributes (
data-tooltip-title-on,data-tooltip-title-off,data-tooltip-title-mixed,data-tooltip-placement) and JavaScript API.- by @palcarazm
- implements #215
- in ad415db
- Custom DOM events for toggle state changes – emits six custom events (
toggle:on,toggle:off,toggle:mixed,toggle:enabled,toggle:disabled,toggle:readonly) with state details in payload for better framework integration.- by @palcarazm
- implements #233
- in ba955f9
- Full ARIA accessibility support – adds role="switch", aria-label, aria-checked, aria-disabled, and aria-readonly attributes with proper state updates for screen reader compatibility.
- by @palcarazm
- implements #232
- in 0e104e7
- HTML sanitization for toggle labels – implements allow-list based sanitization to safely allow HTML formatting (bold, italic, icons) while preventing XSS vulnerabilities.
- by @palcarazm
- implements security enhancement
- in 26f3125
- Add silent parameter support to
enable(),disable()andreadonly()methods- by @palcarazm
- implements #289
- in commit adddb35
🔁 Changed
- Performance optimization with requestAnimationFrame – batches DOM calculations to prevent forced synchronous reflows, improving rendering performance by 60-70% for multiple toggles.
- by @palcarazm
- implements #258
- in 68003ad
- Rename
INDETERMINATEstate value toMIXEDfor clarity- by @palcarazm
- implements #288
- in commit 0594a81
✅ Fixed
- Security vulnerability in HTML labels – prevents XSS attacks through malicious HTML/scripts in toggle labels using robust sanitization with allow-list approach.
- by @palcarazm
- fixes #257
- in 26f3125
- Make keyboard event handler non-passive and prevent default space/enter
- by @palcarazm
- fixes #287
- in commit 414a6ac
🆙 Bump
- Dependency updates:
- GitHub Actions updates:
cypress-io/github-actionfrom 7.1.0 to 7.1.1actions/setup-nodefrom 3 to 6actions/checkoutfrom 3 to 6actions/upload-pages-artifactfrom 3 to 4actions/upload-artifactfrom 4 to 6cypress-io/github-actionfrom 6.10.8 to 7.1.2github/codeql-actionfrom 3 to 4actions/download-artifactfrom 4 to 7
- CI & Dependencies improvements:
- Dependabot configuration updates
- Sonar copy-paste detector exclusions added
- npm cache removal
Full Changelog: v5.2.0...v5.3.0
v5.3.0-rc2
ℹ️ What's Changed
🆕 Added
- Add silent parameter support to
enable(),disable()andreadonly()methods- by @palcarazm
- implements #289
- in commit adddb35
🔁 Changed
- Rename
INDETERMINATEstate value toMIXEDfor clarity- by @palcarazm
- implements #288
- in commit 0594a81
✅ Fixed
- Make keyboard event handler non-passive and prevent default space/enter
- by @palcarazm
- fixes #287
- in commit 414a6ac
🆙 Bump
-
GitHub Actions updates:
- cypress-io/github-action from 7.1.0 to 7.1.1
- actions/setup-node from 3 to 6
- actions/checkout from 3 to 6
- actions/upload-pages-artifact from 3 to 4
- actions/upload-artifact from 4 to 6
- cypress-io/github-action from 6.10.8 to 7.1.0
- github/codeql-action from 3 to 4
- actions/download-artifact from 4 to 7
-
CI & Dependencies improvements:
- Dependabot configuration updates
- Sonar copy-paste detector exclusions added
- npm cache removal
Full Changelog: v5.3.0-rc1...v5.3.0-rc2
v5.3.0-rc1
ℹ️ What's Changed
🆕 Added
- Bootstrap tooltip support – adds comprehensive tooltip functionality with title configuration via data attributes (
data-tooltip-title-on,data-tooltip-title-off,data-tooltip-title-mixed,data-tooltip-placement) and JavaScript API.- by @palcarazm
- implements #215
- in ad415db
- Custom DOM events for toggle state changes – emits six custom events (
toggle:on,toggle:off,toggle:mixed,toggle:enabled,toggle:disabled,toggle:readonly) with state details in payload for better framework integration.- by @palcarazm
- implements #233
- in ba955f9
- Full ARIA accessibility support – adds role="switch", aria-label, aria-checked, aria-disabled, and aria-readonly attributes with proper state updates for screen reader compatibility.
- by @palcarazm
- implements #232
- in 0e104e7
- HTML sanitization for toggle labels – implements allow-list based sanitization to safely allow HTML formatting (bold, italic, icons) while preventing XSS vulnerabilities.
- by @palcarazm
- implements security enhancement
- in 26f3125
🔁 Changed
- Performance optimization with requestAnimationFrame – batches DOM calculations to prevent forced synchronous reflows, improving rendering performance by 60-70% for multiple toggles.
- by @palcarazm
- implements #258
- in 68003ad
✅ Fixed
- Security vulnerability in HTML labels – prevents XSS attacks through malicious HTML/scripts in toggle labels using robust sanitization with allow-list approach.
- by @palcarazm
- fixes #257
- in 26f3125
🆙 Bump
- Dependency updates:
Full Changelog: v5.2.0...v5.3.0-rc1
v5.2.0
⚠️ Important information
This release includes a complete core refactor to TypeScript, improvements in maintainability and compatibility, and updated dependencies.
1️⃣ Complete TypeScript Refactor
- All main modules (
Toggle,StateReducer,DOMBuilder,OptionResolver) have been rewritten in TypeScript to improve maintainability and type safety.
-Option parsing, state management, and rendering logic are now centralized and modular.
2️⃣ Clear Separation of Responsibilities
Togglecoordinates events and exposes the public API.OptionResolverdecide options fromdata-attributes, user provided options and defaults options. It also handle deprecated options.StateReducermanages all toggle state logic (ON|OFF|INDETERMINATE|READONLY|DISABLED).DOMBuilderhandles rendering of the toggle and its associated elements.
3️⃣ API Compatibility Preserved
- The
jQueryclassic API$(selector).bootstrapToggle()and theECMAScriptAPIdocument.querySelector(selector).bootstrapToggle()remains fully functional using the refactored core. - Event and state logic is shared between ES Modules and the jQuery wrapper, eliminating duplication and historical bugs.
ℹ️ What's Changed
🆕 Added
🔁 Changed
- Centralized core logic in TypeScript modules – migrated build system to Rollup and PostCSS, refactored internal architecture into modular classes (OptionResolver, StateReducer, DOMBuilder, Builder).
- by @palcarazm
- in 246d33e
- Consolidated CI workflows – unified multiple independent workflows into a single pipeline with Node.js version matrix, coverage reporting, and cross-browser Cypress tests.
- by @palcarazm
- in 5acf0ab and 5acf0ab
- Updated contribution guidelines and tooling – added ESLint and commitlint, updated templates and workflows.
- by @palcarazm
- in 4fd8a0b
✅ Fixed
- Toggle event handling – prevents unintended toggling on scroll, drag interactions, and right-clicks using dynamic pointer listeners with gesture thresholds.
- by @palcarazm
- fixes #213, #153, #187
- in dbe4184
- DOM sizing in hidden containers – uses ResizeObserver to defer rendering until parent elements become visible, ensuring correct toggle dimensions in tabs/accordions.
- by @palcarazm
- fixes #231
- in 1526bb6
- Input property handling – intercepts external changes to input properties (checked, disabled, readonly, indeterminate) and restores original descriptors on destroy.
- by @palcarazm
- fixes #261
- in baee160
- CSS unit support for width/height options – now properly handles explicit CSS units (rem, em, %, vw, vh) without incorrectly appending "px".
- by @palcarazm
- fixes #242
- in 218bb32
- Agnostic interface and user options preservation – ensures compatibility with both ECMAS and jQuery interfaces and preserves user options during rerender.
- by @palcarazm
- fixes #236
- in f50a655
- OptionResolver attribute preference – correctly prioritizes
data-onvalueattribute overvalueattribute in options parsing.- by @palcarazm
- fixes #237
- in b5e3d34
- Refactored code quality improvements – multiple SonarQube-driven fixes including cognitive complexity reduction, best practice updates, and accessibility improvements.
- by @palcarazm
- in commits a0757b9 through 9744a68
🆙 Bump
- Dependency updates:
jqueryfrom 3.7.1 to 4.0.0 (#277)lodashfrom 4.17.21 to 4.17.23 (#279)@commitlint/config-conventionalfrom 19.8.1 to 20.3.1 (#269)commitlintfrom 19.8.1 to 20.3.1 (#268)globalsfrom 16.5.0 to 17.0.0 (#267)@commitlint/clifrom 19.8.1 to 20.3.1 (#266)cypressfrom 13.13.3 to 15.9.0 (multiple updates: #210, #265, 780e658)@typescript-eslint/parserfrom 8.52.0 to 8.53.0 (#278)@typescript-eslint/eslint-pluginfrom 8.52.0 to 8.53.0 (cbad57f)rollupfrom 4.54.0 to 4.55.1 (a8c1dbf)
- CI and infrastructure:
- Added SonarQube analysis pipeline
- Updated ESLint configurations and exclusions
- Improved GitHub Actions security with SHA references
- Updated documentation deployment pipeline
- Enhanced test coverage with pointer/keyboard interaction tests
Full Changelog: v5.1.3...v5.2.0
v5.2.0-rc3
ℹ️ What's Changed
🆕 Added
🔁 Changed
- Refactored code based on SonarQube analysis – improved code quality, reduced cognitive complexity, and applied best practices across the codebase.
- by @palcarazm
- in a0757b9 ... 9744a68
✅ Fixed
- Toggle input property handling – intercepts external changes to input properties (checked, disabled, readonly, indeterminate) and restores original descriptors on destroy, preventing sync loops and form reset issues.
- by @palcarazm
- fixes #261
- in baee160
🆙 Bump
-
Dependencies updated:
-
CI and tooling updates:
- Updated ESLint exclusions
- Updated badge and package metadata
- Added SonarQube analysis to pipeline
- Improved GitHub Actions security with SHA references
- Various configuration and documentation updates
Full Changelog: v5.2.0-rc2...v5.2.0-rc3