π 1.1.0
Wrangler 1.1.0 includes a number of improvements to documentation and project stability, including:
-
Security
-
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 configagain 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 configcommand 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_historyor a similar file. The new version ofwrangler configwill prompt you for youremailandapi_keyviastdin.In addition, this PR also adds support for a
WRANGLER_HOMEenvironment variable, which will be the location for Wrangler's "home" directory, if you need to customize where Wrangler saves its configuration information.
-
-
Features
-
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.tomlconfiguration file. Thekv-namespaceskey 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-namespacessupport 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-namespacesfunctionality 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_KEYfor your Cloudflare API key, and$CF_EMAILfor your Cloudflare account email. -
Adds more descriptive subdomain errors - EverlastingBugstopper, issue/207
It's super easy to grab a workers.dev subdomain using the
subdomaincommand inwranglerβ so easy, in fact, that many people were trying to use it without even having a Cloudflare account!wranglernow warns users when they attempt to add a subdomain without configuring theiraccount_idinwrangler.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_configkey 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
wranglerwithout any subcommands, so that commonly-used commands are easier to find! -
Show project size on build - xtuc, pull/205
Once the build is finished,
wranglernow 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
wranglerteam 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 thebuildsubcommand. π
-
-
π€ Fixes
-
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-generatehas 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 previewon a project with Workers KV namespaces causes the command to throw an error. -
Enforce one Webpack entry in configuration - xtuc, pull/245
wranglernow returns an error during the build process if you use a webpack configuration with more than one export βwranglerneeds 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 rusttowrangler generate, the only indication that it worked was that the type inwrangler.tomlwasrust. There were no Rust files in the default template, for a Rust-type project. Now, when runningwrangler generate --type rust,wranglerwill 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,
wranglerwas incorrectly sending up abindingobject 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
wranglerjsandwrangler, the wasm module is now encoded and decoded from base64, avoiding any potential loss of data. -
Check for
account_idandzone_idbefore publishing - xtuc, issue/170The
publishsubcommand inwranglernow ensures that you have anaccount_idandzone_idconfigured in yourwrangler.tomlfile before attempting to publish, instead of failing during the publishing process. -
Fix Rust ref issue with
wranglerjsbuilds - xtuc, pull/227When
wranglerjsbuilt a project, it incorrectly referred to the output of that build process without using a Rust reference - this PR fixes that issue and allowswranglerjsto 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!
-
-
π Documentation
-
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.tomlconfiguration 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
-
-
π§ Maintenance
-
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
previewandbuildcommands: previously, ametadata.jsonfile handled the bindings for your Wrangler project, but because it was handled differently for various project types (such aswebpackorrust), it led to inconsistent behavior during the upload process. This PR removes usage ofmetadata.jsonin 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 previewintegration 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,
wranglerincludes aUser-Agentheader to clearly indicate to servers and APIs that awranglerclient is making a request:wrangler/devin debug mode andwrangler/$versionin release mode. -
Terminal messaging abstraction - ashleymichal, 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::messagecrate: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 - ashleymichal, pull/279
The
src/main.rsfile 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.
-