Skip to content

Commit 95f4e67

Browse files
authored
Merge branch 'main' into eslint-no-trigger-core-import
2 parents fb94a4a + 946efd1 commit 95f4e67

File tree

278 files changed

+11191
-3578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+11191
-3578
lines changed

.changeset/lemon-sloths-hide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
v3: recover from server rate limiting errors in a more reliable way

.changeset/long-hounds-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
v3: update @depot/cli to latest 0.0.1-cli.2.71.0

.changeset/mighty-eggs-grab.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
"@trigger.dev/core-apps": patch
3+
"trigger.dev": patch
4+
"@trigger.dev/core": patch
5+
---
6+
7+
Tasks should now be much more robust and resilient to reconnects during crucial operations and other failure scenarios.
8+
9+
Task runs now have to signal checkpointable state prior to ALL checkpoints. This ensures flushing always happens.
10+
11+
All important socket.io RPCs will now be retried with backoff. Actions relying on checkpoints will be replayed if we haven't been checkpointed and restored as expected, e.g. after reconnect.
12+
13+
Other changes:
14+
15+
- Fix retry check in shared queue
16+
- Fix env var sync spinner
17+
- Heartbeat between retries
18+
- Fix retry prep
19+
- Fix prod worker no tasks detection
20+
- Fail runs above `MAX_TASK_RUN_ATTEMPTS`
21+
- Additional debug logs in all places
22+
- Prevent crashes due to failed socket schema parsing
23+
- Remove core-apps barrel
24+
- Upgrade socket.io-client to fix an ACK memleak
25+
- Additional index failure logs
26+
- Prevent message loss during reconnect
27+
- Prevent burst of heartbeats on reconnect
28+
- Prevent crash on failed cleanup
29+
- Handle at-least-once lazy execute message delivery
30+
- Handle uncaught entry point exceptions

.changeset/nervous-seas-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
v3: Export AbortTaskRunError from @trigger.dev/sdk/v3

.changeset/pre.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@
6565
"eight-pumas-float",
6666
"eleven-paws-join",
6767
"famous-boats-tease",
68+
"fast-colts-relax",
6869
"few-students-share",
6970
"five-toes-destroy",
71+
"friendly-walls-repair",
7072
"funny-swans-destroy",
7173
"gorgeous-gorillas-compete",
7274
"green-bags-wink",
@@ -80,17 +82,23 @@
8082
"late-steaks-behave",
8183
"lazy-files-lay",
8284
"lemon-jobs-repair",
85+
"lemon-sloths-hide",
8386
"light-bulldogs-press",
8487
"light-dragons-complain",
8588
"little-crabs-cross",
8689
"long-fireants-search",
90+
"long-hounds-wave",
8791
"loud-actors-remember",
8892
"lovely-drinks-flash",
8993
"many-ligers-pump",
9094
"mighty-camels-joke",
95+
"mighty-eggs-grab",
9196
"mighty-flowers-train",
9297
"mighty-parrots-sin",
98+
"modern-stingrays-end",
9399
"nasty-jars-pump",
100+
"nervous-planets-sparkle",
101+
"nervous-seas-shave",
94102
"new-pants-beg",
95103
"new-rivers-tell",
96104
"nice-bulldogs-turn",
@@ -100,9 +108,11 @@
100108
"plenty-ducks-beam",
101109
"polite-ducks-switch",
102110
"polite-pears-grow",
111+
"polite-pots-walk",
103112
"polite-rockets-matter",
104113
"poor-flowers-cross",
105114
"purple-garlics-shop",
115+
"purple-spiders-care",
106116
"rare-lamps-promise",
107117
"rare-roses-float",
108118
"real-planets-stare",
@@ -113,10 +123,12 @@
113123
"selfish-ducks-sort",
114124
"serious-hats-rest",
115125
"shaggy-spoons-taste",
126+
"shaggy-weeks-live",
116127
"sharp-emus-compare",
117128
"sharp-zebras-serve",
118129
"shiny-coats-cry",
119130
"silly-buses-obey",
131+
"silly-forks-kiss",
120132
"silly-suits-switch",
121133
"silver-doors-juggle",
122134
"six-ligers-exist",
@@ -128,6 +140,7 @@
128140
"smart-needles-move",
129141
"smart-olives-eat",
130142
"sour-pugs-teach",
143+
"spicy-frogs-remain",
131144
"spicy-lamps-smoke",
132145
"spicy-terms-bow",
133146
"strange-ghosts-matter",
@@ -141,6 +154,8 @@
141154
"sweet-lizards-press",
142155
"swift-dragons-peel",
143156
"tall-bees-wave",
157+
"tall-masks-repeat",
158+
"tame-apricots-clap",
144159
"tame-guests-know",
145160
"tender-moose-tell",
146161
"tender-oranges-rhyme",

