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

Version Packages #5503

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Version Packages #5503

merged 1 commit into from
Apr 4, 2024

Conversation

workers-devprod
Copy link
Contributor

@workers-devprod workers-devprod commented Apr 4, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

miniflare@3.20240403.0

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 JSRPC: Support capnp-over-http for external server bindings workerd#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.

wrangler@3.46.0

Minor Changes

  • #5282 b7ddde1 Thanks @maxwellpeterson! - feature: Add source map support for Workers

    Adds the source_maps boolean config option. When enabled, source maps included in the build output are uploaded alongside the built code modules. Uploaded source maps can then be used to remap stack traces emitted by the Workers runtime.

  • #5215 cd03d1d Thanks @GregBrimble! - feature: support named entrypoints in service bindings

    This change allows service bindings to bind to a named export of another Worker. As an example, consider the following Worker named bound:

    import { WorkerEntrypoint } from "cloudflare:workers";
    
    export class EntrypointA extends WorkerEntrypoint {
    	fetch(request) {
    		return new Response("Hello from entrypoint A!");
    	}
    }
    
    export const entrypointB: ExportedHandler = {
    	fetch(request, env, ctx) {
    		return new Response("Hello from entrypoint B!");
    	}
    };
    
    export default <ExportedHandler>{
    	fetch(request, env, ctx) {
    		return new Response("Hello from the default entrypoint!");
    	}
    };

    Up until now, you could only bind to the default entrypoint. With this change, you can bind to EntrypointA or entrypointB too using the new entrypoint option:

    [[services]]
    binding = "SERVICE"
    service = "bound"
    entrypoint = "EntrypointA"

    To bind to named entrypoints with wrangler pages dev, use the # character:

    $ wrangler pages dev --service=SERVICE=bound#EntrypointA

Patch Changes

  • #5215 cd03d1d Thanks @GregBrimble! - fix: ensure request url and cf properties preserved across service bindings

    Previously, Wrangler could rewrite url and cf properties when sending requests via service bindings or Durable Object stubs. To match production behaviour, this change ensures these properties are preserved.

  • Updated dependencies [cd03d1d, 6c3be5b, cd03d1d, cd03d1d]:

    • miniflare@3.20240403.0

@cloudflare/pages-shared@0.11.25

Patch Changes

@cloudflare/vitest-pool-workers@0.1.14

Patch Changes

@workers-devprod workers-devprod requested review from a team as code owners April 4, 2024 10:31
Copy link
Contributor

github-actions bot commented Apr 4, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8554061715/npm-package-wrangler-5503

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5503/npm-package-wrangler-5503

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8554061715/npm-package-wrangler-5503 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8554061715/npm-package-create-cloudflare-5503 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8554061715/npm-package-cloudflare-kv-asset-handler-5503
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8554061715/npm-package-miniflare-5503
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8554061715/npm-package-cloudflare-pages-shared-5503
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8554061715/npm-package-cloudflare-vitest-pool-workers-5503

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.46.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240403.0
workerd 1.20240403.0 1.20240403.0
workerd --version 1.20240403.0 2024-04-03

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.19%. Comparing base (b7ddde1) to head (5c36dc7).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5503      +/-   ##
==========================================
+ Coverage   72.14%   72.19%   +0.05%     
==========================================
  Files         332      332              
  Lines       17243    17243              
  Branches     4406     4406              
==========================================
+ Hits        12440    12449       +9     
+ Misses       4803     4794       -9     

see 6 files with indirect coverage changes

@penalosa penalosa merged commit 5aca913 into main Apr 4, 2024
21 checks passed
@penalosa penalosa deleted the changeset-release/main branch April 4, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants