DavyJonesLocker/client_side_validations
58.6
Adequate · 6 November 2026
853
lines of production code
Ruby
with JavaScript
4
measurements over time
What this system is
Features
Add initializer template with configurable disabled validators and field error handling
The generator now includes a new initializer template that allows users to disable specific validators via \ClientSideValidations::Config.disabled\_validators\ and configure how validation error messages are rendered in the DOM through \ActionView::Base.field\_error\_proc\. This provides a centralized configuration point for customizing client-side validation behavior and error display formatting.
lib/generators/templates · high confidence
Removals
Removed custom Mongoid uniqueness validator
The custom uniqueness validator for Mongoid (\lib/client\_side\_validations/mongoid/uniqueness.rb\) has been removed. This file previously defined a \message\_types\ method returning \\[:taken\]\, which is no longer part of the library's validation logic.
_lib/client\_side\validations/mongoid · high confidence
Behavioural changes
Client Side Validations JS v25.0.0
The vendor JavaScript asset for client-side form validation has been updated to version 25.0.0. This release replaces the previous jQuery-dependent implementation with a modern, vanilla JavaScript codebase that uses native DOM APIs (such as \addEventListener\ and \CustomEvent\) instead of jQuery methods. For users, this means the validation library no longer requires jQuery as a runtime dependency, resulting in a lighter footprint and improved compatibility with modern JavaScript bundlers and frameworks that do not rely on jQuery.
vendor · high confidence
Client Side Validations JS v25.0.0 released with modernized JavaScript and removed jQuery dependency
The distributed JavaScript assets in the dist folder have been regenerated for version 25.0.0, reflecting a major overhaul of the client-side validation library. The codebase has been converted to ES6 modules and modern JavaScript syntax, removing the previous jQuery dependency entirely in favor of native DOM APIs. This update also introduces Turbo compatibility, ensures validation does not run on dynamically disabled inputs, and utilizes the HTML dataset API for accessing configuration settings, resulting in a lighter and more standards-compliant runtime for users.
dist · high confidence
Client Side Validations v25.0.0: Modernized Rails integration and architecture
This release updates the gem to version 25.0.0 and significantly refactors the internal architecture to align with modern Rails conventions. The library now uses \ActiveSupport.on\_load\ hooks to inject validations into \ActionView\ and \ActiveRecord\, replacing previous eager-loading patterns. It drops support for legacy frameworks (Mongoid integration removed, older Rails versions deprecated) and introduces a new \Config\ module for global settings like disabled validators. The core validation logic has been rewritten to support \proc\ values in validators, handle conditional validators more robustly (including \will\_save\_change\_to?\ checks), and improve error message generation with fallbacks for missing translations.
_lib/client\_side\validations · high confidence
Client-side validation logic refactored into modular ES modules
The client-side validation engine has been restructured from a single monolithic file into separate ES modules (core, events, utils, index) to improve maintainability and remove legacy dependencies. This change replaces jQuery-based DOM manipulation and event handling with native browser APIs and a custom event binding system, and migrates data access to use the HTML5 dataset API. For users, this ensures better compatibility with modern JavaScript environments and frameworks like Turbo, while preserving the existing validation behavior and callback interfaces.
src · high confidence
Improved JSON serialization for Range and Regexp validators
Client-side validation now correctly serializes Range and Regexp objects to JSON, fixing issues where these types were not properly converted for JavaScript consumption. Range objects are now serialized as arrays containing their start and end values, ensuring inclusion/exclusion validators work with floats and other types. Regexp objects are converted using the js\_regex gem, which handles complex regular expressions (including modifiers and flags) more reliably than the previous implementation, resolving stack overflow errors and incorrect pattern matching on the client side.
_lib/client\_side\_validations/core\ext · high confidence
Major version 25.0.0: Modernized build toolchain and breaking API changes
This release introduces significant breaking changes and infrastructure updates. The JavaScript build pipeline replaces Rollup with Rolldown v1 and ESLint with Oxlint v1, resulting in substantially faster builds and linting, while dropping Babel in favor of Rolldown's built-in Oxc transforms. The public JavaScript API is now native-DOM-first, removing jQuery dependencies and requiring updates to custom validators, form builders, and callbacks to use native DOM APIs instead of jQuery wrappers. Additionally, validation state data attributes are now namespaced under 'csv' (e.g., \data-csv-changed\), and unused JavaScript source exports have been removed, requiring deep imports to use named exports. The gem also drops support for Ruby \< 3.2 and Rails \< 7.2.
(repo-wide) · high confidence
Refactored ActiveModel validators to support conditionals and proc-based options
The client-side validation logic for ActiveModel validators has been refactored to support conditional validation execution and dynamic (proc-based) options. A new \Conditionals\ module enables the use of \if\ and \unless\ specifications, allowing validations to be skipped based on runtime conditions. Additionally, validators such as \Length\, \Numericality\, and \Format\ now support proc values for their options (e.g., dynamic length limits or regex patterns), resolving these values only when forced. The internal structure of validators has also been standardized to use a single \message\_type\ method instead of \message\_types\, and support for \allow\_nil\ has been aligned with \allow\_blank\ in \Numericality\ and \Length\ validators.
_lib/client\_side\_validations/active\model · high confidence
Refactored asset and initializer installation generators
The gem now uses a dedicated CopyAssetsGenerator to handle copying JavaScript assets, automatically detecting whether to use the Sprockets asset pipeline or the public directory based on the presence of Sprockets or Webpacker. The InstallGenerator inherits from this to also copy the configuration initializer, ensuring a cleaner separation of concerns and better compatibility with different Rails asset setups.
_lib/generators/client\_side\validations · high confidence
Refactored library initialization to use modular requires
The main library entry point has been restructured to explicitly require specific components (config, active\_model, active\_record, action\_view, engine, and generators) only when their respective dependencies are defined. This replaces the previous placeholder implementation with a modular loading strategy that conditionally loads Rails-specific engine and generator code, improving initialization clarity and dependency management.
lib · high confidence
Uniqueness validator now generates client-side validation hashes
The uniqueness validator in the ActiveRecord adapter has been refactored to generate a structured client-side validation hash instead of just returning message types. This change enables the client-side library to receive specific validation parameters such as case sensitivity, the model's primary key ID, and scope values, allowing for more accurate and context-aware validation feedback in the browser. The implementation also handles class name overrides and respects allow\_nil/allow\_blank options.
_lib/client\_side\_validations/active\record · high confidence
Validators now render in settings JSON instead of inline data attributes
Client-side validation rules are no longer injected as inline \data-\ attributes on individual form fields. Instead, the \form\_builder.rb\ and \form\_helper.rb\ modules now collect validation metadata during form construction and output it as a single \data-client-side-validations\ JSON object on the form element itself. This change simplifies the HTML structure, resolves issues with HTML parsers misinterpreting validation tags inside JavaScript, and ensures that validation settings are consistently available for the client-side engine regardless of how the form is rendered.
_lib/client\_side\_validations/action\view · high confidence
Validators rewritten in ES6 with jQuery removed
The local validators (absence, presence, acceptance, confirmation, exclusion, inclusion, format, length, numericality, and uniqueness) have been rewritten using ES6 modules and modern JavaScript syntax, removing the previous jQuery dependency. This change improves code maintainability and reduces runtime overhead by relying on native DOM APIs instead of jQuery selectors and utilities.
src/validators · high confidence
Test coverage
Added ActionView form helper test suite; Added QUnit test coverage for client-side validators; Added QUnit test runner views for JavaScript validation tests; Added QUnit test suite for client-side validation settings and element validation; Added QUnit tests for ClientSideValidations callbacks; Added QUnit tests for form validation and submission behaviors; Added test fixtures for GUID, STI, and uniqueness validation scenarios; Added test infrastructure and coverage setup; Added test model for ActiveModel validation scenarios; Added test models for ActionView validation scenarios; Added tests for ActiveRecord uniqueness validator client-side hash generation; Added tests for Install and CopyAssets generators; Added tests for Regexp and Range JSON serialization; New local test server and headless runner for JavaScript validation tests; Refactor Active Model test suite to use ActiveSupport::TestCase; Removed legacy Mongoid test suite.
Dependencies
Added test support for Rails 7.2, 8.0, 8.1, and edge versions
New appraisal gemfiles have been added to enable testing against Rails 7.2.0, 8.0.0, 8.1.0, and the Rails main branch. These configurations also pin the json gem to versions below 3.0 and utilize appraisal2 for generation.
gemfiles · high confidence
Update dependencies for Rails 7.2/8.x and modernize build tooling
This change updates the gem's runtime dependencies to require Rails 7.2 or higher and js\_regex 3.14 or higher, dropping support for older Rails versions. It also introduces a new Node.js build setup using pnpm, rolldown, and oxlint, with a minimum Node version of 18.12. Development dependencies are explicitly managed in the Gemfile, including pinned versions for json (\< 3.0) and appraisal2, while legacy development dependencies like mongoid and ruby-debug are removed.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 58 → 59 (+0.6)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 58 → 58 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 51 → 54 (+3.1)
- Readiness 71 → 71 (+0.0)
- Security 74 → 65 (-8.7)
Resolved (2)
- Inconsistent naming of the third parameter in client_side_hash. Some validators use _force (implying unused) while others use force. This suggests inconsistent handling or documentation of the force argument across validator implementations.
- Inconsistent parameter naming for the same underlying Rails helper method. FormBuilder uses fields_options while FormHelper uses options. While functionally similar, this creates confusion for developers implementing or extending these helpers.
Changes since last survey
- 1 commits — 1 feature/other, 0 fixes
By area
- .github/workflows — 1 commit
Notable commits
- change: Bump ruby/setup-ruby from 1.328.0 to 1.329.0 (#1050)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
DavyJonesLocker/client_side_validations was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 69c62e839f859a03551df7807f21f61c3447361b — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.