Patch Changes
-
#2501
a0e5a491
Thanks @geelen! - fix: make it possible to query d1 databases from durable objectsThis 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! - Supportqueue
andtrace
events in module middleware. This means thatqueue
andtrace
events should work properly with the--test-scheduled
flag -
#2526
69d379a4
Thanks @jrf0110! - Adds unstable_pages module to JS API -
#2554
fbeaf609
Thanks @CarmenPopoviciu! - feat: Add support for wasm module imports inwrangler 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
enablingwasm
module imports inwrangler pages dev
. As a result,
Pages users can now import theirwasm
modules withing their Functions
or_worker.js
files, andwrangler 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 outdirWhen we bundle a Worker
esbuild
takes care of writing the
results to the output directory. However, if the Worker contains
anyexternal
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
affectwrangler publish
per se, because of how the Worker
upload FormData is created. It does however create some
inconsistencies when runningwrangler 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 tooutdir
together withesbuild
's
resulting bundle files.