π 1.8.0
-
Features
-
wrangler dev
- EverlastingBugstopper, issue/845 pull/883wrangler dev
is a local proxy server to Cloudflare's preview service, allowing you to automatically re-build and preview your application onlocalhost
. This feature is in alpha and we're looking for feedback and bug reports: check out this issue!wrangler dev
works very similarly towrangler preview
, but instead of opening your browser to preview your Worker, it will start a server onlocalhost
that will execute your Worker on incoming HTTP requests:$ wrangler dev
You should be able to send HTTP requests to
localhost:8787
, along with any headers or other request data, and your Worker should execute as expected. Additionally, you'll seeconsole.log
messages and exceptions appearing in your terminal (!!!).For more information on
wrangler dev
's options, such as passing a customhost
,ip
, orport
, runwrangler dev
in your terminal for the available flags and options. -
Multi-route support - ashleymichal, issue/866 pull/916
Wrangler now allows developers to publish their Workers projects to multiple routes on a Cloudflare zone.
To deploy your Workers project to multiple routes, you can migrate from the
route
key toroutes
:name = "worker" type = "javascript" account_id = "youraccountid" # change this line # route = "example.com/foo/*" # to this line routes = ["example.com/foo/*", "example.com/bar/*"] zone_id = "yourzoneid"
-
wrangler secret
commands - ashleymichal, bradyjoslin, issue/907 issue/909 issue/912 pull/1045Wrangler now allows developers to use secrets in their Workers codebase. Secrets are secure values that can be accessed as constants, similar to text variables, inside of your Workers code.
To set a secret, you can use
wrangler secret put MY_SECRET_NAME
. The interactive prompt will ask for the secret text you'd like to add to your project:$ wrangler secret put MY_SECRET_NAME Enter the secret text you'd like assigned to the variable MY_SECRET_NAME on the script named my-project
Importantly, secrets are constrained to an environment, and do not carry over between different deployed Workers (e.g.
my-worker
andmy-worker-production
). This allows you to use different API keys, URLs, and other common "environment variable"-style values in your different environments. Specifying an environment can be done using the--env
(or-e
, for short):$ wrangler secret put MY_SECRET_NAME --env production Enter the secret text you'd like assigned to the variable MY_SECRET_NAME on the script named my-project-production
The
wrangler secret
subcommand also allows developers tolist
anddelete
secrets for your Workers projects:$ wrangler secret delete MY_SECRET_NAME Are you sure you want to permanently delete the variable MY_SECRET_NAME on the script named my-project [y/n] y π Deleting the secret MY_SECRET_NAME on script my-project. β¨ You've deleted the secret MY_SECRET_NAME. $ wrangler secret list [{"name":"API_KEY","type":"secret_text"},{"name":"MY_OTHER_SECRET","type":"secret_text"}]
-
Plain text binding support - EverlastingBugstopper - issue/993 pull/1014
In addition to secrets, Wrangler now also supports setting "plain text" bindings β values that will be available as constants in your Workers code, but aren't encrypted. This can be done by passing values inwrangler.toml
under thevars
key:name = "worker" type = "javascript" account_id = "your-account-id" workers_dev = true vars = { ENV = "staging" } [env.prod] vars = { ENV = "production" }
-
Return accounts and account IDs when running
wrangler whoami
- ashleygwilliams, issue/630 pull/983We've made big improvements to
wrangler whoami
, and now return a list of Cloudflare accounts and account IDs for your authenticated user. If you are unauthenticated, or something is wrong with your API key or token, we'll also return an error with this command to help you understand how to fix your authentication issues! -
Configure sourcemap file - xtuc, issue/681 pull/1063
webpack
(by default) emits a sourcemap that maps to amain.js
file, which doesn't match the Workers runtime's configured filename,worker.js
. This causes exception reporting tools to be unable to process a Workers sourcemap file β we've updated our Webpack config to output the fileworker.js
and have fixed this issue. -
Upload "draft" worker if secret is created before initial worker script has been uploaded - gabbifish, issue/913 pull/1087
If your script hasn't yet been deployed to the Workers platform, creating and deleting secrets will also create a "draft" Worker β allowing you to still manage secret bindings before you deploy the first version of your script.
-
-
Maintenance
-
Correctly tar release binaries - EverlastingBugstopper, issue/1055 pull/1062
This PR updates the way that release binaries are generated during Wrangler's release workflow.
-
Change NPM binary permissions - xtuc, pull/1058
This PR removes an unnecessary executable permission from
npm/binary.js
. -
Improvements to GitHub Actions build process - EverlastingBugstopper, pull/1037
This PR adds a number of improvements to wrangler's GitHub Actions workflows, including caching, release management, and more granular trigger conditions.
-
Add GitHub Actions badge to README - EverlastingBugstopper, pull/1030
This PR adds a GitHub Actions badge to our README, indicating whether the repo's builds are currently passing:
-
Test Rust with GitHub Actions - EverlastingBugstopper, pull/1028
This PR adds a GitHub Actions workflow for runningwrangler
's test suite on a number of platforms and Rust versions. -
Add release checklist - EverlastingBugstopper, pull/1021
This PR adds a release checklist, documenting the steps that we use to release new versions of Wrangler. That checklist includes writing this CHANGELOG - very meta!!!
-
Update dependencies - EverlastingBugstopper, pull/1000
This PR updates some project dependencies as a result of running
cargo update
. -
Run CI on pull requests, not pushes - EverlastingBugstopper, pull/1090
This PR changes the GitHub Actions workflow "event trigger" to fire on
pull_request
, notpush
. This will allow wrangler's GitHub Actions workflows to run on PRs sent from forks! -
Zip .tar files in CI - EverlastingBugstopper, pull/1069 pull/1080
These PRs fix some issues in the GitHub Actions release workflow that were causing release artifacts to be incorrectly generated.
-
Fixes clippy warnings - EverlastingBugstopper, pull/1071
This PR fixes some linting issues surfaced by clippy throughout the project.
-
Extract upload and deploy to lib modules - ashleymichal, pull/1075
This PR refactors some of the underlying code used inside of
wrangler publish
, to create two higher-levelupload
anddeploy
modules. This work has already been used to support "draft workers" in #1087, and to reduce duplication of code betweenwrangler preview
,wrangler dev
, andwrangler publish
.
-