Skip to content

Commit 6bf3bbc

Browse files
chore: Update version for release (#1504)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1077709 commit 6bf3bbc

15 files changed

+360
-125
lines changed

.changeset/perfect-onions-call.md

Lines changed: 0 additions & 80 deletions
This file was deleted.

.changeset/ten-pans-itch.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

.changeset/wild-needles-hunt.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/build/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @trigger.dev/build
22

3+
## 3.3.0
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
- `@trigger.dev/core@3.3.0`
9+
310
## 3.2.2
411

512
### Patch Changes

packages/build/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trigger.dev/build",
3-
"version": "3.2.2",
3+
"version": "3.3.0",
44
"description": "trigger.dev build extensions",
55
"license": "MIT",
66
"publishConfig": {
@@ -65,7 +65,7 @@
6565
"check-exports": "attw --pack ."
6666
},
6767
"dependencies": {
68-
"@trigger.dev/core": "workspace:3.2.2",
68+
"@trigger.dev/core": "workspace:3.3.0",
6969
"pkg-types": "^1.1.3",
7070
"tinyglobby": "^0.2.2",
7171
"tsconfck": "3.1.3"

packages/cli-v3/CHANGELOG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,87 @@
11
# trigger.dev
22

3+
## 3.3.0
4+
5+
### Patch Changes
6+
7+
- Added new batch.trigger and batch.triggerByTask methods that allows triggering multiple different tasks in a single batch: ([#1502](https://github.com/triggerdotdev/trigger.dev/pull/1502))
8+
9+
```ts
10+
import { batch } from "@trigger.dev/sdk/v3";
11+
import type { myTask1, myTask2 } from "./trigger/tasks";
12+
13+
// Somewhere in your backend code
14+
const response = await batch.trigger<typeof myTask1 | typeof myTask2>([
15+
{ id: "task1", payload: { foo: "bar" } },
16+
{ id: "task2", payload: { baz: "qux" } },
17+
]);
18+
19+
for (const run of response.runs) {
20+
if (run.ok) {
21+
console.log(run.output);
22+
} else {
23+
console.error(run.error);
24+
}
25+
}
26+
```
27+
28+
Or if you are inside of a task, you can use `triggerByTask`:
29+
30+
```ts
31+
import { batch, task, runs } from "@trigger.dev/sdk/v3";
32+
33+
export const myParentTask = task({
34+
id: "myParentTask",
35+
run: async () => {
36+
const response = await batch.triggerByTask([
37+
{ task: myTask1, payload: { foo: "bar" } },
38+
{ task: myTask2, payload: { baz: "qux" } },
39+
]);
40+
41+
const run1 = await runs.retrieve(response.runs[0]);
42+
console.log(run1.output); // typed as { foo: string }
43+
44+
const run2 = await runs.retrieve(response.runs[1]);
45+
console.log(run2.output); // typed as { baz: string }
46+
47+
const response2 = await batch.triggerByTaskAndWait([
48+
{ task: myTask1, payload: { foo: "bar" } },
49+
{ task: myTask2, payload: { baz: "qux" } },
50+
]);
51+
52+
if (response2.runs[0].ok) {
53+
console.log(response2.runs[0].output); // typed as { foo: string }
54+
}
55+
56+
if (response2.runs[1].ok) {
57+
console.log(response2.runs[1].output); // typed as { baz: string }
58+
}
59+
},
60+
});
61+
62+
export const myTask1 = task({
63+
id: "myTask1",
64+
run: async () => {
65+
return {
66+
foo: "bar",
67+
};
68+
},
69+
});
70+
71+
export const myTask2 = task({
72+
id: "myTask2",
73+
run: async () => {
74+
return {
75+
baz: "qux",
76+
};
77+
},
78+
});
79+
```
80+
81+
- Updated dependencies:
82+
- `@trigger.dev/core@3.3.0`
83+
- `@trigger.dev/build@3.3.0`
84+
385
## 3.2.2
486

587
### Patch Changes

packages/cli-v3/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trigger.dev",
3-
"version": "3.2.2",
3+
"version": "3.3.0",
44
"description": "A Command-Line Interface for Trigger.dev (v3) projects",
55
"type": "module",
66
"license": "MIT",
@@ -87,8 +87,8 @@
8787
"@opentelemetry/sdk-trace-base": "1.25.1",
8888
"@opentelemetry/sdk-trace-node": "1.25.1",
8989
"@opentelemetry/semantic-conventions": "1.25.1",
90-
"@trigger.dev/build": "workspace:3.2.2",
91-
"@trigger.dev/core": "workspace:3.2.2",
90+
"@trigger.dev/build": "workspace:3.3.0",
91+
"@trigger.dev/core": "workspace:3.3.0",
9292
"c12": "^1.11.1",
9393
"chalk": "^5.2.0",
9494
"cli-table3": "^0.6.3",

packages/core/CHANGELOG.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,112 @@
11
# internal-platform
22

3+
## 3.3.0
4+
5+
### Minor Changes
6+
7+
- Improved Batch Triggering: ([#1502](https://github.com/triggerdotdev/trigger.dev/pull/1502))
8+
9+
- The new Batch Trigger endpoint is now asynchronous and supports up to 500 runs per request.
10+
- The new endpoint also supports triggering multiple different tasks in a single batch request (support in the SDK coming soon).
11+
- The existing `batchTrigger` method now supports the new endpoint, and shouldn't require any changes to your code.
12+
13+
- Idempotency keys now expire after 24 hours, and you can customize the expiration time when creating a new key by using the `idempotencyKeyTTL` parameter:
14+
15+
```ts
16+
await myTask.batchTrigger([{ payload: { foo: "bar" } }], {
17+
idempotencyKey: "my-key",
18+
idempotencyKeyTTL: "60s",
19+
});
20+
// Works for individual items as well:
21+
await myTask.batchTrigger([
22+
{ payload: { foo: "bar" }, options: { idempotencyKey: "my-key", idempotencyKeyTTL: "60s" } },
23+
]);
24+
// And `trigger`:
25+
await myTask.trigger({ foo: "bar" }, { idempotencyKey: "my-key", idempotencyKeyTTL: "60s" });
26+
```
27+
28+
### Breaking Changes
29+
30+
- We've removed the `idempotencyKey` option from `triggerAndWait` and `batchTriggerAndWait`, because it can lead to permanently frozen runs in deployed tasks. We're working on upgrading our entire system to support idempotency keys on these methods, and we'll re-add the option once that's complete.
31+
32+
### Patch Changes
33+
34+
- Added new batch.trigger and batch.triggerByTask methods that allows triggering multiple different tasks in a single batch: ([#1502](https://github.com/triggerdotdev/trigger.dev/pull/1502))
35+
36+
```ts
37+
import { batch } from "@trigger.dev/sdk/v3";
38+
import type { myTask1, myTask2 } from "./trigger/tasks";
39+
40+
// Somewhere in your backend code
41+
const response = await batch.trigger<typeof myTask1 | typeof myTask2>([
42+
{ id: "task1", payload: { foo: "bar" } },
43+
{ id: "task2", payload: { baz: "qux" } },
44+
]);
45+
46+
for (const run of response.runs) {
47+
if (run.ok) {
48+
console.log(run.output);
49+
} else {
50+
console.error(run.error);
51+
}
52+
}
53+
```
54+
55+
Or if you are inside of a task, you can use `triggerByTask`:
56+
57+
```ts
58+
import { batch, task, runs } from "@trigger.dev/sdk/v3";
59+
60+
export const myParentTask = task({
61+
id: "myParentTask",
62+
run: async () => {
63+
const response = await batch.triggerByTask([
64+
{ task: myTask1, payload: { foo: "bar" } },
65+
{ task: myTask2, payload: { baz: "qux" } },
66+
]);
67+
68+
const run1 = await runs.retrieve(response.runs[0]);
69+
console.log(run1.output); // typed as { foo: string }
70+
71+
const run2 = await runs.retrieve(response.runs[1]);
72+
console.log(run2.output); // typed as { baz: string }
73+
74+
const response2 = await batch.triggerByTaskAndWait([
75+
{ task: myTask1, payload: { foo: "bar" } },
76+
{ task: myTask2, payload: { baz: "qux" } },
77+
]);
78+
79+
if (response2.runs[0].ok) {
80+
console.log(response2.runs[0].output); // typed as { foo: string }
81+
}
82+
83+
if (response2.runs[1].ok) {
84+
console.log(response2.runs[1].output); // typed as { baz: string }
85+
}
86+
},
87+
});
88+
89+
export const myTask1 = task({
90+
id: "myTask1",
91+
run: async () => {
92+
return {
93+
foo: "bar",
94+
};
95+
},
96+
});
97+
98+
export const myTask2 = task({
99+
id: "myTask2",
100+
run: async () => {
101+
return {
102+
baz: "qux",
103+
};
104+
},
105+
});
106+
```
107+
108+
- Added ability to subscribe to a batch of runs using runs.subscribeToBatch ([#1502](https://github.com/triggerdotdev/trigger.dev/pull/1502))
109+
3110
## 3.2.2
4111

5112
## 3.2.1

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trigger.dev/core",
3-
"version": "3.2.2",
3+
"version": "3.3.0",
44
"description": "Core code used across the Trigger.dev SDK and platform",
55
"license": "MIT",
66
"publishConfig": {

0 commit comments

Comments
 (0)