ethereum / ethereum-org-website

Ethereum.org is a primary online resource for the Ethereum community.
https://ethereum.org/
MIT License
5.12k stars 4.85k forks source link

Speed up local development #4885

Closed samajammin closed 1 year ago

samajammin commented 2 years ago

Is your feature request related to a problem? Please describe.

Currently this app takes quite a bit of time to start a local development server via yarn start. It'd be a big productivity boost for our team & contributors if we can reduce this boot up time.

Describe the solution you'd like

One potential approach we discussed is to have a flag for which/how many languages we support during local development.

Why? We suspect a big time & resource (memory) drain on running the app is the internationalization support. Running the app required building all pages in all languages (~40 total).

Given that the majority of the time we only need to test the English content portion of the application, we could save time & compute resources by removing a bunch of the languages for local development.

Perhaps we could add a flag to the start command where by default, for local development, we only support e.g. 3 languages in the app vs. all of them. Could we inspect that flag (or an ENV variable), then pass in a different array to the intl plugin? https://github.com/ethereum/ethereum-org-website/blob/dev/gatsby-config.js#L28

Describe alternatives you've considered

None but welcome other ideas on how we could speed this up & reduce the memory requirements of running the app!

Want to contribute?

We love contributions from the Ethereum community! Please comment on an issue if you're interested in helping out with a PR.

ShubhankarKG commented 2 years ago

We can use an ENV variable to keep track of what languages we want. What we can do is

  1. Convert the translations file to export a Javascript object, that way we can add and remove keys as desired.
  2. Assuming we name the ENV variable as INTL_SUPPORT, perhaps we can make it in this way:
    • If NODE_ENV === development && !!INTL_SUPPORT, load only English versions
    • else load the languages mentioned in INTL_SUPPORT.

That way, the format for INTL_SUPPORT would be en,fr,es and so on.

Any thoughts on this outlook ?

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 45 days with no activity.

corwintines commented 1 year ago

It think much of this work has been done by @pettinarip to let dev specify which languages to build. Going to close this out as done :)