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

Update code from service worker to module worker format #17905

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Oct 31, 2024

Summary

Update code from service worker to module worker format

Documentation checklist

Question:

I have added only the used parameters

async fetch(request): Promise<Response>

The full signature is

async fetch(request, env, ctx): Promise<Response>

Specifying only the used parameters is valid syntax.
Are there guidelines to prefer one over the other syntax?

My plan is to convert most example to using the new syntax as the old syntax is deprecated. I'll send more PR after this one gets in.

Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 3 total issue(s) found.


Note: We resolved prior Hyperlint review comments because:

We updated our inline suggestion AI.

We do this to avoid keeping outdated or irrelevant comments around. We'll leave a new review with current comments below.

@haleycode haleycode added the DevRel Tasks that need support from developer relations. label Nov 7, 2024
@vicb
Copy link
Contributor Author

vicb commented Nov 7, 2024

Let's use async fetch(request, env, ctx): Promise<Response>

@vicb
Copy link
Contributor Author

vicb commented Nov 7, 2024

As discuss we Brendan, I updated the PR to always use

async fetch(request, env, ctx): Promise<Response>

even if env and ctx are unused (because not supported in the legacy service worker)

@vicb
Copy link
Contributor Author

vicb commented Nov 8, 2024

@ToriLindsay @dcpena - can we get ✅ to merge this?

@ToriLindsay
Copy link
Contributor

@vicb Approved. Thanks!

@dcpena dcpena merged commit 61b3e71 into cloudflare:production Nov 11, 2024
7 checks passed
@vicb
Copy link
Contributor Author

vicb commented Nov 11, 2024

Thanks for the review and merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevRel Tasks that need support from developer relations. product:bots Related to Bots product product:cloudflare-for-platforms product:cloudflare-one product:images Related to Image Resizing product size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants