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

Code Splitting React Intl Locales #1197

Closed
Kennybll opened this issue Dec 14, 2017 · 4 comments
Closed

Code Splitting React Intl Locales #1197

Kennybll opened this issue Dec 14, 2017 · 4 comments
Assignees
Milestone

Comments

@Kennybll
Copy link
Contributor

Kennybll commented Dec 14, 2017

Expected behavior

We should split the react-intl locales to make the bundle smaller. I figure to use webpacks dynamic inport(). This will load it separately. I tried this and it saves around 400k.

Actual behavior

Bundles all translations to the main bundles.

How to reproduce

https://busy.org/js/statistics.html shows translations take up 37.6%.

I started to work on it. I am about to add a pull request. Just thought to add it here first. I am willing to be assigned.

  • Browser:
  • Operating system:
@Kennybll
Copy link
Contributor Author

You can check out my webpack visualizer with example code splitting sizes: https://kennybll.herokuapp.com/js/statistics.html. It may need to reload heroku's server ( I have free service not paid ).

@bonustrack
Copy link
Contributor

https://kennybll.herokuapp.com/js/statistics.html is bigger than thanhttps://staging.busy.org/js/statistics.html for me

@Kennybll
Copy link
Contributor Author

Kennybll commented Dec 14, 2017

vendor and main are smaller though. Also for some reason I count 51 locales in src on the kennybll vs 40 on staging. That could be why it's larger

@Kennybll
Copy link
Contributor Author

Kennybll commented Dec 14, 2017

I found out why... if you look under src/client/translations/index.js you see no one ever added the extra locals from /src/client/locales. @bonustrack We also need to add those to /src/settings/Settings.js

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

No branches or pull requests

3 participants