Add StepConfig workflow types#2559
Merged
sidharthachatterjee merged 1 commit intocloudflare:mainfrom Aug 20, 2024
Merged
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
e55c83e to
4a74e1e
Compare
jasnell
approved these changes
Aug 20, 2024
penalosa
reviewed
Aug 20, 2024
Comment on lines
+207
to
+219
| export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${"s" | ""}` | number; | ||
|
|
||
| export type WorkflowBackoff = 'constant' | 'linear' | 'exponential'; | ||
|
|
||
| export type WorkflowStepConfig = { | ||
| retries?: { | ||
| limit: number; | ||
| delay: string | number; | ||
| backoff?: WorkflowBackoff; | ||
| }; | ||
| timeout?: string | number; | ||
| }; | ||
|
|
Contributor
There was a problem hiding this comment.
I realise there are already Workflow types in this file, but I think they should probably be in a separate workflows.d.ts so we can more easily separate them.
| } | ||
|
|
||
| export type DurationLabel = | ||
| export type WorkflowDurationLabel = |
Contributor
There was a problem hiding this comment.
This is a breaking change—I assume this is being considered okay because Workflows is experimental?
Contributor
Author
There was a problem hiding this comment.
Yhep this is okay as we are still iterating on the types, we just thought that would be better to prefix everything with Workflow to not pollute the scope
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StepConfigwas missing from previous type iterations, making thecloudflare:workersWorkflowtypes kind of unusable 😅.All utility types are prefixed with Workflow to avoid polluting the
cloudflare:workersscope