phetsims / rosetta

PhET's Simulation Translation Utility
MIT License
3 stars 1 forks source link

Move constants out of config and into the `constants.js` module #398

Closed liammulh closed 1 year ago

liammulh commented 1 year ago

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:

Of the remaining config values, the following value should be moved into the constants.js module: