Minor Changes
-
#5282
b7ddde1
Thanks @maxwellpeterson! - feature: Add source map support for WorkersAdds the
source_maps
boolean config option. When enabled, source maps included in the build output are uploaded alongside the built code modules. Uploaded source maps can then be used to remap stack traces emitted by the Workers runtime. -
#5215
cd03d1d
Thanks @GregBrimble! - feature: support named entrypoints in service bindingsThis change allows service bindings to bind to a named export of another Worker. As an example, consider the following Worker named
bound
:import { WorkerEntrypoint } from "cloudflare:workers"; export class EntrypointA extends WorkerEntrypoint { fetch(request) { return new Response("Hello from entrypoint A!"); } } export const entrypointB: ExportedHandler = { fetch(request, env, ctx) { return new Response("Hello from entrypoint B!"); } }; export default <ExportedHandler>{ fetch(request, env, ctx) { return new Response("Hello from the default entrypoint!"); } };
Up until now, you could only bind to the
default
entrypoint. With this change, you can bind toEntrypointA
orentrypointB
too using the newentrypoint
option:[[services]] binding = "SERVICE" service = "bound" entrypoint = "EntrypointA"
To bind to named entrypoints with
wrangler pages dev
, use the#
character:$ wrangler pages dev --service=SERVICE=bound#EntrypointA
Patch Changes
-
#5215
cd03d1d
Thanks @GregBrimble! - fix: ensure requesturl
andcf
properties preserved across service bindingsPreviously, Wrangler could rewrite
url
andcf
properties when sending requests via service bindings or Durable Object stubs. To match production behaviour, this change ensures these properties are preserved. -
Updated dependencies [
cd03d1d
,6c3be5b
,cd03d1d
,cd03d1d
]:- miniflare@3.20240403.0