-
Notifications
You must be signed in to change notification settings - Fork 492
Adds props for ExecutionContext for ExportedHandler #5618
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
base: main
Are you sure you want to change the base?
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
68dc879 to
2d7c1f0
Compare
|
I don't think this name is correct. As I understand it this PR is adding the option to drill the type of |
|
@penalosa should I call it |
|
@NejcZdovc I think it should just be called |
2d7c1f0 to
c801eb3
Compare
|
@penalosa changed it to |
|
It should just be called I'm a bit concerned that we're adding this as the fourth parameter to @penalosa What do you think? |
|
@kentonv I agree, I think we should make this match |
|
Well, the reason I figured I could skip this entirely is because people using I would like to understand the use case here better -- I asked a question on the issue #5617. |
c801eb3 to
5081c9b
Compare
jamesopstad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. I can approve this once the email handler types have also been updated. I'll also make a note that we should consider changing the type parameter order in future.
| ); | ||
| JSG_STRUCT_TS_OVERRIDE(<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown> { | ||
| JSG_STRUCT_TS_OVERRIDE(<Env = unknown, QueueHandlerMessage = unknown, CfHostMetadata = unknown, Props = unknown> { | ||
| email?: EmailExportedHandler<Env>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EmailExportedHandler also needs updating here:
workerd/types/defines/email.d.ts
Lines 63 to 67 in 903cdf1
| declare type EmailExportedHandler<Env = unknown> = ( | |
| message: ForwardableEmailMessage, | |
| env: Env, | |
| ctx: ExecutionContext | |
| ) => void | Promise<void>; |
Resolving #5617
More info with detailed description in #5617