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.17.0

28 May 17:16
3f75e1a
Compare
Choose a tag to compare

v1.17.0

🍏 v1.16.1

26 Apr 22:58
8b11ea4
Compare
Choose a tag to compare

It's Apple M1 time! This release provides support for M1 (Apple Silicon) devices through the use of the x86_64 binary which will be run using Apple's Rosetta 2 instruction set translator. This is also true for the various binary dependencies of wrangler, such as: wasm-pack, cargo-generate. If not installed, these will be built from source automatically.

To install wrangler and use it on M1 (Apple Silicon) devices, follow the same instructions for other architectures found here: https://developers.cloudflare.com/workers/cli-wrangler/install-update#install

As always, please report issues if you encounter any!


  • Features

    • Add wasm_modules config field for bundling arbitrary WebAssembly modules. - losfair, pull/1803

      Currently it seems that wrangler only supports WebAssembly modules included from a rust or webpack project.

      This pull request enables the inclusion of arbitrary WebAssembly modules through a wasm_modules config field.

  • Fixes

    • fix: use x86_64 arch for pre-built downloads on M1 devices - nilslice, pull/1876

      This PR forces the use of a pre-built x86_64 binary on a aarch64/arm64 Apple system. For M1 devices specifically, it will fix wrangler generate, and wrangler build for type = "rust" wrangler projects.

      There is another semi-related
      ... truncated

    • chore: include @cloudflare/binary-install directly as source - nilslice, pull/1877

      This PR inlines the @cloudflare/binary-install dependency as a quickfix for #1811, in which usage reports indicated that the module occasionally failed to install.

      I tested this by running npm i && node run-wrangler.js on both `npm
      ... truncated

    • Stop assuming KV values are UTF8 text - koeninger, pull/1878

      Implementation of kv:key get is calling text() on the result of the api call, so it's replacing non-utf8 values with ef bf bd, the unicode REPLACEMENT CHAR. KV values can be arbitrary bytes, we shouldn't assume they're UTF8 text, so this p
      ... truncated

🔧 v1.16.0

16 Apr 00:28
87fe439
Compare
Choose a tag to compare

https://developers.cloudflare.com/workers/cli-wrangler/configuration#build

  • Features

    • Custom Builds and Modules - xortive, caass, pull/1855

      Custom Builds and Modules has finally landed in a main release!
      There's too many new features to write about in a changelog, so here's a
      link to the docs.

    • add --format option, including default json and new pretty - caass, pull/1851

      You can now pass --format pretty to wrangler tail to get pretty printed logs!
      --format json is also available, and gives you the existing JSON-formatted logs.

  • Fixes

    • Revert "Print line and column numbers for exception thrown (#1645)" - Electroid, pull/1835

      This reverts commit 74a89f7.

      Closes #1826

      This commit is causing wrangler dev to not show uncaught exceptions. Reverting chrome-devtools-rs was also necessary.

      We have a fix in progress to fix the underlying issue and re-introduce line and column numbers.

    • Don't generate usage_model = "" by default - xortive, issues/1850

      Generating usage_model = "" by default was violating the toml spec, which broke
      wrangler init --site as usage_model came after [site].

v1.16.0-durable-objects-rc.0

16 Apr 00:31
f5f828e
Compare
Choose a tag to compare
Pre-release

Changelog

  • Custom Builds - Custom Builds have been stabilized as part of 1.16.0. As part of this, we changed the configuration format to reduce confusion about what fields apply when using "service-worker" vs "modules", and to reduce confusion about how we use the "main" and "module" keys in package.json. The new [build] section is documented here

Installation

npm (recommended)

npm install -g @cloudflare/wrangler@beta

from source

git clone https://github.com/cloudflare/wrangler.git
cd wrangler
git checkout durable-objects-rc
cargo install --path . --debug

Overview

Howdy y'all, we just published candidate release 0 for Durable Objects! This is a continuation of the Custom Builds RC, but renamed to the Durable Objects RC as custom builds have been stabilized.

Durable Objects

Wrangler now supports Durable Objects! We've introduced a new configuration section [durable_objects] that allows you to configure which Durable Objects your project can call into using bindings.

Because Durable Objects are written using modules, you must use custom builds for Durable Objects projects. Templates are provided below.

Accessing Durable Objects

To access Durable Objects, you must configure a binding in wrangler.toml with the class name and script name
whose objects you wish to access using the binding. The script name can be omitted when creating a binding
for a class in the same script.

[durable_objects]
# In rc.1, `bindings` was called `classes`. We'll accept that in rc.2, but in rc.3 and later it will be an error.
bindings = [
  # NOTE: inline tables in TOML must be on a single line
  { name = "COUNTER", class_name = "Counter" }, # Binding to the Counter class in the same script
  { name = "CHAT_ROOM", class_name = "ChatRoom", script_name = "chatroom" } # Binding to the ChatRoom class in a different script
]

The [durable_objects] section has 1 subsection:

  • bindings - An array of tables, each table can contain the below fields
    • name - Required, The binding name to use within your worker
    • class_name - Required, The class name you wish to bind to.
    • script_name - Optional, Defaults to the current project's script.

Preparing Durable Objects Classes

When you export a new Durable Objects Class from your script, you must tell the Workers platform about it
before you can create and access Durable Objects associated with that class and script. You can read more about exporting
a new class in the docs.

This process is called a "migration", and is currently performed via extra options on wrangler publish.

To allow creation of Durable Objects associated with an exported class, you'd use --new-class:

wrangler publish --new-class Counter

If you want to rename a Durable Object Class that has already been created, you'd use --rename-class:

WARNING: Make sure to update any bindings to point to the new class name as well!

wrangler publish --rename-class Counter CounterNew

If you want to transfer the Durable Objects associated with a Class in another script to a new Class in this script, you'd use --transfer-class:

WARNING: Make sure to update any bindings to the new script name and class name as well!

wrangler publish --transfer-class counter-script ClassNameInOldScript ClassNameInThisScript

If you want to delete the Durable Objects associated with an exported class, you'd use --delete-class:

WARNING: This will delete all Durable Objects (and their data) associated with the deleted Durable Objects Class!

wrangler publish --delete-class Counter

These are basic examples -- you can use multiple of these options in a single wrangler publish call, one Durable Objects Class per option.

The following example adds 2 new classes (Counter and ChatRoom) and deletes the OldDeprecatedCode class

wrangler publish --new-class Counter --new-class ChatRoom --delete-class OldDeprecatedCode

Durable Objects Templates

We've made 2 templates so you can try out Durable Objects in wrangler:

One uses Rollup to bundle a Worker written using ES Modules, while the other uses Webpack to bundle a worker written as CommonJS modules.

wrangler generate <worker-name> https://github.com/cloudflare/durable-objects-rollup-esm
wrangler generate <worker-name> https://github.com/cloudflare/durable-objects-webpack-commonjs

🐛 v1.15.1

13 Apr 21:56
24b4156
Compare
Choose a tag to compare

1.15.1

  • Features

  • Fixes

    • fix: remove unused import of WasmMainTemplatePlugin - jasikpark, pull/1802

      This should improve #1721. #1721 (comment)

    • Hot fix for error message helper not working - Electroid, pull/1847

      The JSON is pretty printed, which means it contains a space.

    • Revert "Print line and column numbers for exception thrown (#1645)" - Electroid, pull/1835

      This reverts commit 74a89f7.

      Closes #1826

      This commit is causing wrangler dev to not show uncaught exceptions. Reverting chrome-devtools-rs was also necessary.

v1.15.0-custom-builds-rc.2

30 Mar 20:59
1b8771d
Compare
Choose a tag to compare
Pre-release

This beta release is now out of date, it has been replaced by v1.16.0-durable-objects-rc.0

v1.15.0-custom-builds-rc.1

22 Mar 16:46
aba3051
Compare
Choose a tag to compare
Pre-release

This beta release is now out of date, it has been replaced by v1.15.0-custom-builds-rc.2

v1.15.0-custom-builds-rc.0

09 Mar 01:02
45f3e68
Compare
Choose a tag to compare
Pre-release

This beta release is now out of date, it has been replaced by v1.15.0-custom-builds-rc.1

v1.15.0

08 Mar 16:57
8f92e41
Compare
Choose a tag to compare
  • Fixes

    • fix: remove unused import of WasmMainTemplatePlugin - jasikpark, pull/1802

      This should improve #1721. #1721 (comment)

    • Revert pull/1748 - xortive, pull/1804

      pull/1748 turned out to interact poorly with workers-sites projects, causing npm install to not be run, breaking the build.

      We're going to revert this change. Folks already depending on it should use custom builds (pull/1677) once it makes it into a release candidate.

      We incremented the minor version number instead of making a patch release, as this change is more significant than a simple bugfix.

v1.14.1

05 Mar 15:36
c6b61cd
Compare
Choose a tag to compare

1.14.1

  • Fixes

    • revert default install location change - xortive, pull/1798

      In 1.14.0, we changed the default install location from ~/.wrangler to node_modules,
      to allow npx wrangler to use the pinned version in a project's dependencies. It seems that
      this is causing issues, so we're rolling it back in favor of having folks who want this behavior,
      to specify a the install location in the config section of package.json. We'll document this soon.

1.14.0

  • 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

      [email protected] 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

      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 :)