From 60b95723a0a0d6d2704353d9241e2d6ab668b8c4 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 29 Apr 2024 19:36:02 +0300 Subject: [PATCH] add new batch value to prepare lazy loading faeture of lix --- inlang/source-code/plugins/i18next/src/plugin.ts | 4 ++-- lix/packages/.gitignore | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inlang/source-code/plugins/i18next/src/plugin.ts b/inlang/source-code/plugins/i18next/src/plugin.ts index 6b89c7f9b5..d509f8cfcf 100644 --- a/inlang/source-code/plugins/i18next/src/plugin.ts +++ b/inlang/source-code/plugins/i18next/src/plugin.ts @@ -66,8 +66,8 @@ async function loadMessages(args: { args.settings.sourceLanguageTag ) - // split languageTags into batches, based on experiements < 20 is slow for too many iterations and > 50 is slow for too many parallel file handlings so it seems like a good default. - const batchSize = 30 + // split languageTags into batches, based on experiements < 20 is slow for too many iterations and > 50 is slow for too many parallel file handlings so it seems like a good default. For lazy loading to work we need to try to be as big as possible here, so we use the upper limit + const batchSize = 50 const languageTagBatches: LanguageTag[][] = [] for (let i = 0; i < languageTags.length; i += batchSize) { languageTagBatches.push(languageTags.slice(i, i + batchSize)) diff --git a/lix/packages/.gitignore b/lix/packages/.gitignore index eeeb7be52f..9c5ea03e86 100644 --- a/lix/packages/.gitignore +++ b/lix/packages/.gitignore @@ -1 +1,2 @@ -pnpm-lock.yaml \ No newline at end of file +pnpm-lock.yaml +gitea \ No newline at end of file