Repository navigation
Conversation
Send the page's assets as 103 Early Hints before the response. On Node this uses the response's own writeEarlyHints. On other runtimes, which run on a mock response with no socket, the values are added as Link headers instead. - Entry assets are sent from createPageEvent. - Route scripts are sent from StartServer, where it collects the matched routes' modulepreload assets. - Route stylesheets are sent from lazyRoute's component, which runs on every render. - Nothing is sent once the response headers are out. Off by default, because some proxies and clients mishandle 1xx responses. Production builds only. Closes #1935. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 5c04a87 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
brenelz
approved these changes
Oct 14, 2026
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.
Closes #1935 on the 1.x line. Same feature as #2350 on
main.Adds an opt-in
earlyHintsoption todefineConfig. With it on, SolidStart sends the page's assets as103 Early Hints, so the browser can start downloading them while the server is still rendering.Change
server/early-hints.ts.sendEarlyHints(event, assets)converts the page's<link>assets toLinkvalues: stylesheets asrel=preload; as=style, scripts asrel=modulepreload, with URLs passed throughencodeURI.writeEarlyHints. 1.x requires Node 22, so that is always available.Linkheaders on the response. Those runtimes run on anode-mock-httpresponse whosewriteEarlyHintsdoes nothing, so the check is whether the response has a real socket.writeEarlyHintsisn't used: it writes a rawHTTP/1.1 103straight to the socket and has noLinkheader fallback.createPageEvent.StartServer, where it collects the matched routes'modulepreloadassets.lazyRoute's component, which runs on every render. This is guarded byisServer, so it stays out of the client bundle.experimental.writeEarlyHints, because some proxies and clients mishandle1xxresponses.Testing
Production builds of the 1.x
basicfixture, with a route CSS file added to/about, and a raw Node HTTP client that logs each1xxresponse and the final one:/aboutearlyHints: true, stream mode103entry CSS + 3 entry JS,103about.js,103about.css,200earlyHints: true,mode: "async"103s, then200200onlyserver.preset: "bun"),earlyHints: true103;200with aLinkheader holding all 6 valuesThe hints match the page's own
<link>tags, and the client bundle contains no hint code.early-hints.spec.ts(6 tests): theLinkvalues, including encoding a non-ASCII URL. Also,writeEarlyHintsfor a Node response with a socket,Linkheaders for a response without one, and nothing sent with the option off, outside production, or after the headers are sent.@solidjs/starttest:ci(101 tests),typecheckandbuildpass.apps/testsbuild,unit:ciand the full Cypress suite against the production build (19) pass.🤖 Generated with Claude Code