Skip to content

Releases: cloudflare/workers-sdk

[email protected]

16 Nov 12:17
d4c22b8
Compare
Choose a tag to compare

Patch Changes

[email protected]

16 Nov 11:31
75b229f
Compare
Choose a tag to compare

Patch Changes

[email protected]

15 Nov 20:23
28326c2
Compare
Choose a tag to compare

Minor Changes

Patch Changes

  • #2178 d165b741 Thanks @JacobMGEvans! - [feat] Queues generated type:
    Added the ability to generate manual types for Queues from
    Wrangler configuration.

[email protected]

15 Nov 18:12
bd3e28d
Compare
Choose a tag to compare

Patch Changes

[email protected]

14 Nov 17:38
ac4deef
Compare
Choose a tag to compare

Patch Changes

  • #2172 47a142af Thanks @KianNH! - Validate object size for wrangler r2 put

  • #2161 dff756f3 Thanks @jbw1991! - Check for the correct API error code when attempting to detect missing Queues.

  • #2165 a26f74ba Thanks @JacobMGEvans! - Fix Var string type:
    The type was not being coerced to a string, so TypeScript considered it a unresolved type.

[email protected]

11 Nov 06:06
2c87b0f
Compare
Choose a tag to compare

Patch Changes

[email protected]

11 Nov 01:05
817f5cc
Compare
Choose a tag to compare

Minor Changes

  • #2107 511943e9 Thanks @celso! - fix: D1 execute and backup commands improvements

    • Better and faster handling when importing big SQL files using execute --file
    • Increased visibility during imports, sends output with each batch API call
    • Backups are now downloaded to the directory where wrangler was initiated from
  • #2130 68f4fa6f Thanks @matthewdavidrodgers! - feature: Add warnings around bundle sizes for large scripts

    Prints a warning for scripts > 1MB compressed, encouraging smaller
    script sizes. This warning can be silenced by setting the
    NO_SCRIPT_SIZE_WARNING env variable

    If a publish fails with either a script size error or a validator error
    on script startup (CPU or memory), we print out the largest 5
    dependencies in your bundle. This is accomplished by using the esbuild
    generated metafile.

  • #2064 49b6a484 Thanks @jbw1991! - Adds support for Cloudflare Queues. Adds new CLI commands to configure Queues. Queue producers and consumers can be defined in wrangler.toml.

  • #1982 5640fe88 Thanks @penalosa! - Enable support for wrangler dev on Workers behind Cloudflare Access, utilising cloudflared. If you don't have cloudflared installed, Wrangler will prompt you to install it. If you do, then the first time you start developing using wrangler dev your default browser will open with a Cloudflare Access prompt.

Patch Changes

  • #2134 b164e2d6 Thanks @jspspike! - Added current version to publish output

  • #2127 0e561e83 Thanks @JacobMGEvans! - Fix: Missing Worker name using --from-dash
    Added the --from-dash name as a fallback when no name is provided in the wrangler init command.
    Additionally added a checks to the std.out to ensure that the name is provided.

    resolves #1853

  • #2073 1987a79d Thanks @mrbbot! - If --env <env> is specified, we'll now check .env.<env>/.dev.vars.<env> first.
    If they don't exist, we'll fallback to .env/.dev.vars.

  • #2072 06aa6121 Thanks @mrbbot! - Fixed importing installed npm packages with the same name as Node built-in
    modules if node_compat is disabled.

  • #2124 02ca556c Thanks @JacobMGEvans! - Computing the name from binding response
    Now the vars will be computed, example:
    [var.binding.name]: var.binding.text

    this will resolve the issue that was occurring with
    generating a TOML with incorrect fields for the vars key/value pair.

    resolves #2048

@cloudflare/[email protected]

11 Nov 01:05
817f5cc
Compare
Choose a tag to compare

Patch Changes

[email protected]

02 Nov 17:21
9f509bc
Compare
Choose a tag to compare

Patch Changes

  • #2103 f1fd62a1 Thanks @GregBrimble! - fix: Don't upload functions/ directory as part of wrangler pages publish

    If the root directory of a project was the same as the build output directory, we were previously uploading the functions/ directory as static assets. This PR now ensures that the functions/ files are only used to create Pages Functions and are no longer uploaded as static assets.

    Additionally, we also now do upload _worker.js, _headers, _redirects and _routes.json if they aren't immediate children of the build output directory. Previously, we'd ignore all files with this name regardless of location. For example, if you have a public/blog/how-to-use-pages/_headers file (where public is your build output directory), we will now upload the _headers file as a static asset.

  • #2111 ab52f771 Thanks @GregBrimble! - feat: Add a passThroughOnException() handler in Pages Functions

    This passThroughOnException() handler is not as good as the built-in for Workers. We're just adding it now as a stop-gap until we can do the behind-the-scenes plumbing required to make the built-in function work properly.

    We wrap your Pages Functions code in a try/catch and on failure, if you call passThroughOnException() we defer to the static assets of your project.

    For example:

    export const onRequest = ({ passThroughOnException }) => {
    	passThroughOnException();
    
    	x; // Would ordinarily throw an error, but instead, static assets are served.
    };
  • #2117 aa08ff7c Thanks @nprogers! - Added error logging for pages upload

[email protected]

01 Nov 17:44
0d2d6bf
Compare
Choose a tag to compare

Patch Changes

  • #2074 b08ab1e5 Thanks @JacobMGEvans! - The type command aggregates bindings and custom module rules from config, then generates a DTS file for both service workers' declare global { ... } or module workers' interface Env { ... }

    Custom module rules generate declare modules based on the module type (Text, Data or CompiledWasm).
    Module Example Outputs:

    CompiledWasm

    declare module "**/*.wasm" {
    	const value: WebAssembly.Module;
    	export default value;
    }

    Data

    declare module "**/*.webp" {
    	const value: ArrayBuffer;
    	export default value;
    }

    Text

    declare module "**/*.text" {
    	const value: string;
    	export default value;
    }

    resolves #2034
    resolves #2033

  • #2065 14c44588 Thanks @CarmenPopoviciu! - fix(pages): wrangler pages dev matches routing rules in _routes.json too loosely

    Currently, the logic by which we transform routing rules in _routes.json to
    regular expressions, so we can perform pathname matching & routing when we
    run wrangler pages dev, is too permissive, and leads to serving incorrect
    assets for certain url paths.

    For example, a routing rule such as /foo will incorrectly match pathname
    /bar/foo. Similarly, pathname /foo will be incorrectly matched by the
    / routing rule.
    This commit fixes our routing rule to pathname matching logic and brings
    wrangler pages dev on par with routing in deployed Pages projects.

  • #2098 2a81caee Thanks @threepointone! - feat: delete site/assets namespace when a worker is deleted

    This patch deletes any site/asset kv namespaces associated with a worker when wrangler delete is used. It finds the namespace associated with a worker by using the names it would have otherwise used, and deletes it. It also does the same for the preview namespace that's used with wrangler dev.

  • #2091 9491d86f Thanks @JacobMGEvans! - Wrangler deployments command
    Added support for the deployments command, which allows you to list the last ten deployments for a given script.

    The information will include:

    • Version ID
    • Version number
    • Author email
    • Latest deploy
    • Created on

    resolves #2089

  • #2068 2c1fd9d2 Thanks @mrbbot! - Fixed issue where information and warning messages from Miniflare were being
    discarded when using wrangler dev --local. Logs from Miniflare will now be
    coloured too, if the terminal supports this.