Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Releases: cloudflare/wrangler-legacy

v1.14.0

04 Mar 23:34
441b847
Compare
Choose a tag to compare
  • Features

    • Display account ID's when possible - caass, pull/1786

      Previously, users had to log in to their dash to view their account IDs. This PR extracts some of the code used in whoami to log their account IDs to the terminal, instead. If for some reason that doesn't work, it'll fall back to telling them to look at the dashboard

    • Feature/monorepo support - thefill, pull/1748

      Improvement of the detection of node_modules dir - adds bottom-up traversing to find it in parent dirs.

      This should resolve some issues experienced with monorepos (e.g. with nx).

    • fix installer - xortive, pull/1780

      binary-install@0.1.1 broke semver, this PR changes our installer to use a cloudflare-owned version of binary-install with updated dependencies to resolve the previous vulnerability warnings from the old version of axios that was being used.

      This is also a feature, since we now install the wrangler binary in node_modules instead of ~/.wrangler.
      This means installing wrangler as a dev dependency works as expected -- npx wrangler will run the version
      in your dev dependencies, not the globally installed wrangler.

      Wrangler will now also support setting the WRANGLER_INSTALL_PATH environment variable to choose where you install the wrangler binary.
      This environment variable must be set when running wrangler, as well as when installing it.

    • kv put with metadata - ags799, pull/1740

      Closes #1734

  • Fixes

    • don't panic on Client build - ags799, pull/1750

      This won't fix the issue #1743 but it should give us some more context.

    • endlessly retry connection to devtools websocket - ags799, pull/1752

      Endlessly retry connection to preview's devtools websocket on wrangler dev. With exponential backoff.

      Keeps us from panicking in issue/1510.

    • fix console formatting - mdycz, pull/1749

      Fixes #1707

  • Maintenance

    • Bump futures-util from 0.3.11 to 0.3.13 - dependabot, pull/1778

    • Remove extra required_override call from sites ignore logic - xortive, pull/1754

    • remove webpack specific change - xtuc, pull/1730

      We used to hook directly into webpack internals to rewrite the runtime
      that loads Wasm to make it point to the Worker binding instead of a
      network fetch.

      This change removes the webpack specific change and injects a generic
      runtime to
      ... truncated

    • Set panic to abort in release mode - ObsidianMinor, pull/1762

      This should fix cases where we spawn threads that panic and get us in an invalid state that requires us to get killed anyway.

    • Tweak issue templates - Electroid, pull/1776

      Made minor edits to the issue templates

    • update binary-install to avoid vulnerable axios version - simonhaenisch, pull/1726

      Fixes the security warnings when installing the wrangler npm package!

    • Update README.md for windows install - koeninger, pull/1779

      note about #1765

    • Update release.yml - xortive, pull/1783

      thanks @rajatsharma for spotting this :)

v1.13.0

14 Jan 20:08
Compare
Choose a tag to compare

1.13.0

  • Features

    • Add support for text blob bindings - xortive, pull/1543, issue/483

      Wrangler now supports text blobs! Text blobs are values to use in your workers, but are read from a file instead of a string in your TOML.

      Usage:

      text_blobs = { FOO = "path/to/foo.txt", BAR = "path/to/bar.txt" }

  • Fixes

  • Maintenance

v1.12.3

16 Dec 20:49
Compare
Choose a tag to compare

❗️ 1.12.3

  • Fixes

    • Bump OpenSSL version with vulnerability patch - pull/1684

❗️ 1.12.2

02 Nov 21:57
Compare
Choose a tag to compare

❗️ 1.12.2

v1.12.1

30 Oct 02:28
Compare
Choose a tag to compare

⏰ 1.12.0

28 Oct 19:53
Compare
Choose a tag to compare

🌊 1.11.0

