Skip to content

Commit 82e220e

Browse files
Add x-mixed-mode flag (#9113)
1 parent bb41346 commit 82e220e

12 files changed

Lines changed: 28 additions & 0 deletions

File tree

.changeset/violet-planets-march.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Add `x-mixed-mode` flag
6+
7+
This experimental flag currently has no effect. More details will be shared as we roll out its functionality.

packages/wrangler/src/__tests__/config/configuration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,6 +2401,7 @@ describe("normalizeAndValidateConfig()", () => {
24012401
{
24022402
RESOURCES_PROVISION: true,
24032403
MULTIWORKER: false,
2404+
MIXED_MODE: false,
24042405
},
24052406
() =>
24062407
normalizeAndValidateConfig(
@@ -2556,6 +2557,7 @@ describe("normalizeAndValidateConfig()", () => {
25562557
{
25572558
RESOURCES_PROVISION: true,
25582559
MULTIWORKER: false,
2560+
MIXED_MODE: false,
25592561
},
25602562
() =>
25612563
normalizeAndValidateConfig(
@@ -2885,6 +2887,7 @@ describe("normalizeAndValidateConfig()", () => {
28852887
{
28862888
RESOURCES_PROVISION: true,
28872889
MULTIWORKER: false,
2890+
MIXED_MODE: false,
28882891
},
28892892
() =>
28902893
normalizeAndValidateConfig(

packages/wrangler/src/api/dev.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export async function unstable_dev(
211211
logLevel: options?.logLevel ?? defaultLogLevel,
212212
port: options?.port ?? 0,
213213
experimentalProvision: undefined,
214+
experimentalMixedMode: false,
214215
experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
215216
experimentalImagesLocalMode: imagesLocalMode ?? false,
216217
enableIpc: options?.experimental?.enableIpc,
@@ -223,6 +224,7 @@ export async function unstable_dev(
223224
// TODO: can we make this work?
224225
MULTIWORKER: false,
225226
RESOURCES_PROVISION: false,
227+
MIXED_MODE: false,
226228
},
227229
() => startDev(devOptions)
228230
);

packages/wrangler/src/api/integrations/platform/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export async function getPlatformProxy<
108108
{
109109
MULTIWORKER: false,
110110
RESOURCES_PROVISION: false,
111+
// TODO: when possible mixed mode should be made available for getPlatformProxy
112+
MIXED_MODE: false,
111113
},
112114
() => getMiniflareOptionsFromConfig(rawConfig, env, options)
113115
);

packages/wrangler/src/core/register-yargs-command.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ function createHandler(def: CommandDefinition) {
154154
: {
155155
MULTIWORKER: false,
156156
RESOURCES_PROVISION: args.experimentalProvision ?? false,
157+
MIXED_MODE: args.experimentalMixedMode ?? false,
157158
};
158159

159160
await run(experimentalFlags, () =>

packages/wrangler/src/deploy/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export const deployCommand = createCommand({
211211
overrideExperimentalFlags: (args) => ({
212212
MULTIWORKER: false,
213213
RESOURCES_PROVISION: args.experimentalProvision ?? false,
214+
MIXED_MODE: false,
214215
}),
215216
},
216217
validateArgs(args) {

packages/wrangler/src/dev.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const dev = createCommand({
6060
overrideExperimentalFlags: (args) => ({
6161
MULTIWORKER: Array.isArray(args.config),
6262
RESOURCES_PROVISION: args.experimentalProvision ?? false,
63+
MIXED_MODE: args.experimentalMixedMode ?? false,
6364
}),
6465
},
6566
metadata: {

packages/wrangler/src/experimental-flags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { logger } from "./logger";
44
export type ExperimentalFlags = {
55
MULTIWORKER: boolean;
66
RESOURCES_PROVISION: boolean;
7+
MIXED_MODE: boolean;
78
};
89

910
const flags = new AsyncLocalStorage<ExperimentalFlags>();

packages/wrangler/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@ export function createCLIParser(argv: string[]) {
425425
hidden: true,
426426
alias: ["x-provision"],
427427
})
428+
.option("experimental-mixed-mode", {
429+
describe: `Experimental: Enable Mixed Mode`,
430+
type: "boolean",
431+
hidden: true,
432+
alias: ["x-mixed-mode"],
433+
})
428434
.epilogue(
429435
`Please report any issues to ${chalk.hex("#3B818D")(
430436
"https://github.com/cloudflare/workers-sdk/issues/new/choose"

packages/wrangler/src/pages/dev.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,7 @@ export const pagesDevCommand = createCommand({
882882
{
883883
MULTIWORKER: Array.isArray(args.config),
884884
RESOURCES_PROVISION: false,
885+
MIXED_MODE: false,
885886
},
886887
() =>
887888
startDev({
@@ -947,6 +948,7 @@ export const pagesDevCommand = createCommand({
947948
persistTo: args.persistTo,
948949
logLevel: args.logLevel ?? "log",
949950
experimentalProvision: undefined,
951+
experimentalMixedMode: false,
950952
experimentalVectorizeBindToProd: false,
951953
experimentalImagesLocalMode: false,
952954
enableIpc: true,

0 commit comments

Comments
 (0)