Skip to content

Releases: cloudflare/workers-sdk

wrangler@4.142.0

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:11
f96458c

Minor Changes

  • #15856 4c2993b Thanks @Naapperas! - Support Workflows declared in exports on ctx.exports in local development

    A Workflow declared in a Worker's exports is now available on ctx.exports in wrangler dev, the Vite plugin and the Vitest plugin, with the same API as a Workflow binding:

    const instance = await ctx.exports.MyWorkflow.create({
      params: { name: "World" },
    });

    ctx.exports and workflows bindings with the same Workflow name share their instances, including instances created before the Workflow was declared in exports. Two Workers can't export the same Workflow name, and a binding to an exported Workflow must refer to the Worker and class that export it. getPlatformProxy() ignores Workflows declared in exports, since it doesn't run the Worker's code.

    wrangler workflows commands run with --local also work with Workflows declared only in exports, without a workflows binding.

    In the Vitest plugin, introspectWorkflow() and introspectWorkflowInstance() still need a Workflow binding, and now explain how to add one when passed a Workflow from ctx.exports. Instances created through ctx.exports are introspected too. A workflows binding whose script_name is the Worker's own name now resolves to the Worker itself again.

Patch Changes

@cloudflare/workflows-shared@0.15.0

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:11
f96458c

Minor Changes

  • #15856 4c2993b Thanks @Naapperas! - Support Workflows declared in exports on ctx.exports in local development

    A Workflow declared in a Worker's exports is now available on ctx.exports in wrangler dev, the Vite plugin and the Vitest plugin, with the same API as a Workflow binding:

    const instance = await ctx.exports.MyWorkflow.create({
      params: { name: "World" },
    });

    ctx.exports and workflows bindings with the same Workflow name share their instances, including instances created before the Workflow was declared in exports. Two Workers can't export the same Workflow name, and a binding to an exported Workflow must refer to the Worker and class that export it. getPlatformProxy() ignores Workflows declared in exports, since it doesn't run the Worker's code.

    wrangler workflows commands run with --local also work with Workflows declared only in exports, without a workflows binding.

    In the Vitest plugin, introspectWorkflow() and introspectWorkflowInstance() still need a Workflow binding, and now explain how to add one when passed a Workflow from ctx.exports. Instances created through ctx.exports are introspected too. A workflows binding whose script_name is the Worker's own name now resolves to the Worker itself again.

@cloudflare/vitest-plugin@1.3.0

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:11
f96458c

Minor Changes

  • #15856 4c2993b Thanks @Naapperas! - Support Workflows declared in exports on ctx.exports in local development

    A Workflow declared in a Worker's exports is now available on ctx.exports in wrangler dev, the Vite plugin and the Vitest plugin, with the same API as a Workflow binding:

    const instance = await ctx.exports.MyWorkflow.create({
      params: { name: "World" },
    });

    ctx.exports and workflows bindings with the same Workflow name share their instances, including instances created before the Workflow was declared in exports. Two Workers can't export the same Workflow name, and a binding to an exported Workflow must refer to the Worker and class that export it. getPlatformProxy() ignores Workflows declared in exports, since it doesn't run the Worker's code.

    wrangler workflows commands run with --local also work with Workflows declared only in exports, without a workflows binding.

    In the Vitest plugin, introspectWorkflow() and introspectWorkflowInstance() still need a Workflow binding, and now explain how to add one when passed a Workflow from ctx.exports. Instances created through ctx.exports are introspected too. A workflows binding whose script_name is the Worker's own name now resolves to the Worker itself again.

Patch Changes

@cloudflare/vite-plugin@1.61.0

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:12
f96458c

Minor Changes

  • #15856 4c2993b Thanks @Naapperas! - Support Workflows declared in exports on ctx.exports in local development

    A Workflow declared in a Worker's exports is now available on ctx.exports in wrangler dev, the Vite plugin and the Vitest plugin, with the same API as a Workflow binding:

    const instance = await ctx.exports.MyWorkflow.create({
      params: { name: "World" },
    });

    ctx.exports and workflows bindings with the same Workflow name share their instances, including instances created before the Workflow was declared in exports. Two Workers can't export the same Workflow name, and a binding to an exported Workflow must refer to the Worker and class that export it. getPlatformProxy() ignores Workflows declared in exports, since it doesn't run the Worker's code.

    wrangler workflows commands run with --local also work with Workflows declared only in exports, without a workflows binding.

    In the Vitest plugin, introspectWorkflow() and introspectWorkflowInstance() still need a Workflow binding, and now explain how to add one when passed a Workflow from ctx.exports. Instances created through ctx.exports are introspected too. A workflows binding whose script_name is the Worker's own name now resolves to the Worker itself again.

Patch Changes

@cloudflare/runtime-types@0.1.4

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:11
f96458c

Patch Changes

@cloudflare/remote-bindings@0.0.37

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:11
f96458c

Patch Changes

@cloudflare/pages-shared@0.13.190

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:12
f96458c

Patch Changes

@cloudflare/deploy-helpers@0.18.1

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:12
f96458c

Patch Changes

@cloudflare/containers-shared@0.20.3

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:11
f96458c

Patch Changes

  • Updated dependencies [cde5d99, 77e79b2]:
    • @cloudflare/config@0.20.0
    • @cloudflare/build-output-utils@0.8.2
    • @cloudflare/workers-utils@0.44.0

@cloudflare/config@0.20.0

Choose a tag to compare

@workers-devprod workers-devprod released this 27 Sep 14:11
f96458c

Minor Changes

  • #15877 cde5d99 Thanks @jamesopstad! - Add cross-Worker Workflow bindings to the experimental configuration API

    Workflow bindings can now identify a Workflow by name and reference the Worker and exported WorkflowEntrypoint class that define it.

Patch Changes

  • #15880 77e79b2 Thanks @jamesopstad! - Restore configuration field documentation in define* helpers

    VS Code now displays JSDoc for fields passed to defineConfig, defineContainer, and defineWorker while retaining their exact inferred config types.