Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency miniflare to v3 #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 20, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
miniflare (source) 2.14.2 -> 3.20240925.0 age adoption passing confidence

Release Notes

cloudflare/workers-sdk (miniflare)

v3.20240925.0

Compare Source

Patch Changes
  • #​6826 5e2e62c Thanks @​dependabot! - chore: update dependencies of "miniflare" package

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20240909.0 1.20240925.0
    @​cloudflare/workers-types ^4.20240909.0 ^4.20240925.0
  • #​6824 1c58a74 Thanks @​petebacondarwin! - fix: teach Miniflare about node_compat version date switch

    A compatibility of Sept 23, 2024 or later means that nodejs_compat is equivalent to nodejs_compat_v2.

v3.20240909.5

Compare Source

Patch Changes
  • #​6728 1ca313f Thanks @​emily-shen! - fix: remove filepath encoding on asset upload and handle sometimes-encoded characters

    Some characters like [ ] @​ are encoded by encodeURIComponent() but are often requested at an unencoded URL path.
    This change will make assets with filenames with these characters accessible at both the encoded and unencoded paths,
    but to use the encoded path as the canonical one, and to redirect requests to the canonical path if necessary.

v3.20240909.4

Compare Source

Patch Changes

v3.20240909.3

Patch Changes
  • #​6514 2407c41 Thanks @​CarmenPopoviciu! - fix: Fix Miniflare regression introduced in #​5570

    PR #​5570 introduced a regression in Miniflare, namely that declaring Queue Producers like queueProducers: { "MY_QUEUE": "my-queue" } no longer works. This commit fixes the issue.

    Fixes #​5908

v3.20240909.2

Patch Changes

v3.20240909.1

Compare Source

Minor Changes

v3.20240909.0

Compare Source

Patch Changes

v3.20240821.2

Compare Source

Patch Changes
  • #​6627 5936282 Thanks @​GregBrimble! - fix: Fixes max asset count error message to properly report count of assets

  • #​6612 6471090 Thanks @​dario-piotrowicz! - fix: add hyperdrive bindings support in getBindings

    Note: the returned binding values are no-op/passthrough that can be used inside node.js, meaning
    that besides direct connections via the connect methods, all the other values point to the
    same db connection specified in the user configuration

v3.20240821.1

Compare Source

Patch Changes
  • #​6564 e8975a9 Thanks @​emily-shen! - feat: add assets plugin to miniflare

    New miniflare plugin for Workers + Assets, with relevant services imported from workers-shared.

v3.20240821.0

Compare Source

Patch Changes

v3.20240806.1

Compare Source

Minor Changes
  • #​6403 00f340f Thanks @​CarmenPopoviciu! - feat: Extend KV plugin behaviour to support Workers assets

    This commit extends Miniflare's KV plugin's behaviour to support Workers assets, and therefore enables the emulation of Workers with assets in local development.

v3.20240806.0

Compare Source

Patch Changes

v3.20240725.0

Compare Source

Patch Changes

v3.20240718.1

Compare Source

Patch Changes

v3.20240718.0

Compare Source

Patch Changes

v3.20240712.0

Compare Source

Patch Changes

v3.20240701.0

Compare Source

Minor Changes
Patch Changes

v3.20240620.0

Compare Source

Patch Changes

v3.20240610.1

Compare Source

