Skip to content

Commit a6b11f3

Browse files
authored
Remove unused JS source exports (#1017)
Drop unused default exports from helpers and local validator modules, and remove the unused addClass/removeClass helpers after the jQuery removal.
1 parent f7c0874 commit a6b11f3

16 files changed

Lines changed: 22 additions & 86 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 25.0.0 / unreleased
4+
5+
* [FEATURE] Breaking change: remove unused JavaScript source exports
6+
- Deep imports of `src/validators/local/*` must use named exports instead of the removed default object exports, for example `import { acceptanceLocalValidator } from '@client-side-validations/client-side-validations/src/validators/local/acceptance'`
7+
- Remove the unused `addClass` and `removeClass` exports from `src/utils.js`
8+
39
## 24.0.0 / 2026-04-19
410
* [FEATURE] Breaking change: Remove the jQuery runtime dependency and the old jQuery plugin aliases from the published JavaScript assets
511
* [FEATURE] Breaking change: Public JavaScript APIs now work with native DOM elements and DOM collections instead of jQuery-wrapped objects

dist/client-side-validations.esm.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/client-side-validations.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module ClientSideValidations
4-
VERSION = '24.0.0'
4+
VERSION = '25.0.0'
55
end

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
"test": "test/javascript/run-qunit.mjs"
2323
},
2424
"devDependencies": {
25-
"@babel/core": "^7.29.0",
26-
"@babel/preset-env": "^7.29.2",
25+
"@babel/core": "^7.29.7",
26+
"@babel/preset-env": "^7.29.7",
2727
"@rollup/plugin-babel": "^7.0.0",
2828
"@rollup/plugin-node-resolve": "^16.0.3",
2929
"chrome-launcher": "^1.2.1",
3030
"eslint": "^9.39.4",
31-
"eslint-plugin-compat": "^7.0.1",
31+
"eslint-plugin-compat": "^7.0.2",
3232
"neostandard": "^0.13.0",
33-
"puppeteer-core": "^25.0.2",
34-
"rollup": "^4.60.2",
33+
"puppeteer-core": "^25.1.0",
34+
"rollup": "^4.60.4",
3535
"rollup-plugin-copy": "^3.5.0"
3636
},
3737
"main": "dist/client-side-validations.js",
@@ -62,7 +62,7 @@
6262
"/vendor/"
6363
]
6464
},
65-
"version": "24.0.0",
65+
"version": "25.0.0",
6666
"directories": {
6767
"lib": "lib",
6868
"test": "test"

src/events.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,3 @@ export const dispatchCustomEvent = (element, eventName, detail) => {
3434
detail
3535
}))
3636
}
37-
38-
export default {
39-
bindElementEvents,
40-
clearBoundEventListeners,
41-
dispatchCustomEvent
42-
}

src/utils.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
export const addClass = (element, customClass) => {
2-
if (customClass) {
3-
element.classList.add(...customClass.split(' '))
4-
}
5-
}
6-
71
export const arrayHasValue = (value, otherValues) => {
82
for (let i = 0, l = otherValues.length; i < l; i++) {
93
if (value === otherValues[i]) {
@@ -71,21 +65,3 @@ export const isVisible = (element) => {
7165
export const isValuePresent = (value) => {
7266
return !/^\s*$/.test(value || '')
7367
}
74-
75-
export const removeClass = (element, customClass) => {
76-
if (customClass) {
77-
element.classList.remove(...customClass.split(' '))
78-
}
79-
}
80-
81-
export default {
82-
addClass,
83-
arrayHasValue,
84-
createElementFromHTML,
85-
getDOMElements,
86-
isFormElement,
87-
isInputElement,
88-
isVisible,
89-
isValuePresent,
90-
removeClass
91-
}

src/validators/local/absence_presence.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,3 @@ export const presenceLocalValidator = (element, options) => {
1111
return options.message
1212
}
1313
}
14-
15-
export default {
16-
absenceLocalValidator,
17-
presenceLocalValidator
18-
}

src/validators/local/acceptance.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,3 @@ export const acceptanceLocalValidator = (element, options) => {
2929
return options.message
3030
}
3131
}
32-
33-
export default {
34-
acceptanceLocalValidator
35-
}

src/validators/local/confirmation.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@ export const confirmationLocalValidator = (element, options) => {
1111
return options.message
1212
}
1313
}
14-
15-
export default {
16-
confirmationLocalValidator
17-
}

0 commit comments

Comments
 (0)