Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: lazy-load languages #2993

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cstenglein
Copy link

@cstenglein cstenglein commented Oct 23, 2024

fixes #1547

Before

before

After

after

Shouldn't have that much impact though since the languages are loaded locally.

@thisconnect
Copy link
Collaborator

Very nice. This cuts the size of the main production JavaScript bundle by half (tested with make buildweb).

Somehow it doesn't initialize the language from the config correctly, but in the settings shows the correct lang.

Screenshot 2024-10-24 at 11 34 50

@thisconnect
Copy link
Collaborator

buildweb with master

master-buildweb

buildweb with this branch

lazy-load-buildweb

@thisconnect
Copy link
Collaborator

webdev is not good to test, in this PR I added vite preview so we can test prodcution build. I tested your branch

looks like this change reduced JS Heap and scripting time

current
profiling-master

with lazy-load branch
profiling-lazyload

@cstenglein
Copy link
Author

Fixed the loading of the language, but not that happy with the implementation with the changing boolean.

@cstenglein
Copy link
Author

Fixed the test and squashed my commits. Should work now.

@thisconnect
Copy link
Collaborator

Thank you so much @cstenglein !

One thing please change the prefix in the commit message from (web): to frontend: so it is consistent with other commits https://github.com/BitBoxSwiss/bitbox-wallet-app/commits/master/ 🙏

@cstenglein cstenglein changed the title (web): lazy-load languages frontend: lazy-load languages Nov 11, 2024
Copy link
Collaborator

@shonsirsha shonsirsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @cstenglein

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore not loading all languages
3 participants