.changeset/shaggy-weeks-live.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
v3: sanitize errors with null unicode characters in some places

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ COORDINATOR_SECRET=coordinator-secret # generate the actual secret with `openssl
7171
# OBJECT_STORE_BASE_URL="https://{bucket}.{accountId}.r2.cloudflarestorage.com"
7272
# OBJECT_STORE_ACCESS_KEY_ID=
7373
# OBJECT_STORE_SECRET_ACCESS_KEY=
74-
# RUNTIME_WAIT_THRESHOLD_IN_MS=10000
74+
# CHECKPOINT_THRESHOLD_IN_MS=10000
7575

7676
# These control the server-side internal telemetry
7777
# INTERNAL_OTEL_TRACE_EXPORTER_URL=<URL to send traces to>

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fetch-depth: 0
2424

2525
- name: ⎔ Setup pnpm
26-
uses: pnpm/action-setup@v2.2.4
26+
uses: pnpm/action-setup@v4
2727
with:
2828
version: 8.15.5
2929

@@ -63,7 +63,7 @@ jobs:
6363
submodules: recursive
6464

6565
- name: ⎔ Setup pnpm
66-
uses: pnpm/action-setup@v2.2.4
66+
uses: pnpm/action-setup@v4
6767
with:
6868
version: 8.15.5
6969

.github/workflows/publish-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151
ref_without_tag=ghcr.io/triggerdotdev/trigger.dev
5252
image_tags=$ref_without_tag:${{ steps.get_version.outputs.version }}
5353
54-
# if it's a versioned tag, also tag it as latest
54+
# if it's a versioned tag, also tag it as v3
5555
if [[ "${{ github.ref_name }}" == v.docker.* ]]; then
56-
image_tags=$image_tags,$ref_without_tag:latest
56+
image_tags=$image_tags,$ref_without_tag:v3
5757
fi
5858
5959
echo "IMAGE_TAGS=${image_tags}" >> "$GITHUB_OUTPUT"

.github/workflows/publish-infra.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ jobs:
111111
REPOSITORY: ${{ steps.prep.outputs.REPOSITORY }}
112112
IMAGE_TAG: ${{ steps.prep.outputs.IMAGE_TAG }}
113113

