Restructured data.js to data_{lang}.js and data_{lang}_{slug}.js for better memory management#258
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #258 +/- ##
========================================
- Coverage 4.86% 4.77% -0.10%
========================================
Files 8 8
Lines 1130 1153 +23
Branches 248 255 +7
========================================
Hits 55 55
- Misses 1074 1097 +23
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
benoit74
approved these changes
Dec 22, 2025
benoit74
left a comment
Collaborator
There was a problem hiding this comment.
Thank you, looks very promising.
I did not tested it, but looking at the code it seems to be doing what we expected it to do. Will merge and test on a real Zimfarm recipe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
data.js takes up too much space, and hence too much time to load, not a scalable design. restructuring it to data_{lang}.js and data_{lang}_{slug}.js helps in lesser memory loading, as smaller chunks of data are loaded at a time.
Fixes #257
Changes
Major Change:
generate_datafilenow uses two helper functions to generate two separate file:?langquery parameters optional rather than required.locally tested with offliner definition:
See screenshots for reference: