Patch Changes
-
#1725
eb75413e
Thanks @threepointone! - rename:worker_namespaces
/dispatch_namespaces
The Worker-for-Platforms team would like to rename this field to more closely match what it's called internally. This fix does a search+replace on this term. This feature already had an experimental warning, and no one's using it at the moment, so we're not going to add a warning/backward compat for existing customers.
-
#1736
800f8553
Thanks @threepointone! - fix: do not delete previously defined plain_text/json bindings on publishCurrently, when we publish a worker, we delete an pre-existing bindings if they're not otherwise defined in
wrangler.toml
, and overwrite existing ones. But folks may be deploying with wrangler, and changing environment variables on the fly (like marketing messages, etc). It's annoying when deploying via wrangler blows away those values.This patch fixes one of those issues. It will not delete any older bindings that are not in wrangler.toml. It still does overwrite existing vars, but at least this gives a way for developers to have some vars that are not blown away on every publish.
-
#1726
0b83504c
Thanks @GregBrimble! - fix: Multiworker and static asset dev bug preventing both from being usedThere was previously a collision on the generated filenames which resulted in the generated scripts looping and crashing in Miniflare with error code 7. By renaming one of the generated files, this is avoided.
-
#1718
02f1fe9b
Thanks @threepointone! - fix: useconfig.dev.ip
when providedBecause we'd used a default for 0.0.0.0 for the
--ip
flag,wrangler dev
was overriding the value specified inwrangler.toml
underdev.ip
. This fix removes the default value (since it's being set when normalising config anyway).Fixes #1714
-
#1727
3f9e8f63
Thanks @rozenmd! - fix: refresh token when we detect that the preview session has expired (error code 10049)When running
wrangler dev
, from time to time the preview session token would expire, and the dev server would need to be manually restarted. This fixes this, by refreshing the token when it expires.Closes #1446
-
#1730
27ad80ee
Thanks @threepointone! - feat:--var name:value
and--define name:value
This enables passing values for
[vars]
and[define]
via the cli. We have a number of usecases where the values to be injected during dev/publish aren't available statically (eg: a version string, some identifier for 3p libraries, etc) and reading those values only fromwrangler.toml
isn't good ergonomically. So we can now read those values when passed through the CLI.Example: add a var during dev:
wrangler dev --var xyz:123
will inject the varxyz
with string"123"
(note, only strings allowed for
--var
)substitute a global value:
wrangler dev --define XYZ:123
will replace every global identifierXYZ
with the value123
.The same flags also work with
wrangler publish
.Also, you can use actual environment vars in these commands. e.g.:
wrangler dev --var xyz:$XYZ
will setxyz
to whateverXYZ
has been set to in the terminal environment. -
#1700
d7c23e49
Thanks @penalosa! - Closes #1505 by extendingwrangler tail
to allow for passing worker routes as well as worker script names.For example, if you have a worker
example-worker
assigned to the routeexample.com/*
, you can retrieve it's logs by running eitherwrangler tail example.com/*
orwrangler tail example-worker
—previously onlywrangler tail example-worker
was supported. -
#1720
f638de64
Thanks @mrbbot! - Upgrademiniflare
to2.7.1
incorporating changes from2.7.0
-
#1691
5b2c3ee2
Thanks @cameron-robey! - chore: bump undici and increase minimum node version to 16.13- We bump undici to version to 5.9.1 to patch some security vulnerabilities in previous versions
- This requires bumping the minimum node version to >= 16.8 so we update the minimum to the LTS 16.13