faker icon indicating copy to clipboard operation
faker copied to clipboard

<?>: split download size in half

Open Shinigami92 opened this issue 1 year ago • 2 comments

EXPERIMENTAL

What is this?:

  1. All TS files in src/locales were converted into .json files
  2. These are then bundled together as src/locales/<locale>.json file to require/import them (for at-dev time)
  3. They are copied into dist/locales/<locale>.json and are required/imported by cjs and esm from same source (for at-bundled time)

Open TODOs:

  • fix tests
  • manage generated docs
  • fix bugs (specially locale ar and ur)

Later?

  • write a locale validator
  • write a locale analyser to get how many % is missing for a locale

To review this PR, I tried as best as I could to separate all commits

Shinigami92 avatar Aug 19 '22 09:08 Shinigami92

Just out of the interest: what's the benefit of having locales as json vs ts?

pkuczynski avatar Aug 20 '22 21:08 pkuczynski

Just out of the interest: what's the benefit of having locales as json vs ts?

Most important one: splitting the package size into HALF!

Second important one: having simpler files to manage like reducing all the boiler plate around the real content and making it somewhat simpler for a contributor to contribute

Shinigami92 avatar Aug 20 '22 22:08 Shinigami92