- The default behaviour is as it works right now, with no environments
- The number and names of environments are flexible and defined by the user. They can be configured in the nextjs.conf file
- If defined, the client bundle(s)/asset(s) can refer to the environment name/label to lookup the appropriate config value. The bundle doesn't contain the environment value hardcoded but a reference to an external asset that is prefixed with the environment.
- All of this is transparent to the user
This has to do with the server-only feature flags/kill switches. We read the feature flags once at startup, but then we want the daemon to read the file continuously checking for changes. The value can be passed to client bundle via props (or something better?)
The values are shared on the server-side only.
Could we use the newest Node 18 feature?
So we can easily perform an action at the very beginning/end of all/some requests. With our monitoring work, we needed to collect information during the entire request lifecycle, by storing them in a temporary state which is unique per request, isolated, and is destroyed at the end. This should be treated with care because multiple requests may create an increase in memory, which is why the idea of doing this is for small informations. It may even have a cap in size which could be configurable globally.
How can values be set once at startup and being shared globally across the entire app?