Skip to content

chore: Update version for release #1504

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

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 0 additions & 80 deletions .changeset/perfect-onions-call.md

This file was deleted.

25 changes: 0 additions & 25 deletions .changeset/ten-pans-itch.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/wild-needles-hunt.md

This file was deleted.

7 changes: 7 additions & 0 deletions packages/build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @trigger.dev/build

## 3.3.0

### Patch Changes

- Updated dependencies:
- `@trigger.dev/[email protected]`

## 3.2.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/build",
"version": "3.2.2",
"version": "3.3.0",
"description": "trigger.dev build extensions",
"license": "MIT",
"publishConfig": {
Expand Down Expand Up @@ -65,7 +65,7 @@
"check-exports": "attw --pack ."
},
"dependencies": {
"@trigger.dev/core": "workspace:3.2.2",
"@trigger.dev/core": "workspace:3.3.0",
"pkg-types": "^1.1.3",
"tinyglobby": "^0.2.2",
"tsconfck": "3.1.3"
Expand Down
82 changes: 82 additions & 0 deletions packages/cli-v3/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,87 @@
# trigger.dev

## 3.3.0

### Patch Changes

- 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))

```ts
import { batch } from "@trigger.dev/sdk/v3";
import type { myTask1, myTask2 } from "./trigger/tasks";

// Somewhere in your backend code
const response = await batch.trigger<typeof myTask1 | typeof myTask2>([
{ id: "task1", payload: { foo: "bar" } },
{ id: "task2", payload: { baz: "qux" } },
]);

for (const run of response.runs) {
if (run.ok) {
console.log(run.output);
} else {
console.error(run.error);
}
}
```

Or if you are inside of a task, you can use `triggerByTask`:

```ts
import { batch, task, runs } from "@trigger.dev/sdk/v3";

export const myParentTask = task({
id: "myParentTask",
run: async () => {
const response = await batch.triggerByTask([
{ task: myTask1, payload: { foo: "bar" } },
{ task: myTask2, payload: { baz: "qux" } },
]);

const run1 = await runs.retrieve(response.runs[0]);
console.log(run1.output); // typed as { foo: string }

const run2 = await runs.retrieve(response.runs[1]);
console.log(run2.output); // typed as { baz: string }

const response2 = await batch.triggerByTaskAndWait([
{ task: myTask1, payload: { foo: "bar" } },
{ task: myTask2, payload: { baz: "qux" } },
]);

if (response2.runs[0].ok) {
console.log(response2.runs[0].output); // typed as { foo: string }
}

if (response2.runs[1].ok) {
console.log(response2.runs[1].output); // typed as { baz: string }
}
},
});

export const myTask1 = task({
id: "myTask1",
run: async () => {
return {
foo: "bar",
};
},
});

export const myTask2 = task({
id: "myTask2",
run: async () => {
return {
baz: "qux",
};
},
});
```

- Updated dependencies:
- `@trigger.dev/[email protected]`
- `@trigger.dev/[email protected]`

## 3.2.2

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trigger.dev",
"version": "3.2.2",
"version": "3.3.0",
"description": "A Command-Line Interface for Trigger.dev (v3) projects",
"type": "module",
"license": "MIT",
Expand Down Expand Up @@ -87,8 +87,8 @@
"@opentelemetry/sdk-trace-base": "1.25.1",
"@opentelemetry/sdk-trace-node": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1",
"@trigger.dev/build": "workspace:3.2.2",
"@trigger.dev/core": "workspace:3.2.2",
"@trigger.dev/build": "workspace:3.3.0",
"@trigger.dev/core": "workspace:3.3.0",
"c12": "^1.11.1",
"chalk": "^5.2.0",
"cli-table3": "^0.6.3",
Expand Down
107 changes: 107 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,112 @@
# internal-platform

## 3.3.0

### Minor Changes

- Improved Batch Triggering: ([#1502](https://github.com/triggerdotdev/trigger.dev/pull/1502))

- The new Batch Trigger endpoint is now asynchronous and supports up to 500 runs per request.
- The new endpoint also supports triggering multiple different tasks in a single batch request (support in the SDK coming soon).
- The existing `batchTrigger` method now supports the new endpoint, and shouldn't require any changes to your code.

- Idempotency keys now expire after 24 hours, and you can customize the expiration time when creating a new key by using the `idempotencyKeyTTL` parameter:

```ts
await myTask.batchTrigger([{ payload: { foo: "bar" } }], {
idempotencyKey: "my-key",
idempotencyKeyTTL: "60s",
});
// Works for individual items as well:
await myTask.batchTrigger([
{ payload: { foo: "bar" }, options: { idempotencyKey: "my-key", idempotencyKeyTTL: "60s" } },
]);
// And `trigger`:
await myTask.trigger({ foo: "bar" }, { idempotencyKey: "my-key", idempotencyKeyTTL: "60s" });
```

### Breaking Changes

- 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.

### Patch Changes

- 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))

```ts
import { batch } from "@trigger.dev/sdk/v3";
import type { myTask1, myTask2 } from "./trigger/tasks";

// Somewhere in your backend code
const response = await batch.trigger<typeof myTask1 | typeof myTask2>([
{ id: "task1", payload: { foo: "bar" } },
{ id: "task2", payload: { baz: "qux" } },
]);

for (const run of response.runs) {
if (run.ok) {
console.log(run.output);
} else {
console.error(run.error);
}
}
```

Or if you are inside of a task, you can use `triggerByTask`:

```ts
import { batch, task, runs } from "@trigger.dev/sdk/v3";

export const myParentTask = task({
id: "myParentTask",
run: async () => {
const response = await batch.triggerByTask([
{ task: myTask1, payload: { foo: "bar" } },
{ task: myTask2, payload: { baz: "qux" } },
]);

const run1 = await runs.retrieve(response.runs[0]);
console.log(run1.output); // typed as { foo: string }

const run2 = await runs.retrieve(response.runs[1]);
console.log(run2.output); // typed as { baz: string }

const response2 = await batch.triggerByTaskAndWait([
{ task: myTask1, payload: { foo: "bar" } },
{ task: myTask2, payload: { baz: "qux" } },
]);

if (response2.runs[0].ok) {
console.log(response2.runs[0].output); // typed as { foo: string }
}

if (response2.runs[1].ok) {
console.log(response2.runs[1].output); // typed as { baz: string }
}
},
});

export const myTask1 = task({
id: "myTask1",
run: async () => {
return {
foo: "bar",
};
},
});

export const myTask2 = task({
id: "myTask2",
run: async () => {
return {
baz: "qux",
};
},
});
```

- Added ability to subscribe to a batch of runs using runs.subscribeToBatch ([#1502](https://github.com/triggerdotdev/trigger.dev/pull/1502))

## 3.2.2

## 3.2.1
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/core",
"version": "3.2.2",
"version": "3.3.0",
"description": "Core code used across the Trigger.dev SDK and platform",
"license": "MIT",
"publishConfig": {
Expand Down
Loading