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 #5593

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Version Packages #5593

merged 1 commit into from
Apr 17, 2024

Conversation

workers-devprod
Copy link
Contributor

@workers-devprod workers-devprod commented Apr 11, 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

create-cloudflare@2.19.0

Minor Changes

@cloudflare/vitest-pool-workers@0.2.0

Minor Changes

  • #5612 8f470d9 Thanks @Skye-31! - Feat: Support specifying an environment for your worker when running tests. This allows your tests to pick up bindings & variables that are scoped to specific environments.

    For example:

    import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";
    
    export default defineWorkersConfig({
    	test: {
    		poolOptions: {
    			workers: {
    				wrangler: {
    					configPath: "./wrangler.toml",
    					environment: "production",
    				},
    			},
    		},
    	},
    });

Patch Changes

  • #5589 92bc055 Thanks @Skye-31! - fix: Support importing ES modules from libraries that do not correctly provide "type"="module" not use .mjs extensions

    The toucan-js library has an entry point of "module": "dist/index.esm.js". This file does not use the standard .mjs extension, nor does it specify "type"="module", so the resolution and loading algorithm fails to identify this file as an ES Module, defaulting to CommonJS, breaking Vitest.
    Fixes 🐛 BUG: Vitest-pool-workers doesn't handle ESM modules well #5588

  • Updated dependencies [9a46e03, c9f081a, fbe1c9c, 22f5841, c9f081a]:

    • wrangler@3.51.0
    • miniflare@3.20240405.2

wrangler@3.51.0

Minor Changes

  • #5477 9a46e03 Thanks @pmiguel! - feature: Changed Queues client to use the new QueueId and ConsumerId-based endpoints.

  • #5172 fbe1c9c Thanks @GregBrimble! - feat: Allow marking external modules (with --external) to avoid bundling them when building Pages Functions

    It's useful for Pages Plugins which want to declare a peer dependency.

Patch Changes

miniflare@3.20240405.2

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();

@cloudflare/pages-shared@0.11.29

Patch Changes

@workers-devprod workers-devprod requested review from a team as code owners April 11, 2024 17:04
Copy link
Contributor

github-actions bot commented Apr 11, 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/8712251013/npm-package-wrangler-5593

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

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

Or you can use npx with this latest build directly:

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

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


wrangler@3.51.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240405.2
workerd 1.20240405.0 1.20240405.0
workerd --version 1.20240405.0 2024-04-05

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

@petebacondarwin petebacondarwin merged commit 1071fe5 into main Apr 17, 2024
27 checks passed
@petebacondarwin petebacondarwin deleted the changeset-release/main branch April 17, 2024 05:36
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.

🐛 BUG: Vitest-pool-workers doesn't handle ESM modules well
3 participants