You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: remove experimental_services from configuration (#445)
Now that we have `[[unsafe.bindings]]` (as of #411), we should use that for experimental features. This removes support for `[experimental_services]`, and adds a helpful message for how to rewrite their configuration.
This error is temporary, until the internal teams that were using this rewrite their configs. We'll remove it before GA.
What the error looks like -
```
Error: The "experimental_services" field is no longer supported. Instead, use [[unsafe.bindings]] to enable experimental features. Add this to your wrangler.toml:
[[unsafe.bindings]]
name = "SomeService"
type = "service"
service = "some-service"
environment = "staging"
[[unsafe.bindings]]
name = "SomeOtherService"
type = "service"
service = "some-other-service"
environment = "qa"
```
chore: remove `experimental_services` from configuration
6
+
7
+
Now that we have `[[unsafe.bindings]]` (as of https://github.com/cloudflare/wrangler2/pull/411), we should use that for experimental features. This removes support for `[experimental_services]`, and adds a helpful message for how to rewrite their configuration.
8
+
9
+
This error is temporary, until the internal teams that were using this rewrite their configs. We'll remove it before GA.
10
+
11
+
What the error looks like -
12
+
13
+
```
14
+
Error: The "experimental_services" field is no longer supported. Instead, use [[unsafe.bindings]] to enable experimental features. Add this to your wrangler.toml:
Copy file name to clipboardExpand all lines: packages/wrangler/src/config.ts
+2-27
Original file line number
Diff line number
Diff line change
@@ -209,6 +209,7 @@ export type Config = {
209
209
*
210
210
* @default `[]`
211
211
* @optional
212
+
* @deprecated DO NOT USE. We'd added this to test the new service binding system, but the proper way to test experimental features is to use `unsafe.bindings` configuration.
212
213
* @inherited false
213
214
*/
214
215
experimental_services?: {
@@ -569,7 +570,7 @@ export function normaliseAndValidateEnvironmentsConfig(config: Config) {
569
570
}
570
571
571
572
// Warn if there is a "required" field in the top level config that has not been specified specified in the environment.
572
-
// These required fields are `vars`, `durable_objects`, `kv_namespaces` and `experimental_services`.
573
+
// These required fields are `vars`, `durable_objects`, and `kv_namespaces`.
573
574
// Each of them has different characteristics that need to be checked.
574
575
575
576
// `vars` is just an object
@@ -644,31 +645,5 @@ export function normaliseAndValidateEnvironmentsConfig(config: Config) {
644
645
}
645
646
}
646
647
}
647
-
648
-
// `experimental_services` contains an array of namespace bindings
Copy file name to clipboardExpand all lines: packages/wrangler/src/index.tsx
+18-9
Original file line number
Diff line number
Diff line change
@@ -72,9 +72,25 @@ async function readConfig(configPath?: string): Promise<Config> {
72
72
73
73
normaliseAndValidateEnvironmentsConfig(config);
74
74
75
+
// The field "experimental_services" doesn't exist anymore
76
+
// in the config, but we still want to error about any older usage.
77
+
// TODO: remove this error before GA.
75
78
if("experimental_services"inconfig){
76
-
console.warn(
77
-
"The experimental_services field is only for cloudflare internal usage right now, and is subject to change. Please do not use this on production projects"
79
+
thrownewError(
80
+
`The "experimental_services" field is no longer supported. Instead, use [[unsafe.bindings]] to enable experimental features. Add this to your wrangler.toml:
0 commit comments