-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Make class-validator a peer dependency #366
Comments
Peer dependency doesn't fix that - you can have pkg A with I will make the whole Now it would be a bit weird that the support for |
In the example you mentioned v 0.9.1 would satisfy both. I am also proposing to expose a function in the options |
No, semver on 0.x.x release is 0.major.minor.
Too complicated setup. In the future it will be possible with a plugin system, so you could install |
Oh ok
A plugin system would be perfect and would solve the issue. |
Is there a roadmap/TODO list/project for the vNext branch? I would like to contribute. |
@19majkel94 Can we make class-validator optional and decouple it from |
https://bundlephobia.com/[email protected] |
As a workaround, check out typestack/class-validator#258 (comment) But this is ofc not a long term solution. |
@joonhocho We can but not now - will do it in vNext as we need multiple packages monorepo with plugin support to make it easy to use. Providing For now you can just mock the unused deps during bundling: |
@19majkel94 Thanks for sharing the mocks workaround. |
Hi @MichalLytek, I hope this finds you well. We have a discussion in For example
The goal is to give a flexibility to developers. |
I agree that having "resolutions": {
"class-validator": "0.12.0-rc.0"
} |
Some time ago I've switched to The only drawback is that you have to install it as a dev dependency ( Closing via ffa419b 🔒 |
Awesome @MichalLytek, now I just need to wait for beta 15 😄 |
I would like to propose that we make
class-validator
a peer dependency this would fix the problem of having multiple versions ofclass-validator
. If you got 2 or more packages that depend on different verisons ofclass-validator
it becomes a nuisance.I have forked the repo, made this change (teoxoy@aa4d83f) and used it in my project like so:
I have basically made
class-validator
a peer dependency and addedvalidateOrRejectFn
as an option tobuildSchema
class-validator
issue regarding multiple package versions: typestack/class-validator#261Let me know what you think!
I can also start a PR for this if it's something you would like to add.
The text was updated successfully, but these errors were encountered: