github cloudflare/workers-sdk wrangler@2.8.1

latest releases: wrangler@3.63.1, @cloudflare/vitest-pool-workers@0.4.9, wrangler@3.63.0...
17 months ago

Patch Changes

  • #2501 a0e5a491 Thanks @geelen! - fix: make it possible to query d1 databases from durable objects

    This PR makes it possible to access D1 from Durable Objects.

    To be able to query D1 from your Durable Object, you'll need to install the latest version of wrangler, and redeploy your Worker.

    For a D1 binding like:

    [[d1_databases]]
    binding = "DB" # i.e. available in your Worker on env.DB
    database_name = "my-database-name"
    database_id = "UUID-GOES-HERE"
    preview_database_id = "UUID-GOES-HERE"

    You'll be able to access your D1 database via env.DB in your Durable Object.

  • #2280 ef110923 Thanks @penalosa! - Support queue and trace events in module middleware. This means that queue and trace events should work properly with the --test-scheduled flag

  • #2526 69d379a4 Thanks @jrf0110! - Adds unstable_pages module to JS API

  • #2558 b910f644 Thanks @caass! - Add metrics for deployments

  • #2554 fbeaf609 Thanks @CarmenPopoviciu! - feat: Add support for wasm module imports in wrangler pages dev

    Currently it is not possible to import wasm modules in either Pages
    Functions or Pages Advanced Mode projects.

    This commit caries out work to address the aforementioned issue by
    enabling wasm module imports in wrangler pages dev. As a result,
    Pages users can now import their wasm modules withing their Functions
    or _worker.js files, and wrangler pages dev will correctly bundle
    everything and serve these "external" modules.

    import hello from "./hello.wasm"
    
    export async function onRequest() {
    	const module = await WebAssembly.instantiate(hello);
    	return new Response(module.exports.hello);
    }
    
  • #2563 5ba39569 Thanks @CarmenPopoviciu! - fix: Copy module imports related files to outdir

    When we bundle a Worker esbuild takes care of writing the
    results to the output directory. However, if the Worker contains
    any external imports, such as text/wasm/binary module imports,
    that cannot be inlined into the same bundle file, bundleWorker
    will not copy these files to the output directory. This doesn't
    affect wrangler publish per se, because of how the Worker
    upload FormData is created. It does however create some
    inconsistencies when running wrangler publish --outdir or
    wrangler publish --outdir --dry-run, in that, outdir will
    not contain those external import files.

    This commit addresses this issue by making sure the aforementioned
    files do get copied over to outdir together with esbuild's
    resulting bundle files.

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.