Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move SERVER_URL to a nextjs runtime config. #498

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

julionav
Copy link

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.

This allows to read the configure SERVER_URL at
runtime from the server instead of only at build time, allowing to change it without building the
frontend image.
Copy link

changeset-bot bot commented Sep 20, 2024

⚠️ No Changeset found

Latest commit: a14d788

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MikeShi42
Copy link
Contributor

This is great - you're right we don't really leverage any of those features (and as you point out there's no reason we'll consider them any time soon). The only issue might be standalone builds where (understandably) this does not work. We actually do build a standalone for the local mode docker container - but that's a different build path and has its own solution so that's okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants