Skip to content

Releases: cloudflare/workers-sdk

wrangler@3.11.0

05 Oct 19:53
12a6f5e
Compare
Choose a tag to compare

Minor Changes

  • #3726 7d20bdbd Thanks @petebacondarwin! - feat: support partial bundling with configurable external modules

    Setting find_additional_modules to true in your configuration file will now instruct Wrangler to look for files in
    your base_dir that match your configured rules, and deploy them as unbundled, external modules with your Worker.
    base_dir defaults to the directory containing your main entrypoint.

    Wrangler can operate in two modes: the default bundling mode and --no-bundle mode. In bundling mode, dynamic imports
    (e.g. await import("./large-dep.mjs")) would be bundled into your entrypoint, making lazy loading less effective.
    Additionally, variable dynamic imports (e.g. await import(`./lang/${language}.mjs`)) would always fail at runtime,
    as Wrangler would have no way of knowing which modules to upload. The --no-bundle mode sought to address these issues
    by disabling Wrangler's bundling entirely, and just deploying code as is. Unfortunately, this also disabled Wrangler's
    code transformations (e.g. TypeScript compilation, --assets, --test-scheduled, etc).

    With this change, we now additionally support partial bundling. Files are bundled into a single Worker entry-point file
    unless find_additional_modules is true, and the file matches one of the configured rules. See
    https://developers.cloudflare.com/workers/wrangler/bundling/ for more details and examples.

  • #4093 c71d8a0f Thanks @mrbbot! - chore: bump miniflare to 3.20231002.0

Patch Changes

  • #3726 7d20bdbd Thanks @petebacondarwin! - fix: ensure that additional modules appear in the out-dir

    When using find_additional_modules (or no_bundle) we find files that
    will be uploaded to be deployed alongside the Worker.

    Previously, if an outDir was specified, only the Worker code was output
    to this directory. Now all additional modules are also output there too.

  • #4067 31270711 Thanks @mrbbot! - fix: generate valid source maps with wrangler pages dev on macOS

    On macOS, wrangler pages dev previously generated source maps with an
    incorrect number of ../s in relative paths. This change ensures paths are
    always correct, improving support for breakpoint debugging.

  • #4084 9a7559b6 Thanks @RamIdeas! - fix: respect the options.local value in unstable_dev (it was being ignored)

  • #4107 807ab931 Thanks @mrbbot! - chore: bump miniflare to 3.20231002.1

  • #3726 7d20bdbd Thanks @petebacondarwin! - fix: allow __STATIC_CONTENT_MANIFEST module to be imported anywhere

    __STATIC_CONTENT_MANIFEST can now be imported in subdirectories when
    --no-bundle or find_additional_modules are enabled.

  • #3926 f585f695 Thanks @penalosa! - Log more detail about tokens after authentication errors

  • #3695 1d0b7ad5 Thanks @JacksonKearl! - Fixed pages dev crashing and leaving port open when building a worker script fails

  • #4066 c8b4a07f Thanks @RamIdeas! - fix: we no longer infer pathnames from route patterns as the host

    During local development, inside your worker, the host of request.url is inferred from the routes in your config.

    Previously, route patterns like "*/some/path/name" would infer the host as "some". We now handle this case and determine we cannot infer a host from such patterns.

create-cloudflare@2.4.0

05 Oct 19:53
12a6f5e
Compare
Choose a tag to compare

Minor Changes

  • #4063 cb4309f9 Thanks @jculvey! - Bump supported node version to 18.14.1

    We've recently switched out testing infrastructure to test C3 on node version 18.14.1.
    As of earlier this month, Node v16 is no longer supported, and many of the underlying
    framework scaffolding tools that C3 uses (ex. create-astro, gatsby) have dropped
    support for node v16, which in turn causes C3 to fail for those frameworks.

  • #4065 55298d9f Thanks @jculvey! - Add support for bun

Patch Changes

@cloudflare/pages-shared@0.10.0

05 Oct 19:53
12a6f5e
Compare
Choose a tag to compare

Minor Changes

Patch Changes

wrangler@3.10.1

28 Sep 17:48
f025b61
Compare
Choose a tag to compare

Patch Changes

  • #4041 6b1c327d Thanks @elithrar! - Fixed a bug in Vectorize that send preset configurations with the wrong key. This was patched on the server-side to work around this for users in the meantime.

  • #4054 f8c52b93 Thanks @mrbbot! - fix: allow wrangler pages dev sessions to be reloaded

    Previously, wrangler pages dev attempted to send messages on a closed IPC
    channel when sources changed, resulting in an ERR_IPC_CHANNEL_CLOSED error.
    This change ensures the channel stays open until the user exits wrangler pages dev.

wrangler@3.10.0

26 Sep 17:53
2b71e22
Compare
Choose a tag to compare

Minor Changes

Patch Changes

  • #4034 bde9d64a Thanks @ndisidore! - Adds Vectorize support uploading batches of newline delimited json (ndjson)
    vectors from a source file.
    Load a dataset with vectorize insert my-index --file vectors.ndjson

  • #4028 d5389731 Thanks @JacobMGEvans! - fix: Bulk Secret Draft Worker

    Fixes the issue of a upload of a Secret when a Worker doesn't exist yet, the draft worker is created and the secret is uploaded to it.

    Fixes cloudflare/wrangler-action#162

wrangler@3.9.1

25 Sep 17:05
63e937a
Compare
Choose a tag to compare

Patch Changes

  • #3992 35564741 Thanks @edevil! - Add AI binding that will be used to interact with the AI project.

    Example wrangler.toml

    name = "ai-worker"
    main = "src/index.ts"
    
    [ai]
    binding = "AI"
    

    Example script:

    import Ai from "@cloudflare/ai"
    
    export default {
        async fetch(request: Request, env: Env): Promise<Response> {
            const ai = new Ai(env.AI);
    
            const story = await ai.run({
                model: 'llama-2',
                input: {
                    prompt: 'Tell me a story about the future of the Cloudflare dev platform'
                }
            });
    
        return new Response(JSON.stringify(story));
        },
    };
    
    export interface Env {
        AI: any;
    }
    
  • #4006 bc8c147a Thanks @rozenmd! - fix: remove warning around using D1's binding, and clean up the epilogue when running D1 commands

  • #4027 9e466599 Thanks @jspspike! - Add WebGPU support through miniflare update

  • #3986 00247a8d Thanks @edevil! - Added AI related CLI commands

create-cloudflare@2.3.1

25 Sep 17:05
63e937a
Compare
Choose a tag to compare

Patch Changes

wrangler@3.9.0

20 Sep 16:29
d72722f
Compare
Choose a tag to compare

Note this release changes the layout of persisted data in the .wrangler folder. KV namespaces, R2 buckets and D1 databases will automatically be migrated to the new layout. See the corresponding miniflare@3.20230918.0 release notes for more information.

Minor Changes

  • #3951 e0850ad1 Thanks @mrbbot! - feat: add support for breakpoint debugging to wrangler dev's --remote and --no-bundle modes

    Previously, breakpoint debugging using Wrangler's DevTools was only supported
    in local mode, when using Wrangler's built-in bundler. This change extends that
    to remote development, and --no-bundle.

    When using --remote and --no-bundle together, uncaught errors will now be
    source-mapped when logged too.

  • #3951 e0850ad1 Thanks @mrbbot! - feat: add support for Visual Studio Code's built-in breakpoint debugger

    Wrangler now supports breakpoint debugging with Visual Studio Code's debugger.
    Create a .vscode/launch.json file with the following contents...

    {
    	"configurations": [
    		{
    			"name": "Wrangler",
    			"type": "node",
    			"request": "attach",
    			"port": 9229,
    			"cwd": "/",
    			"resolveSourceMapLocations": null,
    			"attachExistingChildren": false,
    			"autoAttachChildProcesses": false
    		}
    	]
    }

    ...then run wrangler dev, and launch the configuration.

Patch Changes

  • #3954 bc88f0ec Thanks @dario-piotrowicz! - update wrangler pages dev D1 and DO descriptions

  • #3928 95b24b1e Thanks @JacobMGEvans! - Colorize Deployed Bundle Size
    Most bundlers, and other tooling that give you size outputs will colorize their the text to indicate if the value is within certain ranges.
    The current range values are:
    red 100% - 90%
    yellow 89% - 70%
    green <70%

    resolves #1312

create-cloudflare@2.3.0

20 Sep 16:29
d72722f
Compare
Choose a tag to compare

Minor Changes

Patch Changes

wrangler@3.8.0

13 Sep 20:38
789fd8b
Compare
Choose a tag to compare

Minor Changes

  • #3775 3af30879 Thanks @bthwaites! - R2 Jurisdictional Restrictions guarantee objects in a bucket are stored within a specific jurisdiction. Wrangler now allows you to interact with buckets in a defined jurisdiction.

    Wrangler R2 operations now support a -J flag that allows the user to specify a jurisdiction. When passing the -J flag, you will only be able to interact with R2 resources within that jurisdiction.

    # List all of the buckets in the EU jurisdiction
    wrangler r2 bucket list -J eu
    # Downloads the object 'myfile.txt' from the bucket 'mybucket' in EU jurisdiction
    wrangler r2 object get mybucket/myfile.txt -J eu

    To access R2 buckets that belong to a jurisdiction from Workers, you will need to specify the jurisdiction as well as the bucket name as part of your bindings in your wrangler.toml:

    [[r2_buckets]]
    bindings = [
      { binding = "MY_BUCKET", bucket_name = "<YOUR_BUCKET_NAME>", jurisdiction = "<JURISDICTION>" }
    ]

Patch Changes