Skip to content

Commit 5244faa

Browse files
Rename serve_directly to experimental_serve_directly (#7429)
1 parent 4f1a46e commit 5244faa

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.changeset/six-coats-rule.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"wrangler": minor
33
---
44

5-
feat: add `serve_directly` option to Workers with Assets
5+
feat: add `experimental_serve_directly` option to Workers with Assets
66

77
Users can now specify whether their assets are served directly against HTTP requests or whether these requests always go to the Worker, which can then respond with asset retrieved by its assets binding.

packages/wrangler/src/__tests__/deploy.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4964,7 +4964,7 @@ addEventListener('fetch', event => {});`
49644964
binding: "ASSETS",
49654965
html_handling: "none",
49664966
not_found_handling: "404-page",
4967-
serve_directly: false,
4967+
experimental_serve_directly: false,
49684968
},
49694969
});
49704970
await mockAUSRequest();
@@ -5038,7 +5038,7 @@ addEventListener('fetch', event => {});`
50385038
binding: "ASSETS",
50395039
html_handling: "none",
50405040
not_found_handling: "404-page",
5041-
serve_directly: true,
5041+
experimental_serve_directly: true,
50425042
},
50435043
});
50445044
await mockAUSRequest();

packages/wrangler/src/assets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export function processAssetsArg(
347347
const assetConfig = {
348348
html_handling: config.assets?.html_handling,
349349
not_found_handling: config.assets?.not_found_handling,
350-
serve_directly: config.assets?.serve_directly,
350+
serve_directly: config.assets?.experimental_serve_directly,
351351
};
352352

353353
return {

packages/wrangler/src/config/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ export type Assets = {
948948
| "drop-trailing-slash"
949949
| "none";
950950
not_found_handling?: "single-page-application" | "404-page" | "none";
951-
serve_directly?: boolean;
951+
experimental_serve_directly?: boolean;
952952
};
953953

954954
export interface Observability {

packages/wrangler/src/config/validation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,8 +2176,8 @@ const validateAssetsConfig: ValidatorFn = (diagnostics, field, value) => {
21762176
validateOptionalProperty(
21772177
diagnostics,
21782178
field,
2179-
"serve_directly",
2180-
(value as Assets).serve_directly,
2179+
"experimental_serve_directly",
2180+
(value as Assets).experimental_serve_directly,
21812181
"boolean"
21822182
) && isValid;
21832183

@@ -2187,7 +2187,7 @@ const validateAssetsConfig: ValidatorFn = (diagnostics, field, value) => {
21872187
"binding",
21882188
"html_handling",
21892189
"not_found_handling",
2190-
"serve_directly",
2190+
"experimental_serve_directly",
21912191
]) && isValid;
21922192

21932193
return isValid;

0 commit comments

Comments
 (0)