Skip to content
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

Smaller build size #212

Closed
mendrik opened this issue Jun 1, 2018 · 2 comments · Fixed by #568
Closed

Smaller build size #212

mendrik opened this issue Jun 1, 2018 · 2 comments · Fixed by #568
Labels
priority: high type: fix Issues describing a broken feature.

Comments

@mendrik
Copy link

mendrik commented Jun 1, 2018

Hi,

seems like right now everything is imported, would it be possible to make a more fine grained build? I import only a few validators and yet the build contains all default messages and a lot of other stuff I don't need.
Would be nice split the project into smaller packages on a single file basis, especially for browser usage this would be great.

Cheers

@NoNameProvided NoNameProvided added the type: feature Issues related to new features. label Jul 18, 2018
@NoNameProvided NoNameProvided added type: fix Issues describing a broken feature. priority: high and removed type: feature Issues related to new features. labels Nov 4, 2018
@NoNameProvided
Copy link
Member

Hi!

There is an in-progress PR for this at #258. Once it's land, this will be fixed.

vlapo added a commit that referenced this issue Apr 17, 2020
BREAKING CHANGE: 

Validation functions was removed from `Validator` class to enable tree shaking.

BEFORE:

    import {Validator} from "class-validator";

    const validator = new Validator();
    validator.isNotIn(value, possibleValues);
    validator.isBoolean(value);

AFTER:

    import {isNotIn, isBoolean} from "class-validator";

    isNotIn(value, possibleValues);
    isBoolean(value);

Closes #258, #248, #247, #212
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: high type: fix Issues describing a broken feature.
Development

Successfully merging a pull request may close this issue.

2 participants