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.20240405.2 #1745

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 17, 2024

Mend Renovate

This PR contains the following updates:

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

Release Notes

cloudflare/workers-sdk (miniflare)

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

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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 has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot enabled auto-merge (rebase) April 17, 2024 08:03
@github-actions github-actions bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Apr 17, 2024
@renovate renovate bot merged commit 726b825 into main Apr 17, 2024
29 checks passed
@renovate renovate bot deleted the renovate/miniflare-3.x-lockfile branch April 17, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Routine tasks like conversions, reorganization, and maintenance work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant