github cloudflare/workers-sdk wrangler@2.0.28

latest releases: create-cloudflare@2.32.1, wrangler@3.86.1, @cloudflare/vitest-pool-workers@0.5.27...
2 years ago

Patch Changes

  • #1725 eb75413e Thanks @threepointone! - rename: worker_namespaces / dispatch_namespaces

    The Worker-for-Platforms team would like to rename this field to more closely match what it's called internally. This fix does a search+replace on this term. This feature already had an experimental warning, and no one's using it at the moment, so we're not going to add a warning/backward compat for existing customers.

  • #1736 800f8553 Thanks @threepointone! - fix: do not delete previously defined plain_text/json bindings on publish

    Currently, when we publish a worker, we delete an pre-existing bindings if they're not otherwise defined in wrangler.toml, and overwrite existing ones. But folks may be deploying with wrangler, and changing environment variables on the fly (like marketing messages, etc). It's annoying when deploying via wrangler blows away those values.

    This patch fixes one of those issues. It will not delete any older bindings that are not in wrangler.toml. It still does overwrite existing vars, but at least this gives a way for developers to have some vars that are not blown away on every publish.

  • #1726 0b83504c Thanks @GregBrimble! - fix: Multiworker and static asset dev bug preventing both from being used

    There was previously a collision on the generated filenames which resulted in the generated scripts looping and crashing in Miniflare with error code 7. By renaming one of the generated files, this is avoided.

  • #1718 02f1fe9b Thanks @threepointone! - fix: use config.dev.ip when provided

    Because we'd used a default for 0.0.0.0 for the --ip flag, wrangler dev was overriding the value specified in wrangler.toml under dev.ip. This fix removes the default value (since it's being set when normalising config anyway).

    Fixes #1714

  • #1727 3f9e8f63 Thanks @rozenmd! - fix: refresh token when we detect that the preview session has expired (error code 10049)

    When running wrangler dev, from time to time the preview session token would expire, and the dev server would need to be manually restarted. This fixes this, by refreshing the token when it expires.

    Closes #1446

  • #1730 27ad80ee Thanks @threepointone! - feat: --var name:value and --define name:value

    This enables passing values for [vars] and [define] via the cli. We have a number of usecases where the values to be injected during dev/publish aren't available statically (eg: a version string, some identifier for 3p libraries, etc) and reading those values only from wrangler.toml isn't good ergonomically. So we can now read those values when passed through the CLI.

    Example: add a var during dev: wrangler dev --var xyz:123 will inject the var xyz with string "123"

    (note, only strings allowed for --var)

    substitute a global value: wrangler dev --define XYZ:123 will replace every global identifier XYZ with the value 123.

    The same flags also work with wrangler publish.

    Also, you can use actual environment vars in these commands. e.g.: wrangler dev --var xyz:$XYZ will set xyz to whatever XYZ has been set to in the terminal environment.

  • #1700 d7c23e49 Thanks @penalosa! - Closes #1505 by extending wrangler tail to allow for passing worker routes as well as worker script names.

    For example, if you have a worker example-worker assigned to the route example.com/*, you can retrieve it's logs by running either wrangler tail example.com/* or wrangler tail example-worker—previously only wrangler tail example-worker was supported.

  • #1720 f638de64 Thanks @mrbbot! - Upgrade miniflare to 2.7.1 incorporating changes from 2.7.0

  • #1691 5b2c3ee2 Thanks @cameron-robey! - chore: bump undici and increase minimum node version to 16.13

    • We bump undici to version to 5.9.1 to patch some security vulnerabilities in previous versions
    • This requires bumping the minimum node version to >= 16.8 so we update the minimum to the LTS 16.13

    Fixes #1679
    Fixes #1684

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.