Add env. variable to customize default RPC endpoint
Problem
Per #529, it is now not possible to dynamically override constants when building bee-dashboard and forces packagers to apply a diff to src/constants.ts.
Solution
Add previously removed support for environment variables (REACT_APP) as alternative defaults for constants to streamline the build process for packagers.
So we can't use REACT_APP env. variables directly in the component, because it as dependency it might not be used in context where the CRA's env. replacement is available (and actually is not - in the Swarm Extension, the main reason why we did the refactor).
The solution was to move them into the Dashboard component's props and then reintroduce them for the local build in the index.ts file. During the refactor though I have decided to scope them down only to those that I thought are really needed to be customizable and in case there would be more needed then add them later on.
So can you please tell me what RAECT_APP_* env. variables you use and need to be able to customize?
Specifically I'm using:
REACT_APP_BEE_HOSTREACT_APP_BEE_DEBUG_HOST- An environment variable to specify a custom default RPC endpoint for Gnosis Chain / Goerli as the case may vary (so, nominally something like
REACT_APP_RPC_ENDPOINT).
I see, so for the first two, there are still supported env. variables REACT_APP_BEE_API_URL and REACT_APP_BEE_DEBUG_API_URL that should fit your use-case, but indeed there is no way to set the default RPC endpoint. We can fix that 😉
There is the REACT_APP_DEFAULT_RPC_URL which allows you to override this setting, so closing this ;-)