Skip to content

Commit cc47b51

Browse files
authored
Wrangler preview urls default to disabled (#10478)
* feat: extract subdomain deploy into its own function Should make the logic easier to understand. * fix: config preview_urls defaults to undefined (falsy) instead of true We want preview_urls to be opt-in, rather than opt-out. For this reason its default value will be falsy. * test: fix Wrangler tests with routes Some of the previous commits that changed defaulting uncovered that most Wrangler Wrangler tests that had at least one route, were not mocking the appropriate calls to zones and routes endpoints. * feat: add Cloudflare-Workers-Script-Api-Date header Wrangler differs from the Dash and other clients in that it makes a lot decisions for the user regarding the status of the Worker subdomain. The header should help with existing and future breaking changes between Wrangler and the API. * fix: add warning when subdomain status does not match Wrangler config Warn the user when the workers.dev or preview URLs status does not match their Wrangler config file.
1 parent 4c80c78 commit cc47b51

16 files changed

+695
-257
lines changed

.changeset/ready-banks-repair.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Beta feature preview_urls is now disabled by default.
6+
7+
This change makes preview_urls disabled by default when it's not provided, making
8+
the feature opt-in instead of opt-out.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe("normalizeAndValidateConfig()", () => {
130130
wasm_modules: undefined,
131131
data_blobs: undefined,
132132
workers_dev: undefined,
133-
preview_urls: true,
133+
preview_urls: undefined,
134134
zone_id: undefined,
135135
no_bundle: undefined,
136136
minify: undefined,

0 commit comments

Comments
 (0)