Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Conversation

kevinansfield
Copy link
Member

no issue

  • brings client-side validator.js version up-to-date with server-side version
  • move validator-js from a bower dependency to an npm dependency
  • remove validator global from .jshintrc
  • update all uses of validator.* to use ES6 modules (should cut down on the amount of code imported)
  • remove custom validator extensions
    • uses of validator.empty have been updated to use Ember's isBlank that is imported as if it was an ES6 module via ember-cli-shims (we should probably start using ember-cli-shims everywhere as it paves the way for migrating to true ES6 modules once Ember has been officially split up)

This is currently failing but I haven't had a chance to properly debug yet. I believe it may be something related to validatorjs/validator.js#496 (diff)

no issue
- move `validator-js` from a bower dependency to an npm dependency
- remove `validator` global from `.jshintrc`
- update all uses of `validator.*` to use ES6 modules (should cut down on the amount of code imported)
- remove custom validator extensions
  - uses of `validator.empty` have been updated to use Ember's `isBlank` that is imported as if it was an ES6 module via `ember-cli-shims` (we should probably start using `ember-cli-shims` everywhere as it paves the way for migrating to true ES6 modules once Ember has been officially split up)
@acburdine
Copy link
Member

@kevinansfield The validations refactor should (I hope) remove the need for the validator.js library.

@ErisDS
Copy link
Member

ErisDS commented Jul 12, 2016

If validator.js is removed, how will the client side do things like determining if a URL is valid?

@acburdine
Copy link
Member

@ErisDS there's validation ulitities built into ember-changeset-validations 😄

@ErisDS
Copy link
Member

ErisDS commented Jul 12, 2016

The benefit to using validator.js on both the client and server is that you can be sure they'll both permit/reject the same things. So for complex things like email addresses and urls, there is no mis-match between what is accepted.

I'm just flagging this up as something to consider. If you run into issues with edge cases, it may be better to have custom validators wrap validator.js?

@acburdine
Copy link
Member

👍 yeah true, will definitely re-evaluate as the refactor goes farther along.

@acburdine
Copy link
Member

going to close this as it's being handled in the validation refactor

@acburdine acburdine closed this Jul 15, 2016
@kevinansfield kevinansfield deleted the deps-validator-js branch February 4, 2017 10:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants