Move SERVER_URL to a nextjs runtime config. #498
+7
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently, Changing the SERVER_URL requires to rebuild the frontend app image, and push it to a container registry.
This isn't usually a problem for a client application, but for one that some folks are self hosting it can cause problems and confusion at the moment of setup
Solution
Move the config value to a runtime config value. This feature is technically deprecated by nextjs in favor of using their "new" App Router system, but hyperdx isn't using it and it will require a good amount of work to migrate it.
The main issue for this feature seems to be that Automatic Static Optimization, Output File Tracing, or React Server Components don't work with this, which may be a problem. Although I don't see hyperdx needing those features. This is an app that is behind a login, where the bottleneck isn't "rendering" but the query speed to clickhouse.