Closed oleksii-leonov closed 1 year ago
This is great. Thank you! I did just a few synthetic tests with no more than a hundred translations and it's okay, but your real use case caught the performance introduced by glob (i'm pretty sure there's an opportunity for optimization there).
@oleksii-leonov just pushed to your repo with some changes related to uncovered code (just to make sure those mergers were working as expected).
PR Checklist
### PR Structure - [x] This PR has reasonably narrow scope (if not, break it down into smaller PRs). - [x] This PR avoids mixing refactoring changes with feature changes (split into two PRs otherwise). - [x] This PR's title starts is concise and descriptive. ### Thoroughness - [x] This PR adds tests for the most critical parts of the new functionality or fixes. - [x] I've updated any docs, `.md` files, etc… affected by this change.What
Speed up the fallback translations plugin.
deep_merge
code extracted fromi18n-js
v3.Why
Current versions with
Glob
became too slow on large localization files. For our use case (20 locales, 20000 keys each), I wait ~20 minutes and kill the process.deep_merge
versions fromv3
works instantly. So, I have extracted thedeep_merge
fromv3
intov4
.Known limitations
N/A