MichalLytek / MichalLytek/class-transformer-validator

Support tree shaking (google-libphonenumber is huge)

Open
#30 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement
Dominant language
TypeScript
Stars
205
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Using `class-transformer-validator` results in `google-libphonenumber` being included in the webpack bundle (even though tree shaking is enabled and no phone number validators are being used).

This was fixed in `class-validator` itself, see:

- typestack/class-validator#258
- typestack/class-validator#248

I'm wondering if there is an "easy" fix for this package?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the referenced class-validator fixes in typestack/class-validator#258 and #248, then inspect how this package is included in a webpack bundle. Done means webpack tree shaking excludes google-libphonenumber when no phone-number validators are used.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.