github cloudflare/workers-sdk wrangler@2.9.0

latest releases: wrangler@3.79.0, @cloudflare/vitest-pool-workers@0.5.13, @cloudflare/quick-edit@0.2.3...
20 months ago

Minor Changes

  • #2629 151733e5 Thanks @mrbbot! - Prefer the workerd exports condition when bundling.

    This can be used to build isomorphic libraries that have different implementations depending on the JavaScript runtime they're running in.
    When bundling, Wrangler will try to load the workerd key.
    This is the standard key for the Cloudflare Workers runtime.
    Learn more about the conditional exports field here.

Patch Changes

  • #2409 89d78c0a Thanks @penalosa! - Wrangler now supports an --experimental-json-config flag which will read your configuration from a wrangler.json file, rather than wrangler.toml. The format of this file is exactly the same as the wrangler.toml configuration file, except that the syntax is JSONC (JSON with comments) rather than TOML. This is experimental, and is not recommended for production use.

  • #2623 04d8a312 Thanks @dario-piotrowicz! - fix d1 directory not being created when running the wrangler d1 execute command with the --yes/-y flag

  • #2608 70daffeb Thanks @dario-piotrowicz! - fix: Add support for D1 databases when bundling an _worker.js on wrangler pages publish

  • #2597 416babf0 Thanks @petebacondarwin! - fix: do not crash in wrangler dev when passing a request object to fetch

    This reverts and fixes the changes in #1769
    which does not support creating requests from requests whose bodies have already been consumed.

    Fixes #2562

  • #2622 9778b33e Thanks @rozenmd! - fix: implement d1 list --json with clean output for piping into other commands

    Before:

    rozenmd@cflaptop test % npx wrangler d1 list
    --------------------
    🚧 D1 is currently in open alpha and is not recommended for production data and traffic
    🚧 Please report any bugs to https://github.com/cloudflare/wrangler2/issues/new/choose
    🚧 To request features, visit https://community.cloudflare.com/c/developers/d1
    🚧 To give feedback, visit https://discord.gg/cloudflaredev
    --------------------
    
    ┌──────────────────────────────┬─────────────────┐
    │ uuid                         │ name            │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test            │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test2           │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test3           │
    └──────────────────────────────┴─────────────────┘

    After:

    rozenmd@cflaptop test % npx wrangler d1 list --json
    [
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test"
      },
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test2"
      },
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test3"
      },
    ]
  • #2631 6b3fe5ef Thanks @thibmeu! - Fix wrangler publish --dry-run to not require authentication when using Queues

  • #2627 6f0f2ba6 Thanks @rozenmd! - fix: implement d1 execute --json with clean output for piping into other commands

    Before:

    rozenmd@cflaptop test1 % npx wrangler d1 execute test --command="select * from customers"
    ▲ [WARNING] Processing wrangler.toml configuration:
    
        - D1 Bindings are currently in alpha to allow the API to evolve before general availability.
          Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
          Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
    
          For example: `export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>`
    
    --------------------
    
      🚧 D1 is currently in open alpha and is not recommended for production data and traffic
      🚧 Please report any bugs to <https://github.com/cloudflare/wrangler2/issues/new/choose>
      🚧 To request features, visit <https://community.cloudflare.com/c/developers/d1>
      🚧 To give feedback, visit <https://discord.gg/cloudflaredev>
    
    --------------------
    
      🌀 Mapping SQL input into an array of statements
      🌀 Parsing 1 statements
      🌀 Executing on test (xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx):
      🚣 Executed 1 command in 11.846710999961942ms
      ┌────────────┬─────────────────────┬───────────────────┐
      │ CustomerID │ CompanyName         │ ContactName       │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 1          │ Alfreds Futterkiste │ Maria Anders      │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 4          │ Around the Horn     │ Thomas Hardy      │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 11         │ Bs Beverages        │ Victoria Ashworth │
      ├────────────┼─────────────────────┼───────────────────┤
      │ 13         │ Bs Beverages        │ Random Name       │
      └────────────┴─────────────────────┴───────────────────┘
    

    After:

    rozenmd@cflaptop test1 % npx wrangler d1 execute test --command="select * from customers" --json
    [
      {
        "results": [
          {
            "CustomerID": 1,
            "CompanyName": "Alfreds Futterkiste",
            "ContactName": "Maria Anders"
          },
          {
            "CustomerID": 4,
            "CompanyName": "Around the Horn",
            "ContactName": "Thomas Hardy"
          },
          {
            "CustomerID": 11,
            "CompanyName": "Bs Beverages",
            "ContactName": "Victoria Ashworth"
          },
          {
            "CustomerID": 13,
            "CompanyName": "Bs Beverages",
            "ContactName": "Random Name"
          }
        ],
        "success": true,
        "meta": {
          "duration": 1.662519000004977,
          "last_row_id": null,
          "changes": null,
          "served_by": "primary-xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.db3",
          "internal_stats": null
        }
      }
    ]

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.