Patch Changes
  • #​6050 a0c3327 Thanks @​threepointone! - chore: Normalize more deps

    This is the last of the patches that normalize dependencies across the codebase. In this batch: ws, vitest, zod , rimraf, @types/rimraf, ava, source-map, glob, cookie, @types/cookie, @microsoft/api-extractor, @types/mime, @types/yargs, devtools-protocol, @vitest/ui, execa, strip-ansi

    This patch also sorts dependencies in every package.json

  • #​6029 f5ad1d3 Thanks @​threepointone! - chore: Normalize some dependencies in workers-sdk

    This is the first of a few expected patches that normalize dependency versions, This normalizes undici, concurrently, @types/node, react, react-dom, @types/react, @types/react-dom, eslint, typescript. There are no functional code changes (but there are a couple of typecheck fixes).

  • #​6058 31cd51f Thanks @​threepointone! - chore: Quieter builds

    This patch cleans up warnings we were seeing when doing a full build. Specifically:

    • fixtures/remix-pages-app had a bunch of warnings about impending features that it should be upgraded to, so I did that. (tbh this one needs a full upgrade of packages, but we'll get to that later when we're upgrading across the codebase)
    • updated @microsoft/api-extractor so it didn't complain that it didn't match the typescript version (that we'd recently upgraded)
    • it also silenced a bunch of warnings when exporting types from wrangler. We'll need to fix those, but we'll do that when we work on unstable_dev etc.
    • workers-playground was complaining about the size of the bundle being generated, so I increased the limit on it

v3.20240610.0

Compare Source

Patch Changes
  • #​6024 c4146fc Thanks @​petebacondarwin! - chore: update dependencies of "miniflare" package

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20240605.0 1.20240610.1

v3.20240605.0

Compare Source

Patch Changes

v3.20240524.2

Compare Source

Patch Changes
  • #​5922 bdbb7f8 Thanks @​dario-piotrowicz! - fix: Allow the magic proxy to handle functions returning functions

    Previously functions returning functions would not be handled by the magic proxy,
    the changes here enable the above, allowing for code such as the following:

    	const mf = new Miniflare(/* ... */);
    
    	const { functionsFactory } = await mf.getBindings<Env>();
    	const fn = functionsFactory.getFunction();
    	const functionResult = fn();

    This also works with the native workers RPC mechanism, allowing users to
    return functions in their RPC code.

v3.20240524.1

Compare Source

Patch Changes

v3.20240524.0

Compare Source

Minor Changes
  • #​5917 64ccdd6 Thanks @​kossnocorp! - fix: D1's JOIN behaviour when selecting columns with the same name.

    Properly handle the resultsFormat query that workerd sends. This partially fixes the JOIN bug and makes the behaviour of raw consistent with the workerd behaviour.

Patch Changes

v3.20240512.0

Compare Source

Patch Changes

v3.20240419.1

Compare Source

Minor Changes
  • #​5570 66bdad0 Thanks @​sesteves! - feature: support delayed delivery in the miniflare's queue simulator.

    This change updates the miniflare's queue broker to support delayed delivery of messages, both when sending the message from a producer and when retrying the message from a consumer.

Patch Changes
  • #​5670 9b4af8a Thanks @​dario-piotrowicz! - fix: Allow the magic proxy to proxy objects containing functions

    This was previously prevented but this change removes that restriction.

v3.20240419.0

Compare Source

Patch Changes

v3.20240405.2

Compare Source

Patch Changes
  • #​5599 c9f081a Thanks @​penalosa! - fix: add support for wrapped bindings in magic proxy

    currently Miniflare#getBindings() does not return proxies to provided wrappedBindings, make sure that appropriate proxies are instead returned

    Example:

    import { Miniflare } from "miniflare";
    
    const mf = new Miniflare({
    	workers: [
    		{
    			wrappedBindings: {
    				Greeter: {
    					scriptName: "impl",
    				},
    			},
    			modules: true,
    			script: `export default { fetch(){ return new Response(''); } }`,
    		},
    		{
    			modules: true,
    			name: "impl",
    			script: `
    				class Greeter {
    					sayHello(name) {
    						return "Hello " + name;
    					}
    				}
    
    				export default function (env) {
    					return new Greeter();
    				}
    			`,
    		},
    	],
    });
    
    const { Greeter } = await mf.getBindings();
    
    console.log(Greeter.sayHello("world")); // <--- prints 'Hello world'
    
    await mf.dispose();
  • #​5599 c9f081a Thanks @​penalosa! - fix: add support for RPC in magic proxy

    currently Miniflare#getBindings() does not return valid proxies to provided serviceBindings using RPC, make sure that appropriate proxies are instead returned

    Example:

    import { Miniflare } from "miniflare";
    
    const mf = new Miniflare({
    	workers: [
    		{
    			modules: true,
    			script: `export default { fetch() { return new Response(''); } }`,
    			serviceBindings: {
    				SUM: {
    					name: "sum-worker",
    					entrypoint: "SumEntrypoint",
    				},
    			},
    		},
    		{
    			modules: true,
    			name: "sum-worker",
    			script: `
    				import { WorkerEntrypoint } from 'cloudflare:workers';
    
    				export default { fetch() { return new Response(''); } }
    
    				export class SumEntrypoint extends WorkerEntrypoint {
    					sum(args) {
    						return args.reduce((a, b) => a + b);
    					}
    				}
    			`,
    		},
    	],
    });
    
    const { SUM } = await mf.getBindings();
    
    const numbers = [1, 2, 3];
    
    console.log(`The sum of ${numbers.join(", ")} is ${await SUM.sum(numbers)}`); // <--- prints 'The sum of 1, 2, 3 is 6'
    
    await mf.dispose();

v3.20240405.1

Compare Source

Minor Changes
  • #​5409 08b4908 Thanks @​mrbbot! - feature: respect incoming Accept-Encoding header and ensure Accept-Encoding/request.cf.clientAcceptEncoding set correctly

    Previously, Miniflare would pass through the incoming Accept-Encoding header to your Worker code. This change ensures this header is always set to Accept-Encoding: br, gzip for incoming requests to your Worker. The original value of Accept-Encoding will be stored in request.cf.clientAcceptEncoding. This matches deployed behaviour.

    Fixes #​5246

v3.20240405.0

Compare Source

Patch Changes

v3.20240404.0

Compare Source

Patch Changes

v3.20240403.0

Compare Source

Minor Changes
  • #​5215 cd03d1d Thanks @​GregBrimble! - feature: customisable unsafe direct sockets entrypoints

    Previously, Miniflare provided experimental unsafeDirectHost and unsafeDirectPort options for starting an HTTP server that pointed directly to a specific Worker. This change replaces these options with a single unsafeDirectSockets option that accepts an array of socket objects of the form { host?: string, port?: number, entrypoint?: string, proxy?: boolean }. host defaults to 127.0.0.1, port defaults to 0, entrypoint defaults to default, and proxy defaults to false. This allows you to start HTTP servers for specific entrypoints of specific Workers. proxy controls the Style of the socket.

    Note these sockets set the capnpConnectHost workerd option to "miniflare-unsafe-internal-capnp-connect". external serviceBindings will set their capnpConnectHost option to the same value allowing RPC over multiple Miniflare instances. Refer to https://github.com/cloudflare/workerd/pull/1757 for more information.

  • #​5215 cd03d1d Thanks @​GregBrimble! - feature: support named entrypoints for serviceBindings

    This change allows service bindings to bind to a named export of another Worker using designators of the form { name: string | typeof kCurrentWorker, entrypoint?: string }. Previously, you could only bind to the default entrypoint. With this change, you can bind to any exported entrypoint.

    import { kCurrentWorker, Miniflare } from "miniflare";
    
    const mf = new Miniflare({
      workers: [
        {
          name: "a",
          serviceBindings: {
            A_RPC_SERVICE: { name: kCurrentWorker, entrypoint: "RpcEntrypoint" },
            A_NAMED_SERVICE: { name: "a", entrypoint: "namedEntrypoint" },
            B_NAMED_SERVICE: { name: "b", entrypoint: "anotherNamedEntrypoint" },
          },
          compatibilityFlags: ["rpc"],
          modules: true,
          script: `
    			import { WorkerEntrypoint } from "cloudflare:workers";
    
    			export class RpcEntrypoint extends WorkerEntrypoint {
    				ping() { return "a:rpc:pong"; }
    			}
    
    			export const namedEntrypoint = {
    				fetch(request, env, ctx) { return new Response("a:named:pong"); }
    			};
    
    			...
    			`,
        },
        {
          name: "b",
          modules: true,
          script: `
    			export const anotherNamedEntrypoint = {
    				fetch(request, env, ctx) { return new Response("b:named:pong"); }
    			};
    			`,
        },
      ],
    });
Patch Changes
  • #​5499 6c3be5b Thanks @​GregBrimble! - chore: Bump workerd@1.20240403.0

  • #​5215 cd03d1d Thanks @​GregBrimble! - fix: allow scripts without scriptPaths to import built-in modules

    Previously, if a string script option was specified with modules: true but without a corresponding scriptPath, all imports were forbidden. This change relaxes that restriction to allow imports of built-in node:*, cloudflare:* and workerd:* modules without a scriptPath.

v3.20240329.1

Compare Source

Patch Changes
  • #​5491 940ad89 Thanks @​dario-piotrowicz! - fix: make sure the magic proxy can handle multiple parallel r2 stream reads

    Currently trying to read multiple R2 streams in parallel (via Promise.all for example) leads to deadlock which prevents any of the target streams from being read. This is caused by the underlying implementation only allowing a single HTTP connection to the Workers runtime at a time. This change fixes the issue by allowing multiple parallel HTTP connections.

v3.20240329.0

Compare Source

Minor Changes

v3.20240320.1

Compare Source

Minor Changes

v3.20240320.0

Compare Source

Patch Changes

v3.20240314.0

Compare Source

Minor Changes

v3.20240304.2

Compare Source

Patch Changes

v3.20240304.1

Compare Source

Patch Changes
  • #​5201 1235d48 Thanks @​wydengyre! - fix: ensure miniflare works with Node 21.7.0+

  • #​5191 27fb22b Thanks @​mrbbot! - fix: ensure redirect responses handled correctly with dispatchFetch()

    Previously, if your Worker returned a redirect response, calling dispatchFetch(url) would send another request to the original url rather than the redirect. This change ensures redirects are followed correctly.

    • If your Worker returns a relative redirect or an absolute redirect with the same origin as the original url, the request will be sent to the Worker.
    • If your Worker instead returns an absolute redirect with a different origin, the request will be sent to the Internet.
    • If a redirected request to a different origin returns an absolute redirect with the same origin as the original url, the request will also be sent to the Worker.

v3.20240304.0

Compare Source

Minor Changes

v3.20240223.1

Compare Source

Patch Changes
  • #​5133 42bcc72 Thanks @​mrbbot! - fix: ensure internals can access workerd when starting on non-local host

    Previously, if Miniflare was configured to start on a host that wasn't 127.0.0.1, ::1, *, ::, or 0.0.0.0, calls to Miniflare API methods relying on the magic proxy (e.g. getKVNamespace(), getWorker(), etc.) would fail. This change ensures workerd is always accessible to Miniflare's internals. This also fixes wrangler dev when using local network address such as 192.168.0.10 with the --ip flag.

  • #​5133 42bcc72 Thanks @​mrbbot! - fix: ensure IPv6 addresses can be used as hosts

    Previously, if Miniflare was configured to start on an IPv6 host, it could crash. This change ensures IPv6 addresses are handled correctly. This also fixes wrangler dev when using IPv6 addresses such as ::1 with the --ip flag.

v3.20240223.0

Compare Source

Minor Changes

v3.20240208.0

Compare Source

Minor Changes

v3.20240129.3

Compare Source

Minor Changes
  • #​4795 027f9719 Thanks @​mrbbot! - feat: pass Miniflare instance as argument to custom service binding handlers

    This change adds a new Miniflare-typed parameter to function-valued service binding handlers. This provides easy access to the correct bindings when re-using service functions across instances.

    import assert from "node:assert";
    import { Miniflare, Response } from "miniflare";
    
    const mf = new Miniflare({
      serviceBindings: {
        SERVICE(request, instance) {
          assert(instance === mf);
          return new Response();
        },
      },
    });
  • #​4795 027f9719 Thanks @​mrbbot! - feat: allow URLs to be passed in hyperdrives

    Previously, the hyperdrives option only accepted strings as connection strings. This change allows URL objects to be passed too.

  • #​4795 027f9719 Thanks @​mrbbot! - feat: add support for custom root paths

    Miniflare has lots of file-path-valued options (e.g. scriptPath, kvPersist, textBlobBindings). Previously, these were always resolved relative to the current working directory before being used. This change adds a new rootPath shared, and per-worker option for customising this behaviour. Instead of resolving relative to the current working directory, Miniflare will now resolve path-valued options relative to the closest rootPath option. Paths are still resolved relative to the current working directory if no rootPaths are defined. Worker-level rootPaths are themselves resolved relative to the shared rootPath if defined.

    import { Miniflare } from "miniflare";
    
    const mf1 = new Miniflare({
      scriptPath: "index.mjs",
    });
    
    const mf2 = new Miniflare({
      rootPath: "a/b",
      scriptPath: "c/index.mjs",
    });
    
    const mf3 = new Miniflare({
      rootPath: "/a/b",
      workers: [
        {
          name: "1",
          rootPath: "c",
          scriptPath: "index.mjs",
        },
        {
          name: "2",
          scriptPath: "index.mjs",
        },
      ],
    });
  • #​4795 027f9719 Thanks @​mrbbot! - feat: allow easy binding to current worker

    Previously, if you wanted to create a service binding to the current Worker, you'd need to know the Worker's name. This is usually possible, but can get tricky when dealing with many Workers. This change adds a new kCurrentWorker symbol that can be used instead of a Worker name in serviceBindings. kCurrentWorker always points to the Worker with the binding.

    import { kCurrentWorker, Miniflare } from "miniflare";
    
    const mf = new Miniflare({
      serviceBindings: {
        SELF: kCurrentWorker,
      },
      modules: true,
      script: `export default {
        fetch(request, env, ctx) {
          const { pathname } = new URL(request.url);
          if (pathname === "/recurse") {
            return env.SELF.fetch("http://placeholder");
          }
          return new Response("body");
        }
      }`,
    });
    
    const response = await mf.dispatchFetch("http://placeholder/recurse");
    console.log(await response.text()); // body
Patch Changes
  • #​4954 7723ac17 Thanks @​mrbbot! - fix: allow relative scriptPath/modulesRoots to break out of current working directory

    Previously, Miniflare would resolve relative scriptPaths against moduleRoot multiple times resulting in incorrect paths and module names. This would lead to can't use ".." to break out of starting directory workerd errors. This change ensures Miniflare uses scriptPath as is, and only resolves it relative to modulesRoot when computing module names. Note this bug didn't affect service workers. This allows you to reference a modules scriptPath outside the working directory with something like:

    const mf = new Miniflare({
      modules: true,
      modulesRoot: "..",
      scriptPath: "../worker.mjs",
    });

    Fixes #​4721

  • #​4795 027f9719 Thanks @​mrbbot! - fix: return non-WebSocket responses for failed WebSocket upgrading fetch()es

    Previously, Miniflare's fetch() would throw an error if the Upgrade: websocket header was set, and a non-WebSocket response was returned from the origin. This change ensures the non-WebSocket response is returned from fetch() instead, with webSocket set to null. This allows the caller to handle the response as they see fit.

  • #​4795 027f9719 Thanks @​mrbbot! - fix: ensure MiniflareOptions, WorkerOptions, and SharedOptions types are correct

    Miniflare uses Zod for validating options. Previously, Miniflare inferred *Options from the output types of its Zod schemas, rather than the input types. In most cases, these were the same. However, the hyperdrives option has different input/output types, preventing these from being type checked correctly.

v3.20240129.2

Compare Source

Patch Changes
  • #​4950 05360e43 Thanks @​petebacondarwin! - fix: ensure we do not rewrite external Origin headers in wrangler dev

    In https://github.com/cloudflare/workers-sdk/pull/4812 we tried to fix the Origin headers to match the Host header but were overzealous and rewrote Origin headers for external origins (outside of the proxy server's origin).

    This is now fixed, and moreover we rewrite any headers that refer to the proxy server on the request with the configured host and vice versa on the response.

    This should ensure that CORS is not broken in browsers when a different host is being simulated based on routes in the Wrangler configuration.

v3.20240129.1

Compare Source

Minor Changes

Configuration

📅 Schedule: Branch creation - "every weekend" in timezone Asia/Makassar, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the renovate label May 20, 2023
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 3 times, most recently from 7ce9eda to 4ad8efe Compare May 27, 2023 22:03
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from c5c6251 to 951c744 Compare June 24, 2023 04:32
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 3 times, most recently from 1f5030d to 0a86651 Compare July 11, 2023 13:24
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 3 times, most recently from 2bd3a29 to 4173c3d Compare July 22, 2023 00:07
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 3 times, most recently from 78ed538 to a29b609 Compare August 1, 2023 18:25
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 4 times, most recently from c331fc1 to 80ffa46 Compare August 8, 2023 16:42
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from dd80763 to c4f0dc3 Compare August 15, 2023 13:34
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from 1f92faf to e57dbec Compare August 22, 2023 13:27
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from 3818050 to 79cf2fb Compare September 2, 2023 03:29
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from 9c3b834 to 81d6fe9 Compare September 9, 2023 03:11
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from fb0fe68 to 32d01d9 Compare September 19, 2023 21:54
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from 9f6c93f to 18a65c3 Compare May 15, 2024 00:09
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 3 times, most recently from c5dbddb to e08eae5 Compare June 4, 2024 18:57
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from 1c64219 to 9f999c1 Compare June 14, 2024 11:56
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch from 87ae66e to f6bcba5 Compare July 3, 2024 13:15
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from 52ef673 to 1c24c0a Compare July 19, 2024 16:32
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 2 times, most recently from 9e35fc8 to 14f7997 Compare August 1, 2024 12:23
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 3 times, most recently from 63ef6f4 to f05b78b Compare August 22, 2024 16:21
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 4 times, most recently from 8a545c5 to ebe0a63 Compare September 17, 2024 01:22
@renovate renovate bot force-pushed the renovate/miniflare-3.x branch 3 times, most recently from 7102511 to 0808ae5 Compare September 23, 2024 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants