Skip to content

Add namespace in JS lib #129

Closed
Svaroh/JsFormValidatorBundle
#19

Description

@66Ton99

Validation Constraints should not be in global scope.

Activity

  1. added this to the 2.0 milestone on Jul 7, 2017
  2. added a commit that references this issue on Aug 24, 2026
    4e956d8
  3. 66Ton99 commented on Aug 24, 2026

    @66Ton99
    CollaboratorAuthor

    Fixed in Svaroh/JsFormValidatorBundle, the new home of this bundle, by PR #19.

    Constraints and transformers are registered in a single window.Svaroh object - Svaroh.constraints and Svaroh.transformers - instead of one global per class name.

    Every former global name is kept as an alias, and a class defined only in the global scope is still found, so custom constraints and custom data transformers written against the old globals keep working unchanged. New ones can be registered in the namespace instead:

    Svaroh.constraints.AppValidatorConstraintsContainsAlphanumeric = function () {
        // ...
    };

    The fix is in the svaroh/jsformvalidator-bundle package on main. It is not backported to fp/jsformvalidator-bundle, which stays on its 1.x line, so upgrading to the new package is what picks it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions