-
-
BREAKING CHANGE: Require the
webpack_config
field inwrangler.toml
to build with a custom configuration - EverlastingBugstopper, issue/296 pull/847Wrangler will no longer use a
webpack.config.js
at the root of your project to build your worker. If you would like to continue using a custom build configuration, you will need to specify thewebpack_config
field in yourwrangler.toml
like so:name = "my-worker" workers_dev = true account_id = "01234567890987654321234567890" webpack_config = "webpack.config.js"
-
API Token Support - gabbifish/ashleymichal, issue/354 pull/471/pull/879
Wrangler can now be configured with API Tokens!
Don't worry, current configurations with an email address and a Global API Key will continue to work, but we highly recommend that you switch to API Tokens as they are a much more secure authentication method.
If you want to use API tokens, create an API token from the "Edit Cloudflare Workers" API token template here, and copy/paste it in the
wrangler config
prompt. Alternatively, you can set theCF_API_TOKEN
environment variable. -
Add the ability to preview without opening the browser - EverlastingBugstopper, issue/256 pull/816
wrangler preview
can now be called with a--headless
flag that will not open the browser. -
Check for valid credentials when running
wrangler config
- gabbifish, issue/439 pull/842Before this version of Wrangler,
wrangler config
would allow any input string to be passed for your user details. Now, Wrangler validates that the credentials will work with Cloudflare's API. -
Add a warning when publishing a Workers Site to a route without a trailing asterisk - EverlastingBugstopper, issue/814 pull/839
When publishing a Workers Site to your own domain, it's important that the Worker code runs on every path on your domain. This isn't particularly clear, so now when attempting to publish a Workers Site to a route without a trailing asterisk, Wrangler will print a warning message.
-
Better error message for publishing to a duplicate route - pradovic, issue/519 pull/813
When publishing to a route that is associated with another worker, Wrangler now prints a more actionable error message.
-
Better error message when webpack fails - ashleymichal, issue/428 pull/837
Wrangler now recommends running
npm install
as a possible remedy for failed webpack builds.
-
-
-
Properly handle errors when running Wrangler as a global npm package - jaredmcdonald, issue/848 pull/857
-
Clean up temporary build files - EverlastingBugstopper, pull/853
When building a script, Wrangler creates a temporary file. Old versions of Wrangler were quite messy about it, but now it cleans up after itself.
-
Fix the help text for
wrangler generate
- EverlastingBugstopper, pull/830The default value for a template is now a complete and valid URL instead of a sample project name.
-
Remove --version on subcommands - EverlastingBugstopper, issue/791 pull/829
Each subcommand in Wrangler used to take a
--version
argument which would print the name of the subcommand. For instance,wrangler publish --version
would printwrangler-publish
. This wasn't super helpful, so we've removed that functionality. -
Fix a broken link in the README - victoriabernard92, pull/838
-
-
-
Create fixtures programatically - EverlastingBugstopper, pull/854
Wrangler's test suite relied on a large number of fixtures that it read in from the file system. Now, it writes the test fixtures itself and does not rely on reading fixtures from the file system.
-
Clean up Workers Sites logic - ashleymichal, issue/622 issue/643 pull/851
-
Call cloudflare-rs from https.rs - gabbifish, pull/841
We've refactored some of our API client code in order to make way for some future improvements.
-
Audit code comments - EverlastingBugstopper, pull/846
-
Update the author of the npm package - EverlastingBugstopper, pull/836
The author of the npm package is now [email protected]
-
Remove unused code warnings when running tests - pradovic, issue/818 pull/832
Due to the way the Rust compiler works, some of our test code appeared to be unused, even though it wasn't really. After making a couple of modules public, there are no more warnings.
-
Use the same binding name for Rust and webpack wasm modules - ashleymichal, pull/822
-
Move the code for each subcommand to its own directory - EverlastingBugstopper, pull/831
-
Refactor upload forms - ashleymichal, pull/826
We've separated some tangled logic regarding the form Wrangler POSTs to the Cloudflare v4 API.
-
Pull npm version from package.json - EverlastingBugstopper, issue/812 pull/817
Wrangler's npm installer version now only needs updating in the package.json instead of both the package.json and the source code.
-
-
-
Move Wrangler docs from READMEs to the Cloudflare Workers documentation site - victoriabernard92, pull/823
Wrangler has outgrown the README as primary documentation paradigm, and we've moved its documentation to the Cloudflare Workers documentation site.
-
Update the demo gif in the README - EverlastingBugstopper, issue/843 pull/868
The demo gif at the top of the README now accurately reflects the behavior of the latest Wrangler release.
-
-
-
Deprecate
wrangler publish --release
- EverlastingBugstopper, issue/538 pull/751wrangler publish --release
is now simply an alias ofwrangler publish
. This is related to the introduction of environments made in 1.3.1 and is intended to reduce confusion surrounding deploy targets. Previously,wrangler publish --release
would deploy to a route on your own domain, andwrangler publish
would deploy to your workers.dev subdomain. This was a confusing API, and we now require individual environments to have eitherworkers_dev = true
or both aroute
andzone_id
in each section ofwrangler.toml
. This makes it very clear where your Workers code is being deployed. If you're not usingwrangler publish --release
but you addedworkers_dev = false
to the top level of yourwrangler.toml
because Wrangler warned you to - you can now safely remove it! If you are usingwrangler publish --release
, know that it is functionally the same aswrangler publish
. If you want to deploy to workers.dev and also a route on your own domain, you will need to set up multiple environments. -
Deprecate
private
field inwrangler.toml
- stevenfranks, issue/782 pull/782In a related note, the
private
field no longer functions inwrangler.toml
. The original intent behind this field was to allow "publishing" without "activating". Unfortunately this led to a lot of undefined behavior if the value was switched fromtrue
tofalse
in between awrangler publish
command and awrangler publish --release
command and vice versa. With the removal ofwrangler publish --release
, we are also removing theprivate
field. If yourwrangler.toml
files contain a value for private, you can remove it! -
Include/exclude static assets in a Workers Sites project - gabbifish, issue/716 pull/760
Your
wrangler.toml
has two new optional fields:include
andexclude
. These fields give you more granular control over what files are uploaded to Workers KV. This behavior mirrors Cargo's include/exclude functionality. Further documentation for this feature is available here. -
A more robust
wrangler generate
- EverlastingBugstopper, issue/315 pull/759wrangler generate
is now much smarter aboutwrangler.toml
files. Previously,wrangler generate
would simply create the same configuration for every project, and it would ignore anywrangler.toml
that was committed to the template. This means much less guesswork when usingwrangler generate
with existing Workers projects. -
Add the ability to check if you've already registered a workers.dev subdomain - gusvargas, issue/701 pull/747
You can now run
wrangler subdomain
without any arguments to see if you have registered a workers.dev subdomain.$ wrangler subdomain π foo.workers.dev
-
Add
--verbose
flag towrangler publish
andwrangler preview
- gabbifish, issue/657 pull/790You can now run
wrangler publish --verbose
andwrangler preview --verbose
on a Workers Sites project to view all of the files that are being uploaded to Workers KV.$ wrangler publish --verbose π Using namespace for Workers Site "__example-workers_sites_assets" π Preparing to upload updated files... π Preparing ./public/favicon.ico π Preparing ./public/index.html π Preparing ./public/404.html π Preparing ./public/img/404-wrangler-ferris.gif π Preparing ./public/img/200-wrangler-ferris.gif β¨ Success β¨ Built successfully, built project size is 11 KiB. β¨ Successfully published your script to https://test.example.workers.dev
-
Disallow
node_modules
as a bucket for Workers Sites - gabbifish, issue/723 pull/792node_modules
is no longer allowed to be a bucket for Workers Sites. It is notoriously very large and if it were specified as a bucket it would probably be a very expensive mistake. -
Allow installs to utilize Wrangler binaries via a caching proxy instead of Github directly - gabbifish, [pull/797]
To avoid dependency on one external service, Github, we enabled a cache proxy (using Workers!) for installations of Wrangler.
-
Provide a better error message when using an unverified email address - ashleygwilliams, issue/320 pull/795
The Cloudflare API refuses to play nice with unverified email addresses (we don't like spam!), and now when this happens, Wrangler gives an actionable error message.
-
-
-
Fix Rust live preview - gabbifish, issue/618 pull/699
If you use Wrangler to develop Rust Workers, you may have noticed that live preview (
wrangler preview --watch
) was not working with your project. Not to worry though, we cracked down on this bug with an (oxidized) iron fist! Wrangler now has cross-platform support for live previewing Rust Workers. -
Minimize timeout errors for bulk uploads - gabbifish, issue/746 pull/757
Sometimes Wrangler would make API calls to Workers KV that would timeout if there were too many files. We've increased the amount of time Wrangler will wait around for the API operations to complete.
-
Print readable error message when external commands fail - EverlastingBugstopper, pull/799
Wrangler depends on a few external applications, and sometimes the calls to them fail! When this happens, Wrangler would tell you the command it tried to run, but it included a bunch of quotes. This change removes those quotes so the command is easily readable and can be copy/pasted.
-
Disallow
wrangler generate --site
with a template argument - EverlastingBugstopper, issue/776 pull/789In Wrangler 1.4.0, we introduced Workers Sites, which included the ability to run
wrangler generate --site
which would use our site template behind the scenes. Confusingly, you could also pass a template to this command:wrangler generate my-site https://github.com/example/worker-site --site
, which would not behave as expected. This specific usage will now correctly output an error.
-
-
-
Begin refactoring test suite - ashleymichal, pull/787
We're constantly shipping features in Wrangler, and with more features comes a larger codebase. As a codebase expands, it goes through some growing pains. This release includes some improvements to the internal organization of Wrangler's codebase, and is intended to make our lives and our contributors' lives easier moving forward.
-
Moved all "fixture" helper functions to "utils" module to share between build/preview tests
-
Removed "metadata_wasm.json" from
simple_rust
fixture -
Extracted all module declrations in
main.rs
tolib.rs
to allow tests to import withuse wrangler::foo
-
Split
target/mod.rs
into one file per struct -
Cleaned up KV Namespace mod system
-
Use
log::info!
instead ofinfo!
inmain.rs
-
-
Refactor GlobalUser to be passed as a reference consistently - gabbifish, pull/749
-
Remove internal link from CONTRIBUTING.md - adaptive, pull/784
-
Fix some Clippy warnings - EverlastingBugstopper, pull/793
-
Clean up leftover directories created by tests - ashleymichal, pull/785
-
Refactor subdomain module - EverlastingBugstopper, issue/758 pull/764
-
Fix README markdown misrender - dottorblaster, pull/763
-
Remove duplicate Environments subheader from README - bradyjoslin, pull/766
-
Change Crate author to the Workers Developer Experience team - ashleygwilliams, pull/752
-
-
-
Workers Sites - pull/509
Wrangler 1.4.0 includes supports for Workers Sites, enabling developers to deploy static applications directly to Workers. Workers Sites is perfect for frontend frameworks like React and Vue, as well as static site generators like Hugo and Gatsby.
Workers Sites is a feature exclusive to Wrangler, and combines a great developer experience with excellent performance. The
--site
flag has been added towrangler init
andwrangler generate
to use Workers Sites with new and existing projects:# Add Workers Sites to an existing project $ wrangler init --site # Start a new Workers Sites project $ wrangler generate --site
If you're ready to get started using Workers Sites, we've written guides for the various routes you might take with your project:
- Create a new project from scratch
- Deploy a pre-existing static site project
- Add static assets to a pre-existing Workers project
For more details on how Workers Sites works with Wrangler, check out the documentation. We also have a brand new tutorial to help you learn the Workers Sites workflow, by deploying a React application!
Workers Sites has been a heroic effort by the entire Workers Developer Experience team, comprising of Wrangler updates, new project templates, and open-source packages. We're super excited about the future that Workers Sites represents, where static sites and serverless functions can work together to build powerful, cutting-edge applications.
Make sure to try out Workers Sites to build your next app! πππ
-
Download release from our proxy rather than GitHub - zackbloom, pull/692
-
Add validation for workers names in wrangler init and wrangler generate - gabbifish, issue/470
There are a number of requirements around what your Workers script is named β previously, Wrangler would opaquely fail and not indicate that your script name was invalid: this PR updates the
init
andgenerate
commands to validate the potential name before continuing to create a new project. -
Ensure KV subcommands check for presence of required fields in wrangler.toml - gabbifish, [issue/607] pull/665
There's a number of commands in
wrangler
that require a properly configuredwrangler.toml
file: instead of failing, this PR ensures that these commands now check your configuration file before attempting any action. Hooray for clarity! π -
Show size when a KV upload error occurs - stevenfranks, issue/650 pull/651
Previously, when uploading a file to Workers KV from Wrangler, the error output didn't indicate the size of the file that was being uploaded. This PR improves the output of that message by showing both the file size and the maximum file size that can be uploaded to Workers KV.
-
Better file support for kv:put - phayes, pull/633
The
kv:put
command, introduced in Wrangler 1.3.1, has been improved to support uploading non-UT8 files. In addition, the command now streams files directly to the Cloudflare API when uploading, instead of buffering them in memory during the upload process.
-
-
Ensure we install and cache the latest version of cargo-generate and wasm-pack if user has an outdated cargo installed version - EverlastingBugstopper, issue/666 pull/726
Wrangler orchestrates a few other tools under the hood, notably
wasm-pack
andcargo-generate
. We use a library calledbinary-install
to fetch and cache binaries we download. However, to avoid downloading unecessarily, we first check if the user has a copy locally on their machine that they hadcargo install
'd. We had a bug where in this logic branch, we didn't check that the local version was the most up-to-date version. This meant that users who had an older installed version may run into errors when wrangler expected to use features of a newer version of that tool. This PR adds the logic to check for the version and will install and cache a newer version for wrangler to use (leaving your local version as is!).-
Remove link to 000000000000000000.cloudflareworkers.com - EverlastingBugstopper, pull
Have you ever run
wrangler preview
in your project and wondered why the URL to preview your application is000000000000000000.cloudflareworkers.com
? The writer of this CHANGELOG finds it confusing, too: this PR removes that line, making it easier to parse the output fromwrangler preview
. -
Make install actually fail if the release can't be downloaded - zackbloom, pull/672
When Wrangler's installation shim attempts to install Wrangler on your machine, there's the possibility that the installation can fail βΒ instead of failing silently, the installation shim now properly throws an error, allowing us to better diagnose installation failures.
-
-
-
KV command error output improvements - gabbifish, issue/608 pull/613
The Wrangler team is always on the quest for perfect error messages. In pursuit of that goal, we've improved how errors in the
wrangler kv
subcommands output to your terminal. π -
Added missing word to whoami response - stevenfranks, pull/695
Clear writing is good! It's hard to write clearly when words are missing in a sentence. This PR corrects the output of
wrangler whoami
to add a missing word, making this command easier to read. π€
-
-
-
Webpack documentation - EverlastingBugstopper, issue/721 pull/724
For our default build type, aptly named "webpack", Wrangler uses webpack under the hood to bundle all of your assets. We hadn't documented how we do that, what our default config is, and how you can specify your own custom webpack config if you'd like. We have those docs now, so check them out!
-
-
-
Environments - EverlastingBugstopper, issue/385
Wrangler 1.3.1 includes supports for environments, allowing developers to deploy Workers projects to multiple places. For instance, an application can be deployed to a production URL and a staging URL, without having to juggle multiple configuration files.
To use environments, you can now pass in
[env.$env_name]
properties in yourwrangler.toml
. Here's an example:type = "webpack" name = "my-worker-dev" account_id = "12345678901234567890" zone_id = "09876543210987654321" workers_dev = false [env.staging] name = "my-worker-staging" route = "staging.example.com/*" [env.production] name = "my-worker" route = "example.com/*"
With multiple environments defined,
wrangler build
,wrangler preview
, andwrangler publish
now accept a--env
flag to indicate what environment you'd like to use, for instance,wrangler publish --env production
.To support developers transitioning to environments, we've written documentation for the feature, including further information about deprecations and advanced usage. Check out the documentation here!
-
KV commands - ashleymichal, gabbifish, issue/339
Wrangler 1.3.1 includes commands for managing and updating Workers KV namespaces, keys, and values directly from the CLI.
-
wrangler kv:namespace
wrangler kv:namespace
allows developers tocreate
,list
, anddelete
KV namespaces, from the CLI. This allows Wrangler users to configure new namespaces without having to navigate into the Cloudflare Web UI to manage namespaces. Once a namespace has been created, Wrangler will even give you the exact configuration to copy into yourwrangler.toml
to begin using your new namespace in your project. Neat!$ wrangler kv:namespace create "MY_KV" π Creating namespace with title "worker-MY_KV" β¨ Success: WorkersKvNamespace { id: "e29b263ab50e42ce9b637fa8370175e8", title: "worker-MY_KV", } β¨ Add the following to your wrangler.toml: kv-namespaces = [ { binding = "MY_KV", id = "e29b263ab50e42ce9b637fa8370175e8" } ]
-
wrangler kv:key
wrangler kv:key
gives CLI users access to reading, listing, and updating KV keys inside of a namespace. For instance, given a namespace with the bindingKV
, you can directly set keys and values from the CLI, including passing expiration data, such as below:$ wrangler kv:key put --binding=KV "key" "value" --ttl=10000 β¨ Success
-
wrangler kv:bulk
wrangler kv:bulk
can be used to quickly upload or remove a large number of values from Workers KV, by accepting a JSON file containing KV data. Let's define a JSON file,data.json
:[ { "key": "test_key", "value": "test_value", "expiration_ttl": 3600 }, { "key": "test_key2", "value": "test_value2", "expiration_ttl": 3600 } ]
By calling
wrangler kv:bulk put --binding=KV data.json
, I can quickly create two new keys in Workers KV -test_key
andtest_key2
, with the corresponding valuestest_value
andtest_value2
:$ wrangler kv:bulk put --binding=KV data.json β¨ Success
The KV subcommands in Wrangler 1.3.1 make it super easy to comfortably query and manage your Workers KV data without ever having to leave the command-line. For more information on the available commands and their usage, see the documentation. π€―
-
-
Reduce output from publish command - EverlastingBugstopper, issue/523
This PR improves the messaging of
wrangler publish
.Before:
β¨ Built successfully, built project size is 517 bytes. β¨ Successfully published your script. β¨ Success! Your worker was successfully published. You can view it at example.com/*
After:
$ wrangler publish β¨ Built successfully, built project size is 523 bytes. β¨ Successfully published your script to example.com/*
-
feat #323: Allow fn & promise from webpack config - third774, issue/323
This PR fixes Wrangler's handling of
webpack.config.js
files to support functions and promises, as per the Webpack documentation. -
Use webworker target - xtuc, issue/477
This PR updates how Wrangler builds JavaScript projects with Webpack to conform to the
webworker
build target. This ensures that projects built with Wrangler are less likely to generate code that isn't supported by the Workers runtime.
-
-
-
Have live reload preview watch over entire rust worker directory - gabbifish, pull/535
This change updates the live reload functionality to watch over the entire Rust worker directory, and does not look for
package.json
files that do not typically exist for Rust and WASM projects. -
Fix javascript live preview for linux - gabbifish, issue/517
This PR fixes an issue with Wrangler's live preview (
wrangler preview --watch
) functionality on Linux. In addition, it simplifies the console output for a live preview instance, which could get pretty noisy during development! -
Different emojis for different commands - EverlastingBugstopper, pull/605
KV subcommands would return the same emoji value in
--help
output. This PR updates the command-line output to use different emoji, making the output easier to read!
-
-
-
Add keywords for npm SEO - EverlastingBugstopper, pull/583
This PR improves the discoverability for wrangler on npm by adding keywords to the installer's
package.json
. -
Clean up emoji - xortive, pull/455
This PR removes some extraneous unicode that keeps our emoji from displaying correctly in certain terminal emulators, especially for multi-codepoint emoji.
-
-
-
Add documentation for init to the README - EverlastingBugstopper, pull/585
This PR adds documentation in our README for
wrangler init
, which allows you to begin using an existing project with Wrangler. -
Remove link to docs for installation because they link back to wrangler README - EverlastingBugstopper, pull/494
-
Minor formatting fix in README.md - kentonv, pull/515
This PR fixes a small syntax issue in the Wrangler README, causing Markdown lists to render incorrectly.
-
Fix link to Cloudflare Workers preview service - dentarg, pull/472
This PR fixes a link to the Cloudflare Workers preview service in the Wrangler README.
-
-
-
Implement live previewing for wrangler - xortive, pull/451
The
wrangler preview
command now supports live previewing! As you develop your project, you can start up a link between your local codebase and the preview service by runningwrangler preview --watch
. Any updates to your project will be passed to the preview service, allowing you to instantly see any changes to your project. This is a massive improvement to the development process for building applications with Workers, and we're super excited to ship it!A huge shout-out to @xortive, who almost single-handedly built this feature during his summer internship at Cloudflare, over the last few months. Amazing work! π
-
Authenticate calls to preview service when possible - ashleymichal, issue/423 pull/429
This PR allows developers to use the preview service with account and user-specific functionality, such as KV support inside of the preview service. Previously, attempting to preview a Workers project with KV bindings would cause an error - this PR fixes that, by allowing
wrangler preview
to make authenticated calls to the preview service.
-
-
-
Cleanup README and link to workers docs - EverlastingBugstopper, pull/440
This PR cleans up the README and adds additional links to the Workers documentation to improve consistency around Wrangler documentation.
-
Link to docs for update instructions - ashleymichal, pull/422
We've migrated the "Updating
wrangler
" section of the README to the Workers documentation.
-
-
-
Test maintenance - EverlastingBugstopper, pull/563
This PR cleans up some incorrectly named tests and adds fixtures to support testing new functionality in 1.3.1, such as environments. β¨
-
Guard test against potential races - xtuc, pull/567
This PR fixes a race condition during
wrangler build
that can occur when two builds are taking place at the same time. To fix it, a file lock has been implemented, which Wrangler will wait on until the previous build completes. -
Deny clippy warnings in CI, run rustfmt in --check mode - xortive, issue/426
This PR updates some of the CI steps for testing Wrangler, to make sure that rust-clippy warnings cause CI to fail. This helps Wrangler code stay well-written and consistent - hooray!
-
Add repository link to Cargo.toml - 56quarters, pull/425
-
-
-
Install current version, not latest - ashleygwilliams, issue/418
Previously the NPM installer for wrangler would always pull the most recent release from Github releases, and the installer did not increase version numbers when Wrangler did. Many users found this confusing. Now the installer will increment versions along with Wrangler releases, and point at specific versions rather than the most recent one at the time of installation.
-
Improve JSON errors debuggability - xtuc, pull/394
This PR improves JSON error output in
wrangler
. Specifically:-
If a
package.json
file fails to decode,wrangler
now emits a clearer error:$ wrangler build β¬οΈ Installing wranglerjs... β¬οΈ Installing wasm-pack... thread 'main' panicked at 'could not parse "./package.json": Error("expected `,` or `}`", line: 4, column: 3)', src/libcore/result.rs:999:5
-
If the
wranglerjs
backend returns invalid JSON, it now preserves the output file for further investigation. Note that the console doesn't print the output file location by default, and you will need to passRUST_LOG=info
while runningwrangler build
, and search for the--output-file=FILE
argument passed towranglerjs
:$ RUST_LOG=info wrangler build β¬οΈ Installing wasm-pack... [2019-08-09T19:28:48Z INFO wrangler::commands::build::wranglerjs] Running "/Users/kristian/.nvm/versions/node/v12.1.0/bin/node" "/Users/kristian/src/workers/wrangler/wranglerjs" "--output-file=/var/folders/5x/yzqyqst11n518yl8xl7yv1f80000gp/T/.wranglerjs_output5eREv" # ...
-
If the preview service returns invalid JSON, it now emits a clearer error, and the full output can be seen by using
RUST_LOG=info
.Previously:
$ wrangler preview β¬οΈ Installing wasm-pack... β¬οΈ Installing wranglerjs... β¨ Built successfully. Error: Error("expected value", line: 2, column: 1)
Now:
$ wrangler preview β¬οΈ Installing wranglerjs... β¬οΈ Installing wasm-pack... β¨ Built successfully, built project size is 1 MiB. β οΈ Your built project has grown past the 1MiB size limit and may fail to deploy. β οΈ β¨ Error: https://cloudflareworkers.com/script: Server Error: 502 Bad Gateway
-
-
-
-
Fix
wrangler config
for systems with non-unix EOL - xortive, issue/389wrangler config
was not properly truncating whitespace from the end of user input, resulting in a panic when trying to usewrangler publish
, becausewrangler
would try to create an HTTP header with invalid characters. Now,wrangler
will properly truncate extra whitespace (including\r
) from the end of the input intowrangler config
.
-
-
-
Migrate straggler emojis to terminal::emoji - EverlastingBugstopper, pull/382
This PR updates the last remaining instances where
wrangler
was using hard-coded emojis for messages, rather than usingterminal::emoji
. In addition, there are two instances where this PR changes the usage of the β emoji toβ οΈ . -
Move test fixtures to their own directory - EverlastingBugstopper, pull/383
This PR aggregates fixtures used in integration tests into a
fixtures
directory to make it easier to find/use them. -
Update issue templates to fit Github's data model - EverlastingBugstopper, pull/387
Our previous issue templates were not picked up by Github's user interface. This PR updates the templates to fit the accepted data model, and adds some style tweaks to make the templates easier to use.
-
Move Emoji formatting/messaging into new functions - ashleymichal, pull/391
This PR makes improvements to the internal messaging logic of Wrangler, allowing us to be more flexible in how we display information to users.
-
-
-
Update README to include config, env var changes - ashleymichal, pull/379
In 1.1.0 we changed the
config
command to be interactive. This PR updates the README to reflect that change. -
Add section to readme about Vendored OpenSSL - xortive, pull/407
Wrangler has some external OpenSSL dependencies when installing on Linux -- this PR documents those dependencies, and how to install Wrangler using a vendored OpenSSL feature flag:
cargo install wrangler --features vendored-openssl
-
Wrangler 1.1.0 includes a number of improvements to documentation and project stability, including:
-
-
Change global config perm - xtuc, pull/286
This PR improves the security of Wrangler's global config file, by restricting access to Wrangler's global user configuration file (
~/.wrangler/config/default.toml
) to the user who ran the wrangler config command. For existing Wrangler users, please runwrangler config
again on your machine! This will fix the permissions of your global config file to be scoped to your user account. -
Use stdin instead of arguments for wrangler config - xtuc, pull/329
We've made the
wrangler config
command interactive βΒ the previous version of the command,wrangler config $email $apiKey
, would be captured by your terminal's history, often exposing that information in a~/.bash_history
or a similar file. The new version ofwrangler config
will prompt you for youremail
andapi_key
viastdin
.In addition, this PR also adds support for a
WRANGLER_HOME
environment variable, which will be the location for Wrangler's "home" directory, if you need to customize where Wrangler saves its configuration information.
-
-
-
Support KV Namespace Configuration - ashleymichal, pull/334, add check + error message for pre 1.1.0 kv namespace format - xortive, pull/369
Wrangler now supports using Workers KV namespaces in your project! To start using KV with your projects, create a namespace in the Cloduflare Dashboard, and the namespace information to your
wrangler.toml
configuration file. Thekv-namespaces
key requires setting abinding
(the representation of your namespace in your code) andid
, the namespace ID:# wrangler.toml [[kv-namespaces]] binding = "TODOS" id = "0f2ac74b498b48028cb68387c421e279"
If you were previously using the undocumented
kv-namespaces
support in your project config, you'll need to make a few changes to your project to use Wrangler 1.1.0! KV namespaces now need to be created manually, in the Cloudflare Dashboard, to be able to use them in your Wrangler configuration - previous versions of Wrangler created the namespace for you, but the process is now manual, to allow developers to be more explicit about how their KV namespaces are created.For users of the previously undocumented
kv-namespaces
functionality in Wrangler, we've provided a warning and upgrade path, to help you upgrade your KV configuration in your project to the correct format:β οΈ As of 1.1.0 the kv-namespaces format has been stabilized β οΈ πβ Please add a section like this in your `wrangler.toml` for each KV Namespace you wish to bind: πβ [[kv-namespaces]] binding = "BINDING_NAME" id = "0f2ac74b498b48028cb68387c421e279" # binding is the variable name you wish to bind the namespace to in your script. # id is the namespace_id assigned to your kv namespace upon creation. e.g. (per namespace) Error: β οΈ Your project config has an error β οΈ
This is the initial part of a lot of incredible work being done on supporting Workers KV in Wrangler. If you're interested in what's up next, check out our next milestone.
-
Configure Workers KV in your wrangler.toml - ashleymichal, pull/333
If you've tried to use Workers KV in Wrangler, you've probably had a bad time! This PR, along with #334, build support for handling and correctly uploading KV namespace information with your Wrangler project:
[[kv-namespaces]] binding = "NAMESPACE" id = "0f2ac74b498b48028cb68387c421e279"
-
Use ENV variables to configure Wrangler - AaronO, pull/225
Previously, Wrangler required a global configuration file to be able to run. As many users may use Wrangler in situations where they don't have an interactive terminal, meaning they can't instantiate a config file using
wrangler config
, this PR allows Wrangler to run even if the config file doesn't exist. This change means that users can also configure Wrangler exclusively with environment variables, using$CF_API_KEY
for your Cloudflare API key, and$CF_EMAIL
for your Cloudflare account email. -
Adds more descriptive subdomain errors - EverlastingBugstopper, issue/207
It's super easy to grab a workers.dev subdomain using the
subdomain
command inwrangler
βΒ so easy, in fact, that many people were trying to use it without even having a Cloudflare account!wrangler
now warns users when they attempt to add a subdomain without configuring theiraccount_id
inwrangler.toml
, as well as when you've already registered a subdomain, or if the subdomain you're trying to register has already been claimed. -
Allow custom webpack configuration in wrangler.toml - EverlastingBugstopper, issue/246
If you'd like to bring your own Webpack config to your Workers project, you can now specify a
webpack_config
key inwrangler.toml
:webpack_config: webpack.prod.js
-
Add issue templates for bug reports and feature requests - gabbifish, issue/250
To make it easier for us to diagnose problems and support user feedback, we've added issue templates to make it easier for users to submit bug reports and feature requests.
-
Display commands in their defined order - Electroid, pull/236
We've re-arranged the order of the commands when you run
wrangler
without any subcommands, so that commonly-used commands are easier to find! -
Show project size on build - xtuc, pull/205
Once the build is finished,
wrangler
now prints the compressed size of the script, and, if available, the Wasm binary size:$ wrangler publish β¬οΈ Installing wranglerjs... β¬οΈ Installing wasm-pack... β¨ Built successfully, built project size is 517 bytes. β¨
-
Add HTTP prefix to publish command output. - elithrar, pull/198
Prefix "https://" in front of the "script available" output to allow shells to automatically detect it as a link. Many shells will allow you to click directly on the URL from inside the terminal (such as iTerm's "CMD-Click"), making it much easier to navigate to your subdomains, or any published Workers applications.
-
Build: add message and emoji - xtuc, pull/193
The
wrangler
team really loves emoji, so we made sure to send a little bit of β¨ cheer β¨ your way, via a new message and emoji, whenever you use thebuild
subcommand. π
-
-
-
Remove OpenSSL installation step from README - xortive, issue/355
Due to an OpenSSL dependency in
cargo-generate
, Wrangler required developers to install OpenSSL as part of the setup process for using Wrangler. Version 0.3.1 ofcargo-generate
has removed this requirement, and you no longer need to install OpenSSL manually to use Wrangler. Hooray! -
Fix issue previewing a project with KV namespaces - ashleymichal, pull/353
This PR fixes a critical bug where using
wrangler preview
on a project with Workers KV namespaces causes the command to throw an error. -
Enforce one Webpack entry in configuration - xtuc, pull/245
wrangler
now returns an error during the build process if you use a webpack configuration with more than one export βΒwrangler
needs to have a single known export from webpack to know what to build! -
Update default template for Rust project type - EverlastingBugstopper, pull/309
Previously, when passing
--type rust
towrangler generate
, the only indication that it worked was that the type inwrangler.toml
wasrust
. There were no Rust files in the default template, for a Rust-type project. Now, when runningwrangler generate --type rust
,wrangler
will use rustwasm-worker-template when generating a new project. -
Stop cleaning webpack build artifacts - EverlastingBugstopper, pull/307
The configuration for Webpack projects in Wrangler was over-eager to clean build artifacts, which in the worst-case, caused Wrangler to remove source code for developers' projects - oops! This fix relaxes the Webpack cleaning process, to ensure that building a Wrangler project is a bit safer.
-
Correct binding format - xtuc, pull/260
Previously,
wrangler
was incorrectly sending up abinding
object to the Cloudflare API, whenever we attempted to update a script's bindings. This fix renames it tobindings
, and uses an array, as per the Cloudflare API requirements. -
Correctly pass Wasm module - xtuc, pull/261
To ensure that a wasm module is successfully passed between
wranglerjs
andwrangler
, the wasm module is now encoded and decoded from base64, avoiding any potential loss of data. -
Check for
account_id
andzone_id
before publishing - xtuc, issue/170The
publish
subcommand inwrangler
now ensures that you have anaccount_id
andzone_id
configured in yourwrangler.toml
file before attempting to publish, instead of failing during the publishing process. -
Fix Rust ref issue with
wranglerjs
builds - xtuc, pull/227When
wranglerjs
built a project, it incorrectly referred to the output of that build process without using a Rust reference - this PR fixes that issue and allowswranglerjs
to correctly take your bundle, and your project's metadata, and put it all together in a nice little package to send up to the Cloudflare API. Hooray, working projects!
-
-
-
feat(docs): add CONTRIBUTING.md - ashleygwilliams, pull/268
We've created a shiny new contribution guide to help contributors understand how the project works, and how the team triages incoming issues and feature requests. This should make it easier for us to work through your feedback on Wrangler, as well as give you some insight into how we work. Woo-hoo! π
-
Update README to include KV config info - ashleymichal, pull/319
You can now create Workers KV namespaces from inside of your
wrangler.toml
configuration file - this has been documented in the README. -
Make it more clear that you can install Wrangler though npm - zackbloom, pull/241
-
Document (lightly) the Wrangler 1.0.0 release - signalnerve, pull/204
-
Add README for Wrangler.js package - ashleygwilliams, pull/196
-
-
-
Better error printing - xortive, pull/327
We've updated how we log errors in Wrangler's output to make it a little easier to read. If you're a Rust developer interested in how we did this, check out the pull request!
-
Always use multipart upload - ashleymichal, issue/280
We've updated how Wrangler uploads projects to the Workers runtime - as Wrangler supports the entire Workers ecosystem (including tools like Workers KV, the publishing process should use multipart forms to allow uploading all of the data that represents a Workers project in a single step.
-
unify upload form building - ashleymichal, pull/329
This PR brings consistency to the way that metadata is handled during Wrangler's
preview
andbuild
commands: previously, ametadata.json
file handled the bindings for your Wrangler project, but because it was handled differently for various project types (such aswebpack
orrust
), it led to inconsistent behavior during the upload process. This PR removes usage ofmetadata.json
in favor of building metadata for each project type in-memory, which will then be uploaded directly to Workers platform. This work is foundational for improved Workers KV support in Wrangler π -
wrangler preview
integration tests - EverlastingBugstopper, pull/363Wrangler now includes integration tests for
wrangler preview
, testing every project type that Wrangler supports with our preview service. -
Add user agent - xtuc, issue/234
For every outgoing request,
wrangler
includes aUser-Agent
header to clearly indicate to servers and APIs that awrangler
client is making a request:wrangler/dev
in debug mode andwrangler/$version
in release mode. -
Terminal messaging abstraction - ashleymical, issue/219
We've made improvements to Wrangler's terminal output functionality, with support for various log levels and implementations in Wrangler's API for easily using the log levels in future development.
The new terminal output functionality can be used by importing the
terminal::message
crate:use crate::terminal::message; message::info("Building project") // "πβ Building project" message::success("Your project has been deployed!") // "β¨ Your project has been deployed!" // Other available functions: // message::warn, message::user_error, message::working, message::preview
-
Remove pre-push hooks - EverlastingBugstopper, pull/308
Previous versions of Wrangler included pre-push hooks to ensure that code was linted before being pushed up to Git. This hook made it difficult to manage in-progress work, so the hooks have been removed.
-
Use serde for metadata - xtuc, pull/285
This change adds proper construction of the worker metadata, previously, it was an error-prone string.
-
Refactor: Conditional per command in main - ashleymical, pull/279
The
src/main.rs
file in Wrangler has been rewritten so that the layout of the file is easier to read. -
Add an authenticated HTTP client - Electroid, issue/238
All HTTP requests to the Cloudflare API are now made with an authenticated HTTP client.
-
Pin webpack version - xtuc, pull/228
Adds a better control over webpack's version, avoiding possible upstream issues.
-
Wrangler 1.0.0 has been released! The first major version of Wrangler makes the tool the preferred development and deployment tool for JavaScript and Rust projects to the Cloudflare Workers platform.
This release includes many changes to the developer experience for Wrangler, including:
- Support for installing wrangler via npm:
npm install @cloudflare/wrangler -g
. - Support for various project types, including
javascript
andwebpack
.- The default project type for Wrangler is now
webpack
.
- The default project type for Wrangler is now
- Support for creating and binding Workers KV namespaces via your project's configuration file.
- Enhancements to error messages and validation of your project before building and deploying.
- Fixes for Windows usage of Wrangler.
- Fixes for cross-platform console output.
-
-
Fix
publish
andpreview
bug for projects with a-
- jaysonsantos, issue/36Rust is a sometimes surprisingly opinionated language! When your
Cargo.toml
specifies a project name with a hyphen(-
) in the name, the Rust compiler will implicitly understand this as a_
for all imports and when it creates compiled artifacts it will name them with a_
.The original implementation of
wrangler
skipped over this, and as a result would go looking for a wasm file with a-
when it should have been looking for a_
. This resulted in a bit of a gross error message that stated that a file was not found.We've fixed this now- so go ahead and name your packages with
-
s!
-
-
-
Install instructions with OpenSSL troubleshooting notes - AustinCorridor, issue/35
Because of
wrangler
's use ofcargo-generate
we use OpenSSL. Classically, this is a tricky dependency. Some users may run into issue with it! We've documented the steps to fix it on MacOS- if you run into this on other platforms, we'd love a PR! -
Typo and casing fixes - neynah, pull/42
First releases almost always have some typos. Now they're fixed!
-
-
π Hello World!