github cloudflare/workers-sdk wrangler@4.13.0

Minor Changes

  • #8640 5ce70bd Thanks @kentonv! - Add support for defining props on a Service binding.

    In your configuration file, you can define a service binding with props:

    {
    	"services": [
    		{
    			"binding": "MY_SERVICE",
    			"service": "some-worker",
    			"props": { "foo": 123, "bar": "value" }
    		}
    	]
    }

    These can then be accessed by the callee:

    import { WorkerEntrypoint } from "cloudflare:workers";
    
    export default class extends WorkerEntrypoint {
    	fetch() {
    		return new Response(JSON.stringify(this.ctx.props));
    	}
    }
  • #8771 0cfcfe0 Thanks @dario-piotrowicz! - feat: add config.keep_names option

    Adds a new option to Wrangler to allow developers to opt out of esbuild's keep_names option (https://esbuild.github.io/api/#keep-names). By default, Wrangler sets this to true

    This is something developers should not usually need to care about, but sometimes
    keep_names can create issues, and in such cases they will be now able to opt-out.

    Example wrangler.jsonc:

    {
    	"name": "my-worker",
    	"main": "src/worker.ts",
    	"keep_names": false
    }

Patch Changes

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.