Repository navigation
Conversation
- Add `buildId` to `configureServerFunctionsClient` and `configureServerFunctionsServer`. - The client sends `X-Server-Function-Build` on every call that is not GET-encoded. - A server with a different id answers 409 with its own id and does not run the function. - The client rejects with `versionSkew: true`, so an integration can reload the page. - GET-encoded reads stay header-free, so caches and preloads still match them by url. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9b331dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
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 |
Merging this PR will degrade performance by 6.39%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Generated by Claude Code |
The unknown-id 404 (#3110) catches a function that a deploy removed or renamed. It cannot catch one whose id survived the deploy but whose arguments or result changed shape, because ids hash the file path and the name, not the body. This adds an opt-in build id check for that case. It is the core version of solidjs/solid-start#2363.
Changes
BUILD_HEADER(X-Server-Function-Build) to the shared layer. Both entries re-export it.buildIdto the client config. The transport sends it on every call that is not GET-encoded. GET-encoded reads stay header-free (The server functions implementation adds aX-Server-Function-Instanceheader, making it impossible to preload them reliably across browsers with<link>tags #3406), so caches and preloads still match them by url.buildIdto the server config. A call whose header names another build gets409, with the server's id under the same header andCache-Control: no-store. The arguments are not parsed and the function does not run.buildId. A server with nobuildIdchecks nothing.versionSkew: trueand a message naming version skew. LikeunknownFunction, the recovery is left to the integration, which typically reloads the document.10-server-functions.md.Testing
test/server/server-functions-build-id.spec.tsx(8 tests) runs against the built bundles. It covers the refusal, a matching build, a call without the header, a server without an id, the client error flag, a GET read staying header-free, and a client without an id.server-functions-version-skew.spec.tsxstill passes.pnpm test-typespasses.link-claim.spec.tsxandlowercase-on-attribute.spec.tsx. These fail the same way onnextwithout this change in my local setup, which has a stale compiler build. The DOM suite has the same kind of unrelated failures.🤖 Generated with Claude Code