Skip to content

feat: added defineJob method in TriggerClient#176

Merged
ericallam merged 3 commits intotriggerdotdev:mainfrom
akhill10:feat/client-define-job
Jul 17, 2023
Merged

feat: added defineJob method in TriggerClient#176
ericallam merged 3 commits intotriggerdotdev:mainfrom
akhill10:feat/client-define-job

Conversation

@akhill10
Copy link
Copy Markdown
Contributor

@akhill10 akhill10 commented Jul 15, 2023

Fixes #162

  • Added a defineJob method in the TriggerClient
  • Replaced new Job(client, options) with client.defineJob(options) in examples.

/claim #162

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 15, 2023

🦋 Changeset detected

Latest commit: 1961b99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@trigger.dev/sdk Patch
nextjs-12 Patch
@examples/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

};
}

defineJob(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great, but I think defineJob needs to be generic so the type of the job returned includes the actual Trigger type (we're eventually going to support direct job invocation, so need to make sure the Trigger type is preserved and not just any) Otherwise this whole PR is 👍

Copy link
Copy Markdown
Contributor Author

@akhill10 akhill10 Jul 15, 2023

Choose a reason for hiding this comment

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

Yeah, agree. Done

@ericallam
Copy link
Copy Markdown
Member

Can you add a changeset for a "patch" update to the @trigger.dev/sdk package and include it in this PR?

To add a change, run this from the root of the repo:

pnpm run changeset:add

Then select @trigger.dev/sdk only and follow the steps for creating a "patch" changeset

@akhill10 akhill10 force-pushed the feat/client-define-job branch from c11e881 to 1961b99 Compare July 16, 2023 05:19
@ericallam ericallam merged commit 5336317 into triggerdotdev:main Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TRI-606] Add a TriggerClient#defineJob function that can be used instead of the Job constructor

2 participants