Repository navigation
feat(cli)!: name the Vercel runtime function b4.func in every build - #717
Merged
Merged
Conversation
blove
enabled auto-merge (squash)
September 17, 2026 23:05
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
temporarily deployed
to
vercel-preview
September 17, 2026 23:05 — with
GitHub Actions
Inactive
The runtime function was named index.func unless build.vercel.static was configured. The Build Output API also serves a function named index at /, where it shadows a static index.html, so the conditional default left the hazard latent: an app that added a frontend later had to rename its function to get one, and anything assembling the published tree by hand had to know which of the two names a given config produced. The hazard is a property of the name, not of what a particular build emits, so the name is now off the root always. functions/b4.func/ replaces functions/index.func/ and config.json routes to /b4. BREAKING CHANGE: the published output path changes for every app using the vercel target. Anything reading .vercel/output/functions/index.func by path follows the new name; build.vercel.functionName: "index" restores the old layout for a build with no static assets. Rejecting "index" beside static stays, since an explicit choice can still shadow the static root. Closes #687 Co-Authored-By: Claude Opus 5 <[email protected]>
#716 landed a paragraph telling readers to switch to b4.func when static is configured. With the name unconditional that reads circularly against the snippet above it, which already uses b4.func. Co-Authored-By: Claude Opus 5 <[email protected]>
blove
force-pushed
the
blove/vercel-function-name-b4
branch
from
September 17, 2026 23:19
8b3fd03 to
08800f8
Compare
blove
temporarily deployed
to
vercel-preview
September 17, 2026 23:19 — with
GitHub Actions
Inactive
4 tasks done
blove
added a commit
that referenced
this pull request
Sep 18, 2026
…tion name (#720) #717 renamed the runtime function to b4.func in every build but left two statements of the old conditional rule in the published config type: the functionName default, and build.vercel describing a bare build as emitting functions/index.func. Co-authored-by: Claude Opus 5 <[email protected]>
This was referenced Sep 18, 2026
blove
added a commit
that referenced
this pull request
Sep 18, 2026
A reader who hits that build failure asks whether it is an oversight. It is not: an explicit index shadows the static root exactly as the old default did, so allowing it would reintroduce #687 in the configuration where it matters most. Rationale from the #717 author. Co-Authored-By: Claude Opus 5 <[email protected]>
blove
added a commit
that referenced
this pull request
Sep 18, 2026
#717 made the b4.func name unconditional and updated six references on this page, but the opening line of "Compose with a frontend" still said a bare build emits "a single function named `index`", contradicting the same section eleven lines later. A reader following it goes looking for functions/index.func in a bare build and does not find it. Not a word swap: the sentence used the name to explain why a bare build is the wrong shape for a SPA, and that reason is gone now that nothing is served at the root. The real reason is what a bare build omits, so the sentence now says that — one function, a catch-all, and no static assets, second function, or routes of your own. Verified against origin/main rather than the changeset: DEFAULT_VERCEL_FUNCTION_NAME is "b4" and the root-shadowing guard moved to its own ROOT_VERCEL_FUNCTION_NAME ("index"), so the neighbouring claim that functionName: "index" plus static fails the build is still accurate and stays. Found by the session working on #687. Co-authored-by: Claude Opus 5 <[email protected]>
blove
added a commit
that referenced
this pull request
Sep 18, 2026
* docs(upgrading): record the vercel function rename to b4.func #717 moved the vercel target's published function from functions/index.func to functions/b4.func and its route from /index to /b4, in every build rather than only when static assets are configured. Its changeset says so, but the Upgrading page carries entries at this weight and had none, so the changeset was the only place a user learned their deploy script needs updating. The entry splits the migration, which is the part a reader gets burned by: an app with no static assets can pin functionName: "index" and keep the old path, but an app configuring build.vercel.static cannot, because the build rejects that combination rather than publishing a tree whose root is shadowed. Gap found by the #679 session; behaviour verified against the shipped resolver on main rather than the PR description. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(upgrading): say why the index escape hatch is refused with static A reader who hits that build failure asks whether it is an oversight. It is not: an explicit index shadows the static root exactly as the old default did, so allowing it would reintroduce #687 in the configuration where it matters most. Rationale from the #717 author. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
This was referenced Sep 18, 2026
This branch was successfully deployed
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 #687.
What changed
The runtime function is named
b4.funcin every build. It wasindex.funcunlessbuild.vercel.staticwas configured.In the Build Output API a function named
indexis also served at/, where it shadows a staticindex.html. The conditional default fixed that only for builds that already shipped static assets, which left the hazard latent in two ways: an app that added a frontend later had to rename its function to get one, and anything assembling the published tree by hand had to know which of the two names a given config produced. The hazard belongs to the name, not to what a particular build emits, so the name is off the root always.DEFAULT_VERCEL_FUNCTION_NAMEisb4;STATIC_VERCEL_FUNCTION_NAMEis gone, replaced byROOT_VERCEL_FUNCTION_NAMEnaming the one value that is refused besidestatic..vercel/output/functions/b4.func/replaces.vercel/output/functions/index.func/, andconfig.jsonroutes/(.*)to/b4.build.vercel.functionName: "index"besidebuild.vercel.staticstill fails the build. An explicit choice can shadow the static root just as the old default did.Breaking
The published output path changes for every app using the
verceltarget. Anything reading.vercel/output/functions/index.funcby path, such as a local smoke script importing the bundle, follows the new name.build.vercel.functionName: "index"restores the old layout for a build with no static assets.No upgrade guide was added, at the repo owner's instruction. The changeset states the path change.
Tests
vercel-compose.test.ts: the bare default is nowb4, asserted for an absent config, an empty config, and a routes-only config, so the name no longer depends on whether anything could be shadowed. The static case asserts it keeps the same default rather than switching to a second one.vercel-target.test.ts: the emitted-tree, publication, out-dir and Build Output contract expectations move tob4.funcand/b4. The test proving the default validator rejects a tree built for another name is rewritten aroundagent.func, since the old fixture usedb4precisely because it was not the default; it now also asserts the same tree validates when the right name is passed.build-targets.test.ts,vercel-native-lane.test.tsand the native fixture's pinned artifact listing move tob4.func.Docs updated where they stated the old name or the conditional rule: the
b4 buildreference, the configuration reference, the edge page including its local-bundle snippet, and the Vercel deployment guide including its artifact table and smoke script.Validation
pnpm build@b4run/clitypecheck and lintnode scripts/check-docs.mjsnode scripts/check-changesets.mjspnpm --dir apps/web seo:lastmod:check(manifest regenerated)@b4run/clisuite: 167 files, 2011 passed, 4 skippedvercel-nativelane not run locally; its pinned listing is updated in this PR and CI covers it.🤖 Generated with Claude Code