Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/workers-utils/src/config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export const bindingTypeFriendlyNames: Record<Binding["type"], string> = {
vpc_service: "VPC Service",
media: "Media",
assets: "Assets",
inherit: "Inherited",
} as const;

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/workers-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,5 @@ export type Binding =
| ({ type: "vpc_service" } & BindingOmit<CfVpcService>)
| ({ type: "media" } & BindingOmit<CfMediaBinding>)
| ({ type: `unsafe_${string}` } & Omit<CfUnsafeBinding, "name" | "type">)
| { type: "assets" };
| { type: "assets" }
| { type: "inherit" };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binding is a public facing API, so wouldn't this change require a changeset?

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
PreviewTokenExpiredEvent,
StartDevWorkerOptions,
} from "../../../api";
import type { StartDevWorkerInput } from "../../../api/startDevWorker/types";
import type { CfWorkerInit } from "@cloudflare/workers-utils";

// Mock the API modules
Expand Down Expand Up @@ -147,7 +148,7 @@ describe("RemoteRuntimeController", () => {
content: "export default { fetch() { return new Response('hello'); } }",
},
modules: [],
bindings: {} as CfWorkerInit["bindings"],
bindings: {} as StartDevWorkerInput["bindings"],
migrations: undefined,
compatibility_date: "2025-11-11",
compatibility_flags: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { realishPrintLogs } from "../../tail/printing";
import { getAccessToken } from "../../user/access";
import { RuntimeController } from "./BaseController";
import { castErrorCause } from "./events";
import { convertBindingsToCfWorkerInitBindings, unwrapHook } from "./utils";
import { unwrapHook } from "./utils";
import type {
CfAccount,
CfPreviewSession,
Expand Down Expand Up @@ -257,10 +257,6 @@ export class RemoteRuntimeController extends RuntimeController {
routes: Route[] | undefined,
bundleId: number
) {
const { bindings } = await convertBindingsToCfWorkerInitBindings(
config.bindings
);

// If we received a new `bundleComplete` event before we were able to
// dispatch a `reloadComplete` for this bundle, ignore this bundle.
if (bundleId !== this.#currentBundleId) {
Expand All @@ -286,8 +282,7 @@ export class RemoteRuntimeController extends RuntimeController {
}
: undefined,
format: bundle.entry.format,
// TODO: Remove this passthrough
bindings: bindings,
bindings: config.bindings,
compatibilityDate: config.compatibilityDate,
compatibilityFlags: config.compatibilityFlags,
routes,
Expand Down
Loading
Loading