There are values in the config that aren't really config parameters. They are constants, and they should be moved into the constants.js module.
Background on config
There are a few config values that the frontend needs right away (e.g. website user data), which is why we decided to take a subset of the config values and write them to the publicConfig.js module in the src/common directory. That way the frontend can import the values from the publicConfig.js file right away as opposed to having to wait for Node to read the values from disk at startup and then requesting those values via an HTTP request to the API. Thus, there are two config modules: (1) the publicConfig.js module, which is essentially a build artifact containing a subset of the real config, and (2) the privateConfig.js module, which reads the real config from disk.
Constants that need to be moved
Of the values that get written to the publicConfig.js module, these should be moved to the constants.js module:
singleBraceRegex
doubleBraceRegex
translationApiRoute
Of the remaining config values, the following value should be moved into the constants.js module:
There are values in the config that aren't really config parameters. They are constants, and they should be moved into the
constants.js
module.Background on config
There are a few config values that the frontend needs right away (e.g. website user data), which is why we decided to take a subset of the config values and write them to the
publicConfig.js
module in thesrc/common
directory. That way the frontend can import the values from thepublicConfig.js
file right away as opposed to having to wait for Node to read the values from disk at startup and then requesting those values via an HTTP request to the API. Thus, there are two config modules: (1) thepublicConfig.js
module, which is essentially a build artifact containing a subset of the real config, and (2) theprivateConfig.js
module, which reads the real config from disk.Constants that need to be moved
Of the values that get written to the
publicConfig.js
module, these should be moved to theconstants.js
module:singleBraceRegex
doubleBraceRegex
translationApiRoute
Of the remaining config values, the following value should be moved into the
constants.js
module:STRING_KEYS_WITH_REPO_NAME_IN_HTML_VAR