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
Now `wrangler deploy` provides a better user experience when dealing with a worker that has been modified via the Cloudflare dashboard.
12
12
13
-
Let's explore an example, let's say that you have a worker with the following configuration:
14
-
<WranglerConfig>
13
+
Previously if a Worker would be modified in the [Cloudflare Dashboard](https://dash.cloudflare.com) (by for example updating some of its [setting](https://dash.cloudflare.com/?to=/:account/workers/services/view/:worker/production/settings)) and re-deployed though
14
+
the Dashboard itself, this would cause following `wrangler deploy` invocations to completely override the potential new Dashboard changes (after asking the user for a confirmation).
15
15
16
-
```jsonc title="wrangler.jsonc"
17
-
{
18
-
"name":"my-worker",
19
-
"compatibility_date":"$today",
20
-
"vars": {
21
-
"MY_VARIABLE_X":"A",
22
-
"MY_VARIABLE_Y":"B",
23
-
"MY_VARIABLE_Z":"C",
24
-
},
25
-
}
26
-
```
27
-
</WranglerConfig>
16
+
Now instead `wrangler deploy` will simply proceed with the deployment in case it detects that it is safe to do so (meaning that nothing will unexpectedly overridden in the Cloudflare Dashboard settings).
28
17
29
-
That you deployed via `wrangler deploy`.
18
+
In case there are instead some differences between the local Worker configuration and the Dashboard settings, Wrangler will clearly point those out, then, just like before, will ask for a deployment confirmation and potentially proceed with it.
30
19
31
-
And let's imagine that a coworker or yours of a product manager goes to the [Cloudflare dashboard worker's setting section](https://dash.cloudflare.com/?to=/:account/workers/services/view/:worker/production/settings#variables) and updates `MY_VARIABLE_X` to be `'a'`.
32
-
33
-
Previously running `wrangler deploy` after such Dashboard update would inform you that the worker's configuration has been updated in the dashboard and would allow you to either override the dashboard configuration or abort the operation.
34
-
35
-
No other information nor options would be provided to you.
36
-
37
-
Now in such situation you would instead be presented with a representation of what has been changed, likes so:
38
-
39
-
```diff
40
-
"vars": {
41
-
- "MY_VARIABLE_X": "A",
42
-
+ "MY_VARIABLE_X": "a",
43
-
"MY_VARIABLE_Y": "B",
44
-
"MY_VARIABLE_Z": "C",
45
-
},
46
-
```
47
-
48
-
Allowing you to potentially override the remote settings with more understanding and confidence.
49
-
50
-
If you instead decide not to override the remote settings Wrangler will also offer to update the local configuration for you so that it can be realigned with the remote settings.
51
-
52
-
Additionally, note that this flow won't be applied for safe Wrangler deployments that are only adding settings and not removing or modifying and of the remote ones, streamlining the user's exeprience even more.
20
+
Finally, if the user does not proceed with the deployment, Wrangler will then offer to update their Wrangler configuration file for them (this only supports `wrangler.json(c)` files) allowing them to easily realign with the new Dashboard settings.
0 commit comments