21 Aug 20:46
Compare
Choose a tag to compare
  • Features

    • New configuration method with wrangler login - jspspike, pull/1471

      wrangler login allows you to authenticate Wrangler to use your Cloudflare user credentials without hunting down an API token in the Cloudflare dashboard. It's straightforward! Just run wrangler login, enter your credentials, and you're off to the races.

    • wrangler dev now runs on the same machines as your production code - EverlastingBugstopper avidal jwheels, pull/1085

      When running wrangler dev as an authenticated user, your requests will now run on the same servers that Cloudflare Workers run on in production. This means that what you see is what you get. wrangler dev should behave exactly like production, though we still recommend deploying to a staging website before going to production in order to ensure your changes are safe. This change means you get access to things like request.cf, the Cache API, and any Cloudflare settings you've applied in the dashboard while developing your Workers.

    • wrangler dev now supports redirects - jspspike, issue/1508 pull/1512

      When an HTTP response status code is between 300 and 399, the server lets the client know that the data they're looking for isn't here anymore, and the client should issue another separate request to the endpoint denoted in the Location header of the response. Before, if you were developing with wrangler dev on example.com, and your Worker issued a redirect from https://example.com/oldurl to https://example.com/newurl, that's what would be in the Location header. This meant that whatever client you were using would then issue their second request to the public Internet rather than the wrangler dev server running on your local machine. With this release, the Location header would now be rewritten to http://127.0.0.1:8787/newurl, preventing your client from redirecting you away from the Worker you're trying to develop.

    • Add --config flag to all commmands to override the default wrangler.toml configuration file path - luanraithz, issue/1064 pull/1350

      All commands that read from a configuration file can now use a different configuration file path if the --config flag is specified. The commands affected are: kv:namespace, kv:key, kv:bulk, route, secret, build, preview, dev, publish, subdomain, and tail.

    • wrangler dev configuration options for HTTP protocol - jspspike, issue/1204 pull/1485

      wrangler dev now takes two additional configuration flags: --upstream-protocol and --local-protocol. Both of these take a value of either http or https. --upstream-protocol determines what protocol the request going to your preview worker is (previously this was only controlled with the --host flag) - this flag defaults to https. --local-protocol determines what protocol wrangler dev listens for and defaults to http. If https is chosen, a self-signed certificate will be auto-generated for the dev server.

    • wrangler dev can be configured in wrangler.toml - jspspike, issue/1282 pull/1477

      Any flag taken by wrangler dev (except --host) can now be configured in the [dev] section of your wrangler.toml. This allows different developers on the same project to share and persist settings for their local development environment.

    • Check if rustc is installed before building a Rust project - ObsidianMinor, issue/487 pull/1461

    • Improve preview_id error message - EverlastingBugstopper, issue/1458 pull/1465

      When a preview_id is needed, the error message directs the user to add it to their wrangler.toml.

    • Prevent wrangler preview and wrangler dev for a Workers Site if there is no authenticated user - jspspike, issue/1138 pull/1447

  • Fixes

    • Fix wrangler route commands that take an --env flag - jspspike, issue/1216 pull/1448

      Before, if you passed an environment to a wrangler route command, it wouldn't work properly due to some mishandling of the arguments in the way we used our command line argument parser. This is now fixed and wrangler route commands work as expected.

    • Open browser as child process - jspspike, issue/516 pull/1495

      When running wrangler preview, the browser is now opened as a child process. This fixes an issue on Linux where Wrangler would start the browser and then hang waiting for the browser to exit before it begins watching for changes.

    • Direct cloudflared output with wrangler tail to /dev/null - jspspike, issue/1432 pull/1450

  • Maintenance

πŸ” v1.11.0-rc.1

13 Aug 18:14
Compare
Choose a tag to compare
πŸ” v1.11.0-rc.1 Pre-release
Pre-release

What's changed?

Release Candidate 1 adds wrangler login, a new way to easily authenticate wrangler using your Cloudflare username and password. Just type wrangler login, follow the login process, and you'll be authenticated. Release Candidate 1 also adds extra features to wrangler dev. You can now change the protocol of the local server wrangler dev creates and how those requests are forwarded with the --local-protocol and --upstream-protocol arguments. For example, this is what it would look like if you wanted the local server to use https:

$ wrangler dev --local-protocol=https
πŸ’  JavaScript project found. Skipping unnecessary build!
πŸ’  watching "./"
πŸ‘‚  Listening on https://127.0.0.1:8787
πŸ’  Generated certificate is not verified, browsers will give a warning and curl will require `--insecure`
[2020-08-13 12:03:39] GET worker.ftc.workers.dev/ HTTP/1.1 200 OK

Finally the arguments for wrangler dev can now be set in your wrangler.toml under the [dev] section. All arguments other than host are valid.

name = "worker"
type = "javascript"
account_id = "acountidslkfdjskldfjslkdjfls"
workers_dev = true
route = ""
zone_id = "zoneidjalsdkfjlskd324svadvdf"

[dev]
ip="127.0.0.1"
port=8787
local_protocol="http"
upstream_protocol="https"

Installation

npm i @cloudflare/wrangler@beta -g

Creating a project

The documentation below assumes you have some familiarity with Wrangler and are already developing Workers. If this is not the case that is OK, come back after you've read through our Quickstart and have gotten up and running with Wrangler.