114-
- name: 🐙 Push 'latest' to GitHub Container Registry
114+
- name: 🐙 Push 'v3' tag to GitHub Container Registry
115115
if: startsWith(github.ref_name, 'v.docker.')
116116
run: |
117-
docker tag infra_image $REGISTRY/$REPOSITORY:latest
118-
docker push $REGISTRY/$REPOSITORY:latest
117+
docker tag infra_image $REGISTRY/$REPOSITORY:v3
118+
docker push $REGISTRY/$REPOSITORY:v3
119119
env:
120120
REGISTRY: ghcr.io/triggerdotdev
121121
REPOSITORY: ${{ steps.prep.outputs.REPOSITORY }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fetch-depth: 0
2929

3030
- name: ⎔ Setup pnpm
31-
uses: pnpm/action-setup@v2.2.4
31+
uses: pnpm/action-setup@v4
3232
with:
3333
version: 8.15.5
3434

.github/workflows/typecheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fetch-depth: 0
1313

1414
- name: ⎔ Setup pnpm
15-
uses: pnpm/action-setup@v2.2.4
15+
uses: pnpm/action-setup@v4
1616
with:
1717
version: 8.15.5
1818

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fetch-depth: 0
1313

1414
- name: ⎔ Setup pnpm
15-
uses: pnpm/action-setup@v2.2.4
15+
uses: pnpm/action-setup@v4
1616
with:
1717
version: 8.15.5
1818

README.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,71 @@
55
<img alt="Trigger.dev logo" src="https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/a45d1fa2-0ae8-4a39-4409-f4f934bfae00/public">
66
</picture>
77

8-
### The open source background jobs platform
8+
### Open source background jobs with no timeouts
99

1010
[Discord](https://trigger.dev/discord) | [Website](https://trigger.dev) | [Issues](https://github.com/triggerdotdev/trigger.dev/issues) | [Docs](https://trigger.dev/docs)
1111

1212
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/triggerdotdev.svg?style=social&label=Follow%20%40trigger.dev)](https://twitter.com/triggerdotdev)
13-
[![GitHub Repo stars](https://img.shields.io/github/stars/triggerdotdev/trigger.dev?style=social)](https://github.com/triggerdotdev/trigger.dev)
1413

1514
</div>
1615

17-
> The Trigger.dev v3 developer preview is now open. For more information and to get early access, check out our [developer preview launch post](https://trigger.dev/blog/v3-developer-preview-launch/).
18-
1916
## About Trigger.dev
2017

21-
Create long-running jobs directly in your codebase with features like API integrations, webhooks, scheduling and delays.
22-
23-
## Long running Jobs on serverless
18+
Trigger.dev is an open source platform and SDK which allows you to create long-running background jobs with no timeouts. Write normal async code, deploy, and never hit a timeout.
2419

25-
Reliably run jobs and don’t worry about function timeouts, we handle those for you.
20+
#### Features:
2621

27-
- Auto-resume after a function timeout
28-
- Auto-resume after a server outage
29-
- Add delays of up to a year
22+
- JavaScript and TypeScript SDK
23+
- Write reliable code by default
24+
- No infrastructure to manage
25+
- Works with your existing tech stack
3026

3127
## In your codebase
3228

33-
Create Jobs where they belong: in your codebase. Version control, localhost, test, review, and deploy like you're already used to.
29+
Create tasks where they belong: in your codebase. Version control, localhost, test and review like you're already used to.
3430

35-
## Secure by design
31+
```ts
32+
import { task } from "@trigger.dev/sdk/v3";
3633

37-
We only receive Triggers and the data you choose to send to us. You can even completely self-host the entire platform.
34+
//1. You need to export each task
35+
export const helloWorld = task({
36+
//2. Use a unique id for each task
37+
id: "hello-world",
38+
//3. The run function is the main function of the task
39+
run: async (payload: { message: string }) => {
40+
//4. You can write code that runs for a long time here, there are no timeouts
41+
console.log(payload.message);
42+
},
43+
});
44+
```
3845

39-
## Don't worry about deployment
46+
## Deployment
4047

41-
Just use our SDK to write Jobs in your codebase. There's nothing extra to deploy and no CI to configure, your Jobs just connect to our cloud. Or you can always self-host.
48+
Use our SDK to write tasks in your codebase. There's no infrastructure to manage, your tasks automatically scale and connect to our cloud. Or you can always [self-host](https://trigger.dev/docs/v3/open-source-self-hosting#overview).
4249

43-
## Full visibility of every job run
50+
## Environments
4451

45-
View every Task in every Run so you can tell exactly what happened.
52+
We support `Development`, `Staging`, and `Production` environments, allowing you to test your tasks before deploying them to production.
4653

47-
![image](https://www.trigger.dev/build/_assets/web-app-2QFKXFLW.png)
54+
## Full visibility of every job run
4855

49-
## Built-in integrations
56+
View every task in every run so you can tell exactly what happened. We provide a full trace view of every task run so you can see what happened at every step.
5057

51-
Easily integrate with hundreds of third-party APIs – including your own. Use API keys (which never leave your server) or let us handle OAuth for you. Install our integration packages and easily subscribe to webhooks and perform common tasks, or you can easily use your existing favorite Node.JS SDKs and get resumability and idempotency through our `runTask` function.
58+
![Trace view image](https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/7c1b347f-004c-4482-38a7-3f6fa9c00d00/public)
5259

5360
# Getting started
5461

55-
Visit our docs [here](https://trigger.dev/docs).
62+
Visit our docs [here](https://trigger.dev/docs/v3/introduction) for a full guide on how to get started with Trigger.dev.
5663

5764
## Self-host
5865

59-
We provide an official trigger.dev docker image you can use to easily self-host the platform. We're working on more extensive guides but we currently provide a [Fly.io example repository](https://github.com/triggerdotdev/fly.io) with instructions in the README for deploying and using a self-hosted instance of Trigger.dev on Fly.io.
66+
If you prefer to self-host, you can follow our [self-hosting guide](https://trigger.dev/docs/v3/open-source-self-hosting#overview).
6067

6168
## Development
6269

6370
To setup and develop locally or contribute to the open source project, follow our [development guide](./CONTRIBUTING.md).
6471

65-
## Meet the Amazing People Behind This Project 🚀
72+
## Meet the Amazing People Behind This Project:
6673

6774
<a href="https://github.com/triggerdotdev/trigger.dev/graphs/contributors">
6875
<img src="https://contrib.rocks/image?repo=triggerdotdev/trigger.dev" />

apps/coordinator/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"execa": "^8.0.1",
2222
"nanoid": "^5.0.6",
2323
"prom-client": "^15.1.0",
24-
"socket.io": "4.7.4",
25-
"socket.io-client": "4.7.4"
24+
"socket.io": "4.7.4"
2625
},
2726
"devDependencies": {
2827
"@types/node": "^18",

0 commit comments

Comments
 (0)