Skip to content

Commit

Permalink
Rename serve_directly to experimental_serve_directly (#7429)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillTaylorDev authored Dec 3, 2024
1 parent 4f1a46e commit 5244faa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .changeset/six-coats-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"wrangler": minor
---

feat: add `serve_directly` option to Workers with Assets
feat: add `experimental_serve_directly` option to Workers with Assets

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.
4 changes: 2 additions & 2 deletions packages/wrangler/src/__tests__/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4964,7 +4964,7 @@ addEventListener('fetch', event => {});`
binding: "ASSETS",
html_handling: "none",
not_found_handling: "404-page",
serve_directly: false,
experimental_serve_directly: false,
},
});
await mockAUSRequest();
Expand Down Expand Up @@ -5038,7 +5038,7 @@ addEventListener('fetch', event => {});`
binding: "ASSETS",
html_handling: "none",
not_found_handling: "404-page",
serve_directly: true,
experimental_serve_directly: true,
},
});
await mockAUSRequest();
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export function processAssetsArg(
const assetConfig = {
html_handling: config.assets?.html_handling,
not_found_handling: config.assets?.not_found_handling,
serve_directly: config.assets?.serve_directly,
serve_directly: config.assets?.experimental_serve_directly,
};

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/config/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ export type Assets = {
| "drop-trailing-slash"
| "none";
not_found_handling?: "single-page-application" | "404-page" | "none";
serve_directly?: boolean;
experimental_serve_directly?: boolean;
};

export interface Observability {
Expand Down
6 changes: 3 additions & 3 deletions packages/wrangler/src/config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2176,8 +2176,8 @@ const validateAssetsConfig: ValidatorFn = (diagnostics, field, value) => {
validateOptionalProperty(
diagnostics,
field,
"serve_directly",
(value as Assets).serve_directly,
"experimental_serve_directly",
(value as Assets).experimental_serve_directly,
"boolean"
) && isValid;

Expand All @@ -2187,7 +2187,7 @@ const validateAssetsConfig: ValidatorFn = (diagnostics, field, value) => {
"binding",
"html_handling",
"not_found_handling",
"serve_directly",
"experimental_serve_directly",
]) && isValid;

return isValid;
Expand Down

0 comments on commit 5244faa

Please sign in to comment.