Testing the new wrangler dev

If you're already familiar with wrangler dev, you'll know that it spins up a development server that you can use to test the functionality of your Worker. With this release, wrangler dev will now connect directly to an instance of the Cloudflare Workers runtime running on the same servers that your code runs on in production. This will enable you to use the Cache API and should eliminate any inconsistency between responses from wrangler dev and your production worker.

Behavior Changes

  • wrangler dev will now treat the worker you're developing like it would when you run wrangler publish. This means you will need to specify workers_dev or zone_id and route in your project's configuration file before using wrangler dev.
  • For workers running on your own domain, your development worker will only run on the routes specified in your configuration file. Lets say that in production you have a worker running on example.com/* and you want to start development of a new worker with a route example.com/test. In this scenario, when you run wrangler dev, and then curl 127.0.0.1:8787 you will get a response from the worker currently running in production at the route example.com/*. If you want to test your preview worker, you will need to curl 127.0.0.1:8787/test. In this scenario, the request host in the Workers runtime would be https://example.com
  • For workers running on workers.dev, the request host will be https://projectname.yoursubdomain.workers.dev
  • You can now test your Worker's caching behavior with the Cache API
  • You can now test your Worker with event.request.cf (no longer undefined)
  • The --host flag is now only used when you are not an authenticated Cloudflare user

Feedback

We'd like to know if you notice any different behavior between requests made to a wrangler dev instance, and requests made after you publish your Worker. We want your experience with wrangler dev to match what you see in production. If you'd like to provide feedback on wrangler dev, you can comment on this issue or file a new one! Just make sure to prefix your issue title with [dev].

🀏 1.11.0-rc.0

30 Jul 21:31
Compare
Choose a tag to compare
🀏 1.11.0-rc.0 Pre-release
Pre-release

This beta release is now out of date. If you previously installed this release, you should reinstall with npm i -g @cloudflare/wrangler@beta and see what's changed in the latest release.

🐹 1.10.3

26 Jun 19:28
Compare
Choose a tag to compare
  • Features

    • wrangler dev listens on IPv4 by default - EverlastingBugstopper, issue/1198 pull/1405

      Before, wrangler dev would listen on [::1]:8787 by default, and call it localhost in the terminal output. This was confusing for developers whose localhost resolves to IPv4 and not IPv6. Now, wrangler dev will listen on 127.0.0.1:8787 by default. This can be overriden by passing values via the --ip and --port flags.

    • Clarify where to find your account_id in the dashboard - EverlastingBugstopper, issue/1364 pull/1395

      When you create a new project with wrangler generate, it directs you to the Cloudflare Dashboard to find your account_id and zone_id. However, this flow only worked if you had your own domain. Developers who only use workers.dev for their Workers were directed to a page that does not exist! This message now points everyone to a page where they can find the information that they need.

  • Fixes

    • Allow creation of preview namespaces when a namespace already exists in wrangler.toml - EverlastingBugstopper, pull/1414

      When we introduced KV preview namespaces, we made sure to add nice messages when creating new namespaces so people could easily add the new namespace id to their wrangler.toml in the correct place.

      However, we missed a very common case where developers already have a production namespace defined in their wrangler.toml and they want to add a preview namespace. When this is the case, we returned an error message intended to only be thrown when running either wrangler preview or wrangler dev. This is now fixed!

    • Allow multiple response header values in wrangler dev - EverlastingBugstopper, issue/1412 pull/1413

      Before, wrangler dev would not properly handle response headers that have multiple values. We would iterate over all response headers coming from the Workers runtime, and "insert" them into the header map instead of appending them. This is no longer the case and response headers should now work as expected. More details on this issue can be found here.

    • Fix kv-namespace/kv_namespace behavior in environments - EverlastingBugstopper, issue/1408 pull/1409

      When KV namespace support was initially added to Wrangler, we documented using kv-namespaces in wrangler.toml. Unfortunately, the - was not consistent with other fields such as zone_id and account_id, so the decision was made to allow both kv-namespaces and kv_namespaces. When this change was introduced, it worked with top level kv_namespaces entries, but not in environments. This is now fixed! You can now use kv_namespaces everywhere you can use kv-namespaces.

  • Maintenance

    • Add link to testing docs in CONTRIBUTING.md - luanraithz, pull/1416

    • Remove unused Krate::install code - EverlastingBugstopper, [issue/247] pull/1410

      When we introduced our own version checking for Wrangler we stopped using Krate::install. This PR just removes that unused code.