docs: explain runtime environment App Shells - #97126
Draft
DavidIlie wants to merge 1 commit into
Draft
Conversation
Contributor
Stats skippedCommit: cdd8654 |
Contributor
Tests PassedCommit: cdd8654 |
DavidIlie
force-pushed
the
codex/runtime-env-app-shell-docs
branch
from
August 10, 2026 17:48
96fbcc6 to
cdd8654
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What?
Document how server runtime environment variables interact with Cache Components and Partial Prefetching.
The guide now shows how to place
io()before an environment-dependent branch, when to useconnection()instead, what runtime prefetches contain, and why a streamednotFound()remains200withnoindex. The self-hosting and Partial Prefetching pages cross-link the guidance.Why?
Reading
process.envis not itself a Request-time API. A synchronous branch can run duringnext build, so conditional UI,notFound(), orredirect()can become part of the App Shell. Starting the same Docker image with a different value does not regenerate that prerendered result.This can be especially confusing when metadata is dynamic but the page component is not: a navigation may receive runtime metadata while the body still comes from a build-time error shell.
How?
io()for synchronous uncached runtime I/O andconnection()when evaluation must wait for an actual navigation.[status: 404]build annotation as an informational diagnostic.This PR is stacked on #97125, which adds the build-output diagnostic it documents.
Verification
git diff --check