TypeScript-Node-Starter icon indicating copy to clipboard operation
TypeScript-Node-Starter copied to clipboard

Update of express-validator and source rewrite

Open peterblazejewicz opened this issue 8 years ago • 1 comments

The express-validator has been upgrade and its 5.* version explicitly states that API used in this project (and some projects, that part of this project are based on), are deprecated:

The version 3 style of doing validations is still available. Please check the legacy API for the docs.

https://github.com/ctavan/express-validator

There is no easy way to just change the express-validator dependency version up to 5.* without changing some part of code (e.g. validators in user controller).

Can this project source be upgraded? This will break the compatibility with a projects like https://github.com@sahat/hackathon-starter further.

Thanks!

peterblazejewicz avatar Feb 22 '18 20:02 peterblazejewicz

In hackathon-starter, we actually moved off of express-validator, to just validator (https://www.npmjs.com/package/validator). The reason behind it was the compatibility issues with express-validator 6:

Express-validator v6 removed legacy middleware methods, which are a breaking change for Hackathon Starter. The amount of code that would accomplish the same functionality is about the same. Validator.js was already a dependency but not being used. Validator.js has 10x more usage than express-validator, according to npm.

The related changes were: https://github.com/sahat/hackathon-starter/commit/8f79ae169153b414d418756e725579815d9f589e https://github.com/sahat/hackathon-starter/commit/2af44e95d992721c9e5892d830e65c8b21a506ab https://github.com/sahat/hackathon-starter/commit/64a390c6d9ef218d680e2068b145d534f8607a73

YasharF avatar Jan 17 '20 01:01 YasharF