faker icon indicating copy to clipboard operation
faker copied to clipboard

<?>: split download size in half

Open Shinigami92 opened this issue 3 years 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

Closing these experiments for now

Shinigami92 avatar Jan 29 '23 14:01 Shinigami92

@Shinigami92 Do you still need the branch? If not, please delete it.

Commit-ID: 4203c3d8dfea49f7bb414a7e2ed68d9681aac71d

ST-DDT avatar Jan 30 '23 00:01 ST-DDT

Yes, please do not delete them right now so we have a copy and look into it if needed I just wanted to clean the PR section as we would need to rewrite them anyway as they got to stale

Shinigami92 avatar Jan 30 '23 07:01 Shinigami92