Skip to content

Commit 0777e3b

Browse files
remove unnecessary new remoteBindings option from startWorker
1 parent 7b9a624 commit 0777e3b

File tree

7 files changed

+11
-26
lines changed

7 files changed

+11
-26
lines changed

.changeset/tangy-steaks-boil.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/wrangler/e2e/remote-binding/start-worker-remote-bindings.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe.skipIf(!CLOUDFLARE_ACCOUNT_ID)("startWorker - remote bindings", () => {
125125
});
126126
});
127127

128-
it("doesn't connect to remote bindings when `remoteBindings` is set to `false`", async () => {
128+
it("doesn't connect to remote bindings when `remote` is set to `false`", async () => {
129129
const helper = new WranglerE2ETestHelper();
130130
await helper.seed(resolve(__dirname, "./workers"));
131131
await helper.seed({
@@ -146,7 +146,7 @@ it("doesn't connect to remote bindings when `remoteBindings` is set to `false`",
146146
dev: {
147147
inspector: false,
148148
server: { port: 0 },
149-
remoteBindings: false,
149+
remote: false,
150150
},
151151
});
152152

packages/wrangler/src/api/startDevWorker/ConfigController.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ async function resolveDevConfig(
126126
return {
127127
auth,
128128
remote: input.dev?.remote,
129-
remoteBindings: input.dev?.remoteBindings ?? true,
130129
server: {
131130
hostname: input.dev?.server?.hostname || config.dev.ip,
132131
port:
@@ -219,7 +218,7 @@ async function resolveBindings(
219218
{
220219
registry,
221220
local: !input.dev?.remote,
222-
remoteBindingsDisabled: input.dev?.remoteBindings === false,
221+
remoteBindingsDisabled: input.dev?.remote === false,
223222
name: config.name,
224223
}
225224
);

packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,7 @@ export class LocalRuntimeController extends RuntimeController {
201201
try {
202202
const configBundle = await convertToConfigBundle(data);
203203

204-
if (
205-
data.config.dev.remoteBindings !== false &&
206-
data.config.dev?.remote !== false
207-
) {
204+
if (data.config.dev?.remote !== false) {
208205
// note: remote bindings use (transitively) LocalRuntimeController, so we need to import
209206
// from the module lazily in order to avoid circular dependency issues
210207
const { maybeStartOrUpdateRemoteProxySession, pickRemoteBindings } =

packages/wrangler/src/api/startDevWorker/MultiworkerRuntimeController.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ export class MultiworkerRuntimeController extends LocalRuntimeController {
112112
try {
113113
const configBundle = await convertToConfigBundle(data);
114114

115-
if (
116-
data.config.dev.remoteBindings !== false &&
117-
data.config.dev?.remote !== false
118-
) {
115+
if (data.config.dev?.remote !== false) {
119116
// note: remote bindings use (transitively) LocalRuntimeController, so we need to import
120117
// from the module lazily in order to avoid circular dependency issues
121118
const { maybeStartOrUpdateRemoteProxySession } = await import(

packages/wrangler/src/api/startDevWorker/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ export interface StartDevWorkerInput {
166166
* - undefined (default): Run your Worker's code locally, and any configured remote bindings remotely
167167
*/
168168
remote?: boolean | "minimal";
169-
/** Whether remote bindings should be enabled */
170-
remoteBindings?: boolean;
171169
/** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
172170
auth?: AsyncHook<CfAccount, [Pick<Config, "account_id">]>; // provide config.account_id as a hook param
173171
/** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */

packages/wrangler/src/dev/start-dev.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,12 @@ async function setupDevEnv(
247247
},
248248
dev: {
249249
auth,
250-
remote:
251-
args.remote || (args.forceLocal || args.local ? false : undefined),
252-
remoteBindings:
253-
// Note: this ternary is a hack, just to make sure that `wrangler pages dev`
254-
// supports the AI binding (removing such support now would be a breaking change)
255-
// TODO: remove this hack in wrangler v5 (the following line should just be `args.local !== true,`)
256-
args.enablePagesAssetsServiceBinding ? true : args.local !== true,
250+
remote: args.enablePagesAssetsServiceBinding
251+
? // When running `wrangler pages dev` we want `remote` to be `undefined` since that's the
252+
// only supported mode for pages (note: we can't set it to `false` as that would break
253+
// the AI binding)
254+
undefined
255+
: args.remote || (args.forceLocal || args.local ? false : undefined),
257256
server: {
258257
hostname: args.ip,
259258
port: args.port,

0 commit comments

Comments
